Commit Graph

58 Commits

Author SHA1 Message Date
Philipp Hörist fb4b262477 Dont use getTimestamp()
getTimestamp() generates always a timestring with a resolution of seconds and
this means time gets always rounded down.
Because we use a resolution of .00000 precision for outgoing messages this
can lead to wrongly sorted messages.
2018-02-12 21:27:55 +01:00
Philipp Hörist 7479bd8bd6 Refactor getting avatars from pubsub
- use SendAndCallForResponse instead of triggering an Event
- validate iq result even more, it didnt print iq errors before
2018-02-08 21:06:23 +01:00
Philipp Hörist 4bbc6b1972 Fail gracefully on invalid MAM GC Stanza
Fixes #8883
2018-02-07 19:20:19 +01:00
Philipp Hörist 7dacd51c1d Add complex caps test 2018-01-26 23:57:32 +01:00
Philipp Hörist 4c545be737 Inlcude account for message deduplication
It was not possible to write with 2 different accounts into the
same MUC
2018-01-25 00:47:00 +01:00
Bronko 3a3be94aa8 integrate httpupload plugin into gajim core
add new config option 'filetransfer_preference'
add drag and drop support for file upload
2018-01-22 17:29:27 +01:00
Philipp Hörist 1b11d77034 MAM: Dont convert own_jid to string
We need it later as JID object
2017-12-17 17:56:11 +01:00
Philipp Hörist 7815ce19a5 Dont use callbacks when sending messages
Using a callback to display a sent message inside the ChatControl means
that all messages we send have to be issued from the GUI layer
(send_message()) if we want them to display in the ChatControl.

This replaces the callback and catches the stanza-message-outgoing event
after it was processed by the core.

This is easier to read/understand than dealing with callbacks and lets
the core issue messages without having to care if a ChatControl is open or not
2017-12-10 18:56:29 +01:00
Philipp Hörist 786ef96400 Port InformationEvent handling to new interface 2017-12-09 00:15:26 +01:00
Philipp Hörist 7ec57e4dab Lower debug level for malformed avatar stanzas 2017-11-22 14:53:32 +01:00
Philipp Hörist 7f1776ede9 Improve deduplication
A stanza-id is only unique within a specific archive
This adds the archive jid to the query
2017-11-19 19:36:26 +01:00
Philipp Hörist cac1185a23 Remove log message 2017-11-19 19:36:26 +01:00
Philipp Hörist f57ec2fa34 Move common code out of HistoryWindow
- move it into message_archiving.py
2017-11-19 19:36:26 +01:00
Philipp Hörist 95357361bf Save account_id in logs table 2017-11-19 19:36:25 +01:00
Philipp Hörist 536a504f69 Remove Support for mam:0 2017-11-19 19:36:25 +01:00
Philipp Hörist 75b1d54b4c Add MAM for MUCs 2017-11-19 19:36:20 +01:00
Philipp Hörist 5236693df9 Parse stanza-id in groupchat correctly 2017-11-11 21:46:00 +01:00
Philipp Hörist 7f1a839e77 Deduplicate GC and MAM Messages based on stanza-id
- Add methods to determine the unique/stable id
- Write the id to the stanza_id DB field
- Add method to deduplicate based on the unique/stable id
2017-11-07 20:39:36 +01:00
Philipp Hörist 46926e71d1 Remove old message duplicate code
- Calculating so many hashes for each Message is quite expensive
- It hides our own implementation bugs, like when we retrieve history
from a MUC with wrong timestamps, or on rejoin. We never know about it
because the Messages are dropped.
- It should not be necessary anymore. The original problem was a bug
in nbxmpp which triggered mass resending of old messages.
2017-11-07 20:39:36 +01:00
Philipp Hörist 3c823d307d Save oob data also on MAM Messages
- add get_oob_data() so we can use it on more than one event
- also remove a forgotten print call
2017-11-04 13:51:12 +01:00
Philipp Hörist 20d5ea90e7 Store oob data into DB
Right now oob data is merged into the message text and stored into the DB.
If we load this message from the DB we cannot know anymore if and which
parts of the text was oob data.

Use the additional_data api to store oob data into the DB instead of
altering the original message text.

This lets us decide later on if and which data we want to display, even
on history replays. Also plugins can use the data.
2017-11-03 20:36:53 +01:00
Philipp Hörist 4c45c186c4 Pass additional_data to groupchats 2017-11-03 16:33:34 +01:00
Thilo Molitor 0638cdc690 Fix additional_data in events 2017-11-01 23:14:47 +01:00
Philipp Hörist 1c7369229e MUC: Save last message time after each message 2017-10-22 20:12:25 +02:00
Philipp Hörist 3a6e1ac9fc Catch exception for invalid avatars 2017-10-17 20:36:27 +02:00
Philipp Hörist 2446c7e3ed Refactor Blocking List
Fixes #8762
2017-10-15 18:03:41 +02:00
Philipp Hörist 1d5665632a Print malformed pubsub avatar stanzas 2017-10-08 14:32:59 +02:00
Philipp Hörist a01cdbf271 Refactor Avatars
- Add support for Pubsub Avatars
- Dont poll for vCard Updates, only use XEP-0153
- Dont cache vCards
- Store the avatar SHA of roster contacts in the DB
- Store the current SHA of each contact in the Contacts Object
- Move some code into the ConnectionVcard Class
2017-10-08 11:26:28 +02:00
Philipp Hörist 69248b2fe7 Fix pylint/pep8 errors 2017-09-29 00:11:29 +02:00
Yann Leboulanger a378152a9c Remove Gmail special options 2017-09-19 15:44:58 +02:00
Philipp Hörist 8bc2ab096e Add more log output in case we drop carbons 2017-09-03 22:35:56 +02:00
André Apitzsch 89c7eb6e6a Rename gajim.common.gajim to avoid name conflicts 2017-08-18 20:03:20 +02:00
André Apitzsch efec098aef Use absolute imports 2017-08-18 19:48:48 +02:00
Yann Leboulanger 21e144d89d use correct SID in Jingle FT to compute hostname of SOCKS5 connection. Fixes #8703 2017-08-16 15:27:35 +02:00
Philipp Hörist 8c920b35ff Move logging GC messages into connection_handlers
- It should be where all other message received handlers are
- Port to new DB API
2017-08-08 15:24:41 +02:00
Philipp Hörist 608655deed Use new DB API for logging status and errors 2017-08-08 14:41:55 +02:00
Philipp Hörist a2e2fb2ed1 Remove useless code
Simplify whats left
2017-08-02 23:40:55 +02:00
Philipp Hörist 9d2898bb35 Log sent messages with new logger method
- also save stanza id to the DB
2017-08-02 23:34:24 +02:00
Philipp Hörist 651611b28b Improve timestamp usage for MAM
- Use new parse_datetime() method
- Drop message with error if MAM doesnt supply a timestamp.
- If the user supplys an own timestamp, save it so we can decide in the
future how to display it.
2017-08-01 21:43:28 +02:00
Philipp Hörist e24d4f8caf Fix receiving MAM Messages from ourself
This is a regression from the refactoring
2017-08-01 21:39:11 +02:00
Philipp Hörist 1f5e927ca6 Use new DB methods for MAM Messages
- also push a new MamDecryptedMessageReceived
event after disco instead of writing directly to the DB
2017-08-01 21:39:11 +02:00
Yann Leboulanger 6a95fe79ae Merge branch 'xep-0319' into 'master'
Xep 0319

See merge request !110
2017-07-31 19:16:27 +02:00
Yann Leboulanger 28917aaf56 Do not use XEP-0012 anymore to know idle time. Use XEP-0319 2017-07-31 19:14:12 +02:00
Philipp Hörist 81566df8a1 Fix some regressions with MAM
- On single messages use the bare JID for DB querys
- Add more debug logging
- Some light refactoring
2017-07-30 23:04:50 +02:00
Philipp Hörist c1decf682b Adapt to latest nbxmpp changes 2017-07-29 21:35:45 +02:00
Philipp Hörist 9bca51eb69 Implement XEP-0359 Stable Stanza IDs
- This allows us to better deduplicate Messages on MAM syncs
2017-07-28 14:03:14 +02:00
Philipp Hörist 9ff601d03b Remove XEP-0136 support 2017-07-28 00:07:49 +02:00
Philipp Hörist 1e313cc7e2 Improve getting own jid
We get our full JID on the bind event.
After that it is saved in the `registered_name` attr on the Connection
Object.

In case the bind never occured we get the bare JID from config.
2017-07-27 22:14:29 +02:00
Philipp Hörist f449acd815 Refactor MamDecryptedMessageReceivedEvent
- Condition type = groupchat is not needed because we drop messages
type groupchat that come from the user archive. To get these messages
we will query the MUC.

- Because of this the logging method save_if_not_exists() can be much
simpler
2017-07-27 21:46:19 +02:00
Philipp Hörist fe1f2c0103 Dont drop MAM Message on missing stanza-id
A missing stanza ID means, we will have to take some measures to make
sure we get no duplicates in the Database later on.

Also fix getting the origin-id. Third time is a charm.
2017-07-27 03:33:19 +02:00