From f75aaac5e9c0a0ce6e19c3d167ae41acc02f95b1 Mon Sep 17 00:00:00 2001 From: Valeriy Malov Date: Thu, 12 Oct 2017 15:23:12 +0300 Subject: Handle always_use_nicks more gracefully Add MUC buddies before applying nick changes --- protocols/jabber/conference.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index 75f3100c..b3d3f95e 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -350,11 +350,12 @@ void jabber_chat_pkt_presence(struct im_connection *ic, struct jabber_buddy *bud *s = 0; /* Should NEVER be NULL, but who knows... */ } + imcb_chat_add_buddy(chat, bud->ext_jid); + if (bud != jc->me && (jc->flags & JCFLAG_ALWAYS_USE_NICKS) && !(bud->flags & JBFLAG_IS_ANONYMOUS)) { imcb_buddy_nick_change(ic, bud->ext_jid, bud->resource); } - imcb_chat_add_buddy(chat, bud->ext_jid); if (s) { *s = '/'; } -- cgit v1.2.3 From 49108f35b8ca7974820b9d29e31965e5f0264270 Mon Sep 17 00:00:00 2001 From: dequis Date: Sun, 19 Nov 2017 21:51:16 -0300 Subject: jabber: Fix chat joins when ext_jid is provided for your own user This is the presence needed to finalize a join to the channel, the 'from' field is our own user in the context of that channel: Bitlbee takes the stuff to as the "real" jid, as it does for non-anonymous MUCs. It sets that to ext_jid, and uses it as the handle internally. In this particular case, that real jid is nonsense for us, so imcb_chat_add_buddy() interprets that as yet another person joining the channel, instead of the expected self-join. This fixes it by checking if the buddy is our own user, and ignoring the provided ext_jid in those cases. Thanks to ivucica for reporting this, who was using Biboumi (a gateway from XMPP to IRC) --- protocols/jabber/conference.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index b3d3f95e..6af7688d 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -328,6 +328,9 @@ void jabber_chat_pkt_presence(struct im_connection *ic, struct jabber_buddy *bud } } bud->flags |= JBFLAG_IS_ANONYMOUS; + } else if (bud == jc->me) { + g_free(bud->ext_jid); + bud->ext_jid = g_strdup(jd->me); } if (bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS) { -- cgit v1.2.3 From 4a9c6b0b15eb3738897dc1635fda2e4be67414ad Mon Sep 17 00:00:00 2001 From: dequis Date: Thu, 23 Nov 2017 17:57:04 -0300 Subject: cmd_chat_list_finish: fix crash when plugins provide NULL room titles --- root_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root_commands.c b/root_commands.c index 1cbf462f..957c9518 100644 --- a/root_commands.c +++ b/root_commands.c @@ -1439,7 +1439,7 @@ void cmd_chat_list_finish(struct im_connection *ic) ci = l->data; topic = ci->topic ? ci->topic : ""; - padded = str_pad_and_truncate(ci->title, title_len, "[...]"); + padded = str_pad_and_truncate(ci->title ? ci->title : "", title_len, "[...]"); irc_rootmsg(irc, iformat, ++i, padded, topic); g_free(padded); } -- cgit v1.2.3