diff options
author | Michael Vetter <jubalh@iodoru.org> | 2022-06-11 12:33:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-11 12:33:56 +0200 |
commit | 4d6bc1adf8301dc5dc1986cc868171e2dd9179e1 (patch) | |
tree | 185e2fa3c6395c2e46ec1a9223d47335f936ccd7 /src/xmpp | |
parent | 8c313011c0dd1e69db8fec22282fefdbc25b089e (diff) | |
parent | 91e8a89b591caf93a5c3b3533f2a538806b181a3 (diff) | |
download | profani-tty-4d6bc1adf8301dc5dc1986cc868171e2dd9179e1.tar.gz |
Merge pull request #1717 from MarcoPolo-PasTonMolo/fix/chat-with-self-duplicate-msgs
Fix duplicate messages in chat with oneself.
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/message.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c index be7ceccf..6b29777f 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -1359,6 +1359,14 @@ _handle_carbons(xmpp_stanza_t* const stanza) return NULL; } + // Eliminate duplicate messages in chat with oneself when another client is sending a message + char* bare_from = xmpp_jid_bare(connection_get_ctx(), xmpp_stanza_get_from(message_stanza)); + if (g_strcmp0(bare_from, xmpp_stanza_get_to(message_stanza)) == 0) { + free(bare_from); + return NULL; + } + free(bare_from); + return message_stanza; } |