GithubHelp home page GithubHelp logo

Comments (13)

nanu-c avatar nanu-c commented on August 19, 2024 3

We can continue to solve the remaining problems that way. If someone does the research in the original signal sources, then it's way more easy for me to provide a solution

from textsecure.

nanu-c avatar nanu-c commented on August 19, 2024

I think it's a duplicate of nanu-c/axolotl#110

from textsecure.

nanu-c avatar nanu-c commented on August 19, 2024

i would love it if you find the reason. I thought that textsecure isn't sending the messages to the linked devices and signal server doesn't forward it.

from textsecure.

selfbc avatar selfbc commented on August 19, 2024

If this helps, it's from this commit: signalapp/Signal-Desktop@7ca0dfd#diff-0b3c72f8fa053c9f175d037847bb9b32R124

I can give more information as needed.

from textsecure.

morph027 avatar morph027 commented on August 19, 2024

noticed this too this week:

signal[181]: time="2020/04/06 17:47:24" level=debug msg="[textsecure] SendMessageResponse: {NeedsSync:false Timestamp:1586188043845}\n"

from textsecure.

selfbc avatar selfbc commented on August 19, 2024

Yes, the library no longer works with Signal Desktop as of 1.32.0 due to these changes.

from textsecure.

nanu-c avatar nanu-c commented on August 19, 2024

timestamp is currently set here

textsecure/server.go

Lines 704 to 808 in 306535e

now := uint64(time.Now().UnixNano() / 1000000)
m["timestamp"] = now
m["destination"] = tel
body, err := json.Marshal(m)
if err != nil {
return nil, err
}
resp, err := transport.putJSON(fmt.Sprintf(messagePath, tel), body)
if err != nil {
return nil, err
}
if resp.Status == mismatchedDevicesStatus {
dec := json.NewDecoder(resp.Body)
var j jsonMismatchedDevices
dec.Decode(&j)
log.Debugf("[textsecure] Mismatched devices: %+v\n", j)
devs := []uint32{}
for _, id := range deviceLists[tel] {
in := true
for _, eid := range j.ExtraDevices {
if id == eid {
in = false
break
}
}
if in {
devs = append(devs, id)
}
}
deviceLists[tel] = append(devs, j.MissingDevices...)
return buildAndSendMessage(tel, paddedMessage, isSync)
}
if resp.Status == staleDevicesStatus {
dec := json.NewDecoder(resp.Body)
var j jsonStaleDevices
dec.Decode(&j)
log.Debugf("[textsecure] Stale devices: %+v\n", j)
for _, id := range j.StaleDevices {
textSecureStore.DeleteSession(recID(tel), id)
}
return buildAndSendMessage(tel, paddedMessage, isSync)
}
if resp.isError() {
return nil, resp
}
var smRes sendMessageResponse
dec := json.NewDecoder(resp.Body)
dec.Decode(&smRes)
smRes.Timestamp = now
log.Debugf("[textsecure] SendMessageResponse: %+v\n", smRes)
return &smRes, nil
}
func sendMessage(msg *outgoingMessage) (uint64, error) {
if _, ok := deviceLists[msg.tel]; !ok {
deviceLists[msg.tel] = []uint32{1}
}
dm := createMessage(msg)
content := &signalservice.Content{
DataMessage: dm,
}
b, err := proto.Marshal(content)
if err != nil {
return 0, err
}
resp, err := buildAndSendMessage(msg.tel, padMessage(b), false)
if err != nil {
return 0, err
}
if resp.NeedsSync {
log.Debugf("[textsecure] Needs sync. destination: %s", msg.tel)
sm := &signalservice.SyncMessage{
Sent: &signalservice.SyncMessage_Sent{
DestinationE164: &msg.tel,
Timestamp: &resp.Timestamp,
Message: dm,
},
}
_, serr := sendSyncMessage(sm)
if serr != nil {
log.WithFields(log.Fields{
"error": serr,
"destination": msg.tel,
"timestamp": resp.Timestamp,
}).Error("Failed to send sync message")
}
}
return resp.Timestamp, err
}
func sendSyncMessage(sm *signalservice.SyncMessage) (uint64, error) {
if _, ok := deviceLists[config.Tel]; !ok {
deviceLists[config.Tel] = []uint32{1}
}
content := &signalservice.Content{

and doesn't respect the envelope timestamp. We have to rebuild the message with the correct timestamp

from textsecure.

selfbc avatar selfbc commented on August 19, 2024

Looks like the API document hasn't been updated since 2014 - https://github.com/signalapp/Signal-Server/wiki/API-Protocol

from textsecure.

WanderingGlitch avatar WanderingGlitch commented on August 19, 2024

For what it's worth, modifying the check at https://github.com/signalapp/Signal-Desktop/blob/37ad95af2735f18ed33e9cc5808adae05d542bba/libtextsecure/message_receiver.js#L1378 shows that the envelope does have a timestamp but that the decrypted message does not.

Additionally, commenting out these lines in Signal Desktop allows messages to be received (including the queued ones that haven't been successfully processed): https://github.com/signalapp/Signal-Desktop/blob/37ad95af2735f18ed33e9cc5808adae05d542bba/libtextsecure/message_receiver.js#L1378-L1389

From what I can tell, createMessage needs to set the timestamp in the DataMessage and buildAndSendMessage needs to use the same value

from textsecure.

nanu-c avatar nanu-c commented on August 19, 2024

Will do that later that week, maybe this evening :)

from textsecure.

nanu-c avatar nanu-c commented on August 19, 2024

fixed in 6c66a38

from textsecure.

morph027 avatar morph027 commented on August 19, 2024

Jip, confirmed working, thank you! ❤️

from textsecure.

selfbc avatar selfbc commented on August 19, 2024

Everything is going good on my end. Thanks for the speedy work!

from textsecure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.