Changeset fb2338d for lib

Timestamp:
2015-10-30T10:28:32Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
884577f
Parents:
345577b
git-author:
dequis <dx@…> (13-09-15 04:45:43)
git-committer:
dequis <dx@…> (30-10-15 10:28:32)
Message:

jabber: Self message handling (echo removal) in MUCs

XMPP MUCs always echo own messages, and send messages from other
clients. So, we must display everything except the messages we just
sent.

This implementation uses the jabber stanza cache to add an ID to the
message and attach it to a callback which always returns XT_ABORT.
This way, if we do get the echo, the message packet handler can call
jabber_cache_handle_packet(), and if it returns XT_ABORT, it can skip
that particular message.

Every other message that looks like it comes from our own JID and wasn't
handled by the cache will be displayed, with the OPT_SELFMESSAGE flag

Stanza cache entries expire after some time, so it's not a problem if
the server doesn't echo messages for some reason.

I actually wrote this forever ago, for hipchat, but it works the same
way for standard XMPP MUCs.

(No files)

Note: See TracChangeset for help on using the changeset viewer.