Closed mcneb10 closed 3 weeks ago
Good to see the @mcneb10 PR :)
@Ri0n This PR is almost ready. I do have a few questions though.
Manager
wrapper class around the task?wrt testing Psi part is not ready yet, but Psi can load history from local db. So we need some code in Psi which will sync MAM with local db, It will be the first step. If you want to test something right in iris, I believe you need to write tests yourself. Psi has miniclient which can be ported to some integration tests in iris.
Manager sounds like a good idea, having API most suitable to be used by local db synchronizer. Like querying messages is just the first step and eventually it will have a lot of MAM control methods.
alright, i'll add a MAMManager
class that simplifies creating querying the MAM archives. As for the testing, I'll try to write a small plugin or patch or something to test the querying
@Ri0n if it doesn't bother you, can you help me out by modifying a Psi+ plugin or something to test my code? I'm not familiar with the Psi+ codebase, and some other recent changes to Iris are preventing Psi+ from compiling.
@Ri0n: Really important to finish this XEP support...
@mcneb10, that was my plan. I changed my job a few days ago and now completely consume by it. So I can't promise any quick solution. I have some ideas in mind though.
loadBeforeStanzaId(string stanzaId, int limit=100)
and loadAfterStanzaId
. This would secure the endless scrolling more carefully than timestamps. @mcneb10: What do you think about @Ri0n comment?
@mcneb10: What do you think about @Ri0n comment?
I'm not available to work right now, but i did add some of the changes rion requested. I'll push them in a day or two
@Ri0n i just added the code to iris which should serve the function of what you want in point 8. The two functions getLatestMessagesFromArchive
and getMessagesBeforeID
i added always scroll backwards, meaning they send the messages in the order of newest to oldest. The other functions have a configurable direction (set both flipPages and backwards to false and it will get messages in oldest to newest order).
As for only fetching messages in a specific time frame, you can simply do getArchiveByTimeRange
and set the from
to QDateTime()
and to
to a specific time to get all messages up to a specific point, respecting the order set in the manager constructor.
It also applies the other way, so if you set to
to QDateTime()
and from
to a specific time it will get all messages starting at the time you set until the latest message.
I'm going to be pretty busy for a while. I won't fix these issues for a few weeks
Im going to see if i can finish this up
I will not be able to get anywhere near finishing this code until there is a mechanism added somewhere in Psi+ to call my code
@Ri0n: Can you check?
It's important to know that the latest version of iris does not compile with Psi+ due to some changes to the carbons code
fixed in mam branch
Thank you for the fix! This is very exciting.
@mcneb10: Good job, an important part has been done!
Thanks @Ri0n for merging, but why not in master?
Can wait next parts ^^
I'd say it needs testing first
Here is my take on the MAM implementation so far