aboutsummaryrefslogtreecommitdiffstats
path: root/ipc.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-09-13 01:45:43 -0300
committerdequis <dx@dxzone.com.ar>2015-10-30 07:28:32 -0300
commitfb2338df133ff82ce06dbeae4737a50f26861fdb (patch)
tree80b05983f315603ab0a3233ffca350a7959e936e /ipc.c
parent345577bc90da1d1fffa0df013426eab54fa2b1b2 (diff)
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.
Diffstat (limited to 'ipc.c')
0 files changed, 0 insertions, 0 deletions