1
0
Fork 1

Include message id with spam report

If they didn't pick a specific message but report the whole chat as
spam, most recent message is spam.

(cherry picked from commit 8dea8085bcbdaadd869ca29e797e767f14666540)
This commit is contained in:
Stephen Paul Weber 2024-10-29 12:09:20 -05:00 committed by Arne
parent 2094e3e5d6
commit 5fc913d0e8

View file

@ -71,7 +71,13 @@ public final class BlockContactDialog {
xmppActivity.xmppConnectionService.sendUnblockRequest(blockable);
} else {
boolean toastShown = false;
if (xmppActivity.xmppConnectionService.sendBlockRequest(blockable, binding.reportSpam.isChecked(), serverMsgId)) {
var finalServerId = serverMsgId;
if (serverMsgId == null && binding.reportSpam.isChecked() && blockable instanceof Conversation) {
final var lastM = ((Conversation) blockable).getLatestMessage();
if (lastM != null) finalServerId = lastM.getServerMsgId();
}
if (xmppActivity.xmppConnectionService.sendBlockRequest(blockable, binding.reportSpam.isChecked(), finalServerId)) {
Toast.makeText(xmppActivity, R.string.corresponding_chats_closed, Toast.LENGTH_SHORT).show();
toastShown = true;
}