From 04e83ca721ba65221a7e784ed11bc25950eebce9 Mon Sep 17 00:00:00 2001 From: "aaron@nanu-c.org" Date: Tue, 28 Dec 2021 00:10:35 +0100 Subject: [PATCH] fix textsecure cmd --- cmd/textsecure/main.go | 22 +++++++++++++++++++++- crayfish/backend.go | 4 +++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/cmd/textsecure/main.go b/cmd/textsecure/main.go index caf1d49..c75178d 100644 --- a/cmd/textsecure/main.go +++ b/cmd/textsecure/main.go @@ -113,7 +113,12 @@ func getCaptchaToken() string { return readLine("4. Enter captcha token>") } - +func getPhoneNumber() string { + return readLine("Enter Phone number beginning with + and country code like +44...>") +} +func getPin() string { + return readLine("Enter Pin>") +} func getVerificationCode() string { return readLine("Enter verification code>") } @@ -201,6 +206,14 @@ func conversationLoop(isGroup bool) { func receiptMessageHandler(msg *textsecure.Message) { } +func typingMessageHandler(msg *textsecure.Message) { +} +func callMessageHandler(msg *textsecure.Message) { +} +func syncSentHandler(msg *textsecure.Message, id uint64) { +} +func syncReadHandler(text string, id uint64) { +} func messageHandler(msg *textsecure.Message) { if echo { @@ -503,7 +516,14 @@ func main() { ReceiptMessageHandler: receiptMessageHandler, RegistrationDone: registrationDone, GetUsername: getUsername, + GetPhoneNumber: getPhoneNumber, + GetPin: getPin, + TypingMessageHandler: typingMessageHandler, + CallMessageHandler: callMessageHandler, + SyncReadHandler: syncReadHandler, + SyncSentHandler: syncSentHandler, } + err := textsecure.Setup(client) if err != nil { log.Fatal(err) diff --git a/crayfish/backend.go b/crayfish/backend.go index edb200b..8baa3c4 100644 --- a/crayfish/backend.go +++ b/crayfish/backend.go @@ -168,8 +168,10 @@ func Run() { } else if _, err := os.Stat("./crayfish/target/debug/crayfish"); err == nil { Instance.cmd = exec.Command("./crayfish/target/debug/crayfish") } else { - log.Errorln("[textsecure-crayfish] crayfish not found") + log.Errorln("[textsecure-crayfish] crayfish not found textsecure doesn't work without crayfish") + log.Errorln("[textsecure-crayfish] Please install crayfish, hints are in the README at https://github.com/signal-golang/textsecure") Instance.cmd = exec.Command("pwd") + os.Exit(1) } } else { Instance.cmd = exec.Command(path)