powered by Jive Software

Chat history without received receipt messages in android

I am using below query to get chat history with particular user:

var result =  async { mamManager.queryMostRecentPage(jId, 70) }.await()

The issue is, I am also getting received receipts as a message in this list. and I just want to get list without received receipt messages.

Can anyone help with that?

I am using below Gradle dependencies:

implementation "org.igniterealtime.smack:smack-android:4.3.4"
    implementation "org.igniterealtime.smack:smack-tcp:4.3.4"
    implementation "org.igniterealtime.smack:smack-im:4.3.4"
    implementation "org.igniterealtime.smack:smack-extensions:4.3.4"
    implementation "org.igniterealtime.smack:smack-experimental:4.3.4"
    implementation "org.igniterealtime.smack:smack-bosh:4.3.4"

Then you probably have to filter the result list yourself. While it sure would be technically possible to do the filtering on the server side, it is currently not specified and hence also not implemented.

Thanks for the help.

Is there any other way I can do? I mean can i write query using smack or without smack in which i can get this result? If yes then guide me in some direction.

You could do something along the lines of messages.stream().filter(m -> !hasDeliveryReceipt(m)).collect(Collectors.toList());
where hasDeliveryReceipt() is a method that returns true if the message contains a delivery receipt and where messages is the list of messages you got back from the MAM query.

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.