Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
start crayfish earlier so no messages are lost
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Nov 17, 2021
1 parent faed35c commit 6d2d3f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crayfish/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (c *CrayfishInstance) StartListening() error {
log.WithFields(log.Fields{
"error": err,
}).Error("[textsecure-crayfish-ws] Failed to start listening")
time.Sleep(time.Second * 5)
time.Sleep(time.Second * 2)
}
} else {
break
Expand Down
6 changes: 5 additions & 1 deletion textsecure.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ func setupLogging() {

// Setup initializes the package.
func Setup(c *Client) error {
go crayfish.Run()
var err error
client = c

Expand All @@ -274,7 +275,6 @@ func Setup(c *Client) error {
if err != nil {
return err
}
go crayfish.Run()

if needsRegistration() {
registration.Registration = registration.RegistrationInfo{
Expand Down Expand Up @@ -656,6 +656,10 @@ func handleReceivedMessage(env *signalservice.Envelope) error {
}
case signalservice.Envelope_UNIDENTIFIED_SENDER:

if registration.Registration.SignalingKey[0] != 1 {
log.Errorln("failed to handle message, signalingkey has wrong version, please re-register to update your signaling-key")
}

p, _ := proto.Marshal(env)
data, err := crayfish.Instance.HandleEnvelope(p)
if err != nil {
Expand Down

0 comments on commit 6d2d3f6

Please sign in to comment.