-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-instance conversation #28
Comments
I think we need to be careful to not do too much of the instance tag management in the libotr-ng - I suspect the plugin should be more responsible for this, just as we have it in the otr3 for Go-lang. |
This needs careful investigation to see if it makes sense for OTRv4. |
This involves looking at whether it makes sense, which policies makes sense, and also whether we should move some of this functionality away from libotr-ng to pidgin-otrng. |
After investigating a little bit from the plugin perspective:
This also happens:
|
So, for this case, apparently this is what happens: If your application allows the same user to be logged in multiple times from different locations, it should probably be aware of instance tags. A user can maintain multiple concurrent OTR conversations with a buddy who is logged in multiple times. Only one of the buddy's sessions can be a client who is running OTR protocol version 2. When a user has a conversation with a buddy who is running OTR protocol version 2, the conversation is associated with a ConnContext that lists "their_instance" as OTRL_INSTAG_MASTER (which has a value of 0) (This is not for our case). Each version 3 conversation with the same buddy will have its own ConnContext, which you can differentiate by the value in the In the linked list of ConnContexts, the master context for a buddy is always listed immediately before its children. Fingerprints are only stored with the master context. Given a ConnContext associated to a
If a user has multiple OTR sessions with the same buddy, your application will likely want to provide some way for the user to select which instance to send outgoing messages to. You can detect when a user has multiple OTR sessions with the same buddy by iterating over the ConnContexts of a buddy when a conversation has gone secure and checking whether more than one is not in plaintext state. You specify which instance outgoing messages are directed to in otrl_message_sending:
Instead of an actual instance tag, you can specify a meta instance tag (e.g., if the user has not made an explicit selection). Here are the list of meta instance tags, as defined in instag.h: #define OTRL_INSTAG_BEST 1 /* Most secure, based on: conv status, OTRL_INSTAG_BEST choses the instance that has the best conv status, then fingerprint status (in the event of a tie), then most recent (similarly in the event of a tie). When calculating how recent an instance has been active, OTRL_INSTAG_BEST is limited by a one second resolution. Note that instances do add some uncertainty when dealing with networks that only deliver messages to the most recently active session for a buddy who is logged in multiple times. If you have a particular instance selected, and the IM network is simply not going to deliver to that particular instance, there isn't too much libotr can do. In this case, you may want your application to warn when a user has selected an instance that is not the most recent. Do you think is something wanted? @olabini Let's discuss this on Monday as well. |
Furthermore, this is also the idea:
|
So, we decided to have 'policies' for instance tags:
Should be the same for retrieving prekey ensembles. We can also show this in the UI. |
I'm leaving this for someone to take it as I'm focusing on #179 . I'll take it after that or someone else can take it. |
From the plugin perspective, something like this should be possible:
libotr
keeps a separate context for each of these conversations and automatically manages when to add new contexts when a new instance tag is seen.When a message is sent, you may choose to send it to a particular instance tag or tell the library which strategy to use when deciding which instance should receive the message (
OTRL_INSTAG_BEST
,OTRL_INSTAG_RECENT
,OTRL_INSTAG_RECENT_RECEIVED
,OTRL_INSTAG_RECENT_SENT
).At the moment, we only support a single conversation with a peer (identified by its ID, like
[email protected]
).The text was updated successfully, but these errors were encountered: