-
Notifications
You must be signed in to change notification settings - Fork 14
Mam improvements #134
base: master
Are you sure you want to change the base?
Mam improvements #134
Conversation
Codecov Report
@@ Coverage Diff @@
## master #134 +/- ##
==========================================
- Coverage 27.96% 25.91% -2.06%
==========================================
Files 71 73 +2
Lines 4051 4063 +12
==========================================
- Hits 1133 1053 -80
- Misses 2918 3010 +92
|
This pull request introduces 1 alert and fixes 2 when merging 31ec272 into 50ef274 - view on LGTM.com new alerts:
fixed alerts:
|
Hi @geobra . Did you have the opportunity to look at my pull requests? I have another one after these ones related to ui improvements and ability to choose attachments to download |
Hi @ron282. Sorry, was in Holiday. Will try to do the review at the weekend. |
I have to dig more into your code. From a functional point of view, the 'hard' stuff of requesting the MaM messages and to catch them inside the MessageHandler seems to work good. But I only get the MaM messages in the debug xml window. It did not get passed to the database. On my side, if I send a message to a group and go online 2 minutes later with shmoose, this line always discards the message: timestamp is always bigger then start. And start is set to -14 days. Does it work on your side? |
Okay, 'start' is always 'now' on my system, instead of -14 days.
With this changes But the message still did not show up in the gui. Need to digg more... |
Thanks for your feedback. I had a look. I don't have the issue. I'm testing directly on a phone (Xperia 10) |
source/base/Settings.cpp
Outdated
QDateTime returnValue = QDateTime::currentDateTimeUtc().addDays(-15); | ||
QSettings settings; | ||
QString jid=getJid(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be the jid of the other message partner or the group jid. As a result, there will be one entry in the settings file for each contact.
setLatestMamSyncDate is called after a Mam IQ Fin message is received. On the next request of the next group to catch MaM messages, the start-time is 'now'. If there are multiple groups, only the first group is requested with the correct last date. The next groups are requested with a start date of 'now'.
Swift::Forwarded::ref forwarded = nullptr; | ||
Swift::Message::ref forwardedMessage = nullptr; | ||
qint64 timestamp = 0; | ||
QString partyJid = QString::fromStdString(message->getFrom().toBare().toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partyJid is now set several times. And on my MaM messages, it get reset in different locations. Finally, the message is pushed into the db as a 1to1 messages with the group member, instead of a group messages. I will have a look at it and will make a proposal for a handleMessageReceived method. Please give me some time.
Have something working with some cheating. Had to clean it up now again... ;-). |
The muc archived msg must have a stanza-id with a by attribute which gives the bare JID of the account. Could it be a solution? |
I don't see the include-groupchat parameter in the archive request. This could be also an explanation why you don't see them. |
There is an include-groupchat parameter in the MaM request? Interesting. The current implementation works without that. Do you have a link to read about that? |
https://xmpp.org/extensions/xep-0313.html. Example 12 |
Ok, I see. Thank you for the link. The implementation get's to complex to test all cases manually. I started to setup a unit-test for the handleMessageReceived method. I will share all the code as soon as the first test succeeds. |
First simple test is running. Have a look at mam_improvments branch at my git repo. Basic stuff and mam handling is working here. Test must be filled with all different kinds of msg'es which gets handled. Needs some time ;-). |
You are welcome to add more tests or cherry-pick some changes and add to your branch for testing. |
I don't think the inlcude-groupchat has anything to do with your issue. I will have a look at your implementation. Are you testing with private groups or public ones? |
I have also a couple of additionnal improvements waiting for pull requests: omemo and muc, ui improvements for contact view and for message view. |
Currently the test is just set up and test plain 1to1 msg. Group message test will be implemented next. And it should not matter if it is a private or a public group chat. Are your other improvements independent from MaM? You are welcome to make another PR for other stuff. |
This pull request introduces 1 alert and fixes 2 when merging 9fd8b71 into 50ef274 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 2 when merging 0b9eaaa into 50ef274 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 2 when merging 0d67de0 into ebfc82c - view on LGTM.com new alerts:
fixed alerts:
|
This is a proposal to only sync mam with messages inserted since the last sync based on msgId and not based on date. There is one entry in the conf file per mam storage. |
This pull request introduces 1 alert and fixes 2 when merging cf67e61 into ebfc82c - view on LGTM.com new alerts:
fixed alerts:
|
I have some problems with the change in MessageHandler.cpp line 68 to convert delay into timestamp. mktime is using local time instead of utc time leading to incorrect time. |
This pull request introduces 1 alert and fixes 2 when merging 002c69e into ebfc82c - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 2 when merging b2ae907 into ebfc82c - view on LGTM.com new alerts:
fixed alerts:
|
You are right. I did no had the UTC issue in mind. Let's revert it to your implementation. |
This pull request introduces 1 alert and fixes 2 when merging 01710e3 into ebfc82c - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 1 alert and fixes 2 when merging bef0a71 into ebfc82c - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 2 alerts and fixes 2 when merging 92b0716 into ebfc82c - view on LGTM.com new alerts:
fixed alerts:
|
This reverts commit 7d88109.
This pull request introduces 2 alerts and fixes 2 when merging a924fcf into ebfc82c - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 2 alerts and fixes 2 when merging edd533b into 862d56d - view on LGTM.com new alerts:
fixed alerts:
|
Short update. I wrote more tests. Only a few tests are missing now and one critical FIXME. If these are resolved, we can resume discussions about a merge :-). |
Thanks. I will have a look at your tests. I'm ok to write some. I just need to get some examples. |
Hi friends, any nighly version to testing the new improvements?? i still can not using Shmoose because not compat with Conversations when using omemo. Thank of advance. |
Really, you have issues with omemo and Conversations? That works without any issues for me. |
BTW, we did not make many changes on the omemo implementation. I do not expect that a nightly build will solve your issues. |
@ron282 is it ok for you to postpone this until we have the qxmpp prove of concept? |
@geobra yes no pb to postpone |
No description provided.