Commit graph

2,748 commits

Author SHA1 Message Date
Goffi
1307adcd71 core (xmpp): added "extra" argument to client.feedback 2019-01-04 11:13:31 +01:00
Goffi
ccfdb695bc memory (sqlite): minor comment move 2019-01-04 09:26:57 +01:00
Goffi
610e88841a memory (sqlite): retry _runInteraction in the same way as for _runQuery, this improve reliability 2019-01-04 09:21:16 +01:00
Goffi
30081bba79 plugin XEP-0384: don't ignore StanzaError if it's not item-not-found 2019-01-04 09:20:32 +01:00
Goffi
6a64556fd2 plugin XEP-0384: various bug fixes:
- fixed trust management on message sending, when trusts are missing
- retrieve identiy keys when trust has not been set yet
- added our own device when it is found missing on PEP notification
- mark message as trusted when suitable
2019-01-03 21:04:55 +01:00
Goffi
09020b7108 core (memory/encryption), plugin OTR: finished OTR integration in encryption:
- messageEncryptionStart and messageEncryptionStop are now async
- an encryption plugin can now have a startEncryption and endEncryption method, which are called automatically when suitable
- trust is now put in "trusted" key of message_data, and markAsTrusted has been added, it is used in OTR
- getTrustUI implemented for OTR, using legacy authenticate code
- catch potr.crypt.InvalidParameterError on decryption
- fixed some service OTR messages which were not correctly marked as not for storing, and thus were added to MAM archive/carbon copied
- other bug fixes
2019-01-03 21:00:00 +01:00
Goffi
e5e0913aec core (xmpp): implemented human friendly __unicode__ for client 2019-01-03 20:51:08 +01:00
Goffi
7dc9aae5aa tools (xml_tools): isXMLUICancelled helper function to check if an XMLUI has been cancelled from raw XML. 2019-01-03 20:49:21 +01:00
Goffi
c059645abf jp (message/send, encryption): encryption handling:
- encryption algorithm can now be requested when sending a message (using --encrypt option)
- new encryption commands to (de)activate encryption session, check available algorithms, or manage trust.
2019-01-02 18:50:57 +01:00
Goffi
bd9cec8b47 jp (xmlui): JidWidget + small improvments:
- JidWidget is now handled basically using TextWidget.
- EmptyWidget display an empty line.
- BoolWidget display current value with an asterisk when write is allowed.
- fixed an bug in LabelContainer when for_name was not specified.
2019-01-02 18:50:47 +01:00
Goffi
111d77e75e plugin XEP-0384: update to last python-omemo + trust management:
- Plugin has been updated to use last version of python-omemo (10.0.3).
- A temporary method remove all storage data if they are found, this method must be removed before 0.7 release (only people using dev version should have old omemo data in there storage).
- Trust management is not implemented, using new encryptionTrustUIGet method (an UI is also displayed when trust handling is needed before sending a message).
- omemo.DefaultOTPKPolicy is now used, instead of previous test policy of always deleting.

OMEMO e2e encryption is now functional for one2one conversations, including fingerprint management.
2019-01-02 18:50:28 +01:00
Goffi
24c4cc0487 frontends (XMLUI): TabsContainer can now be the main container (Primitivus keep the old behaviour and always use VerticalContainer as main container) 2019-01-02 18:32:16 +01:00
Goffi
c2a1ba3793 core (xmpp): don't send message without message or subject to bridge (and log a warning in frontends if such a message is received) 2019-01-02 18:28:30 +01:00
Goffi
6e38be1dab core (memory/sqlite): new delPrivateNamespace method to delete all data of a specific namespace for a profile. 2019-01-02 18:25:55 +01:00
Goffi
c87e9a23e3 core (memory/persistent): new LazyPersistentBinaryDict.remove method 2019-01-02 18:24:14 +01:00
Goffi
24468a9138 core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
- encryptionNamespaceGet retrieves algorithm namespace from its short name
- encryptionTrustUIGet retrieves trust mangement XMLUI from encryption plugin
- new markAsUntrusted internal helper method, to add untrusted flag to message data
2019-01-02 18:22:30 +01:00
Goffi
93a73aec45 core (log): fixed double call to ansiColors 2018-12-27 11:40:04 +01:00
Goffi
97d655682c core (xmpp): set "to" attribute to <message> element when it's missing:
when missing, profile's full jid is used as "to" attribute. This way, "to" attribute can be retrieved later without having to check if it has been set or not.
2018-12-27 11:40:04 +01:00
Goffi
575b5dd126 quick frontend(chat): use unicode on jid.JID instance in self.host.bridge.messageEncryptionGet:
jid.JID is causing trouble when going trough bridge (with pb bridge), this patch avoid it by using unicode.
2018-12-27 11:40:04 +01:00
Goffi
b906423cfb plugin XEP-0198: rised ACK_TIMEOUT + set req_time to None when timing out to be ready after resuming 2018-12-27 09:21:10 +01:00
Goffi
d3d39bad5d plugin XEP-0045: fixed bad MAM detection on join 2018-12-26 17:21:39 +01:00
Goffi
6852b6b677 plugin XEP-0198: allow to customise/disable ack_timeout:
"ack_timeout" setting can be set in [DEFAULT] section to the number of seconds before timing out, or to 0 to disable the timeout.
2018-12-26 17:21:38 +01:00
Goffi
9c95044cb8 plugin OTR: catch and log potr.context.ErrorReceived instead of raising it. 2018-12-26 17:18:52 +01:00
Goffi
3515defd64 plugin XEP-0198: abort connection if ack is not received after a timeout:
If ack is not received after a given time (currently 25s), connection is aborted.
This avoid waiting forever when TCP link is lost (i.e. switching from cable to wifi), and allows to use resuming mechanism.
2018-12-26 14:37:13 +01:00
Goffi
bea35db274 plugin XEP-0045: don't loop when initiating MAM archive 2018-12-12 08:58:52 +01:00
Goffi
8cc39ea3a5 plugin XEP-0045: request 50 *last* MAM messages if new archive 2018-12-12 01:13:15 +01:00
Goffi
0e70587857 core (memory/sqlite): further improvments in update_v7:
- "info" messages deletion is now done by deactivating foreign keys. This seriously boost performances.
- "VACUUM" is done at the end to reduce database size.
2018-12-12 00:53:14 +01:00
Goffi
82d16029b8 core (memory/sqlite): fixed v7 update performance issue:
Performance issue was due to bad ordering in table dropping, this has been fixed.
"infos" message are also deleted by this update as they are containing only presence data and take a lot of space for a barely useful data.
A config option may be available in the future to store presence data in logs.
2018-12-11 23:53:27 +01:00
Goffi
51bc3411ba core (memory/sqlite): do not call commitStatements if there is nothing to commit in checkUpdates 2018-12-10 21:06:20 +01:00
Goffi
1a9e8d8cb1 jp (message/mam): display metadata when verbose 2018-12-10 20:34:45 +01:00
Goffi
c77bc72490 plugin XEP-0313, XEP-0045: loop MAM requests until whole archive is retrieved:
- plugin xep-0313: new serialise method
-                : getArchives now returns an extra mam_response dict with "complete" and "stable" status
-                : MAMGet now return a new metadata dict before profile (with serialised RSM and MAM response)
2018-12-10 20:34:45 +01:00
Goffi
97915f0fbe plugin XEP-0059: added serialise method 2018-12-10 20:34:45 +01:00
Goffi
c2d7c3e69e core (memory/sqlite): changed history constraint
/!\ Database schema change /!\
History was using a unique constraint on `profile_id, timestamp, source, dest, source_res, dest_res`, which can cause trouble because several messages send quickly by the same person can have a common timestamp (specially with delayed messages where precision is second), resulting in message loss.
The new constraint use `profile_id, stanza_id, source, dest` where `stanza_id` is XEP-0359 stanza_id, so it's unique by definition, and no message should be lost anymore.
Because sqlite doesn't support altering table with a constraint change, we have to create new tables and copy old data to new one, which can be pretty long.
Sqlite update mechanism with "specifics" has been fixed when several updates are applied (e.g. moving from v5 to v7) and a specific is in the workflow.
2018-12-09 14:07:26 +01:00
Goffi
35e15c664c plugin XEP-0045: MAM implementation for MUC 2018-12-07 19:13:28 +01:00
Goffi
7e79203fa0 core (xmpp): check <message> namespace in parseMessage, and accept empty namespace (happen with Wokkel) 2018-12-07 17:46:50 +01:00
Goffi
6bb1b599ab plugin XEP-0313: improvments to prepare MUC MAM:
- discard groupchat message when retrieving last stanza_id on connection
- service can be specified in getMessageFromResult
- service is also used when using getArchives from bridge
2018-12-07 17:43:43 +01:00
Goffi
13cfba0f8a core (memory/disco): normalise booleans in extensions 2018-12-01 14:40:32 +01:00
Goffi
a245e32391 core (memory/sqlite): skip a line before debug log showing statements 2018-12-01 14:39:35 +01:00
Goffi
bd7ae59674 jp (info/disco): better default output for extensions 2018-12-01 14:35:28 +01:00
Goffi
f83e4f3334 tools (common/data_format): use "default" in json.dumps in serialise (useful notably to serialise jid.JID) 2018-12-01 14:34:55 +01:00
Goffi
51fef1d271 jp (message): new mam subcommand:
this subcommand allow to retrieve message history from MAM archive.
Note that the name may change in the future, it can be integrated to a "message/get" or "message/log" command.
2018-12-01 10:48:01 +01:00
Goffi
c4997f690c jp (output): new OUTPUT_MESS output to handle data containing chat messages 2018-12-01 10:48:01 +01:00
Goffi
93b23f1cc8 jp (base): pubsub legacy --max option renamed to --max-item to prepare the use of --max for RSM. 2018-12-01 10:47:59 +01:00
Goffi
32af40e098 jp (base): new own_jid host attribute:
this attribute is None by default and must be filled at runtime if needed by a command.
2018-12-01 10:42:25 +01:00
Goffi
31eae6db71 jp (base): new date_decoder to specify dates in arguments 2018-12-01 10:41:37 +01:00
Goffi
4b81275fdf tools (common/date_utils): date_parse_ext + timezone handling:
- new date_parse_ext method parse a date where relative informations can be added. e.g.: "1 week ago", "now - 2 days", "01/01/01 01:01 + 3 hours".
- new TZ_UTC and TZ_LOCAL constants can be used to use UTC time or local time zone.
- date_parse* can now use a default_tz, which will be used if timezone if not specified in date format (default UTC).
- tz_info can now be used in date_format to format the time in given timezone (default: UTC).
2018-12-01 10:40:19 +01:00
Goffi
8e27547531 plugin XEP-0060: use new parseExtra methods from MAM and RSM 2018-12-01 10:34:42 +01:00
Goffi
39d2409273 plugin XEP-0313: implementation of MAM for messages:
- (core/xmpp): new messageGetBridgeArgs to easily retrieve arguments used in bridge from message data
-            : parseMessage is not static anymore
-            : new "message_parse" trigger point
- (xep-0313) : new "MAMGet" bridge method to retrieve history from MAM instead of local one
-            : on profileConnected, if previous MAM message is found (i.e. message with a stanza_id), message received while offline are retrieved and injected in message workflow.
               In other words, one2one history is synchronised on connection.
-            : new "parseExtra" method which parse MAM (and optionally RSM) option from extra dictionary used in bridge.
2018-12-01 10:33:43 +01:00
Goffi
7d82242b74 plugin XEP-0059: added "parseExtra" method to easily handle RSM argument coming from bridge. 2018-12-01 10:10:25 +01:00
Goffi
0b8e750956 core (memory/sqlite): added stanza_id:
/!\ database schema change /!\
stanza_id is a new field in history added to prepare the implementation of MAM for messages.
A new "last_stanza_id" can be used in filters to retrieve last message with a know stanza id (useful for history synchronisation).
2018-12-01 10:08:17 +01:00