hannesm / jackline

minimalistic secure XMPP client in OCaml
BSD 2-Clause "Simplified" License
251 stars 20 forks source link

contacts might be logged in via multiple clients #73

Closed hannesm closed 9 years ago

hannesm commented 9 years ago

once upon a time, there was a protocol with some behaviour and a good explanation how to deal with multiple computers logged into the same account... the concept of resources (the res in foo@bar/res) was born.. each resource has a priority, and dispatching should be done tp the one with highest priority...

but then, real world came into play: clients generate on reconnect random resources (and wish that you reuse the otr session), and clients and users do not adjust the priority appropriately (resulting in sending messages to the work computer on the weekend, while they should've gone to the mobile).

when I was young, I imagined that xmpp as specified in those regards can be used.. but unfortunately this is not the case: I had to implement 'resource_similar' to carry over the otr session; I also had to remove the invariant that I display only one line per buddy -- now buddies can be expanded and collapsed if there are multiple sessions... activating a specific session will talk with it (and has filtered messages only from that conversation); activating the general jid will merge the messages (and sending sends to foo@bar).

removing the invariant -- one active session -- cost quite some changes, but in the end, the code is more cleaned up now (and I can finally chat with those people on the weekends)...

hannesm commented 9 years ago

I've the suspicion this fixes #51 #59 #64 (or at least modifies the code in question enormously)

hannesm commented 9 years ago

please test and report regression.. I tested it myself a bit...

cfcs commented 9 years ago

Great work, I'll be back with feedback.

Now that users can have several sessions, what do you think about introducing "longterm"/"offline" sessions allowing asynchronous messaging between offline users? It's a bit of a hack, but it's deeply frustrating to be unable to leave messages for offline users. Having a special session would allow clients to build consensus about the fact that keys are stored on disk (encrypted?), and could be implemented without too much hassle with the new layout. A jackline-only solution would be acceptable to me, personally, but I suspect that the wider OTR community would also appreciate a feature like this, especially if the spec could be written up clearly and concisely so we won't have to wait another ten years for an OTR spec that resolves this issue. ... Thoughts?

hannesm commented 9 years ago

@cfcs thanks for raising this issue... this will be some major change: derived otr keys need to be saved somewhere -- it also reminds me much more of textsecure's ratchet and is sth to address at some point.