ReneVolution / profanity-omemo-plugin

A Python plugin to use (axolotl / Signal Protocol) encryption for the profanity XMPP messenger
GNU General Public License v3.0
64 stars 14 forks source link

Request bundles on first message #8

Closed ReneVolution closed 7 years ago

ReneVolution commented 7 years ago

Currently, bundles are fetched as soon as a device list update occurs.

By the spec, the bundle should be fetched just before the first message is sent. Therefore we need some queueing mechanism for the message to wait until the bundle info for all devices is received.

So, the implementation needs to store the sender jid, receiver jid, plaintext message, creation timestamp and some timeouts for events e.g. no bundle received, not all devices trusted etc.

Maybe in the form of an abstract class which subclasses have to implement process, on_warning, on_error.

ReneVolution commented 7 years ago

The bundle is now fetched if active devices do not have sessions built, just before a message is sent.