From be1efa31e01a96be922c7addba2d9207bfbdf5fc Mon Sep 17 00:00:00 2001 From: dequis Date: Sun, 20 Jul 2014 03:28:49 -0300 Subject: Add handle_is_self() prpl function to fix JID mismatch confusion bugs When bee_chat needs to check for self messages, it can call this function to let the protocol implementation do the comparison. In the case of jabber, sometimes the server reports a different username after login, this one is stored in jd->internal_jid, and the one that is used for login isn't changed --- protocols/jabber/jabber_util.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'protocols/jabber/jabber_util.c') diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c index d6396802..1a3d9fd4 100644 --- a/protocols/jabber/jabber_util.c +++ b/protocols/jabber/jabber_util.c @@ -823,6 +823,10 @@ gboolean jabber_set_me( struct im_connection *ic, const char *me ) jd->server = strchr( jd->me, '@' ); jd->username = g_strndup( jd->me, jd->server - jd->me ); jd->server ++; + + /* Set the "internal" account username, for groupchats */ + g_free( jd->internal_jid ); + jd->internal_jid = g_strdup( jd->me ); return TRUE; } -- cgit v1.2.3