-
I have a question related to MAM query. So Whenever I send a message, I receive back only a stanza id, however, I cannot query MAM based on stanza id. I can query MAM for a specific user with either message afterUid/beforeUid(which is different from stanza id), or Date. I can get message Uid for received messages but I can't get it for outgoing messages. Is there any way to query MAM by stanza ID? If not then, how can I get a message Uid for outgoing message? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can use it is query rsm:
This will return messages directly after id you provided. |
Beta Was this translation helpful? Give feedback.
That's currently not supported by the protocol. One issue would be that the server cannot blindly trust client-generated IDs to be unique (how to handle the case where multiple clients use the same IDs, or a single client reuses IDs, and so on).
A pragmatic solution is to just query the history the last known stanza ID, and then de-duplicate known messages (maybe simply based on your client-generated message ID).