You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’d like to ask about the recommended or most efficient way to retrieve and display the last message of each contact in a contact list (similar to what is shown in common chat applications), covering both 1:1 chats and MUC rooms.
Current approach
Currently, our implementation works as follows:
We maintain a list of JIDs (users and MUCs).
For each JID in the list, we perform a separate MAM query.
We request the last page of results (using RSM paging).
From that page, we extract the last message and store/display it as the conversation preview.
While this works functionally, it has some drawbacks:
Multiple MAM queries (one per JID), which can be costly for large contact lists.
Increased latency when rendering the conversation list.
Higher load on ejabberd when many clients request this simultaneously.
Questions
Is this approach considered acceptable/best practice from the ejabberd point of view?
Is there a more efficient or canonical way to retrieve the last message per JID (1:1 and MUC)?
For example, server-side aggregation?
Hooks or modules that track/store the last message per conversation?
Any recommended usage of MAM or other XEPs for this use case?
Are there existing modules or patterns used by other clients to solve this problem efficiently?
Any guidance, references, or examples would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I’d like to ask about the recommended or most efficient way to retrieve and display the last message of each contact in a contact list (similar to what is shown in common chat applications), covering both 1:1 chats and MUC rooms.
Current approach
Currently, our implementation works as follows:
While this works functionally, it has some drawbacks:
Questions
Is this approach considered acceptable/best practice from the ejabberd point of view?
Is there a more efficient or canonical way to retrieve the last message per JID (1:1 and MUC)?
Are there existing modules or patterns used by other clients to solve this problem efficiently?
Any guidance, references, or examples would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions