aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2018-03-31 00:05:46 -0300
committerdequis <dx@dxzone.com.ar>2018-03-31 00:05:46 -0300
commit246b98bbdf221448fd7a638fea04373ed1612de5 (patch)
treea44ee558f1b761ed9fed0eae31f877b1d9e5c357 /protocols/jabber/jabber.c
parenta39ede755237aa0ea497ab45941a379f3c0352ef (diff)
jabber: try to join anyway after "Already present in chat"
Most of the time that error meant a confusion on bitlbee's side, often a server for which we sent a join request and never got a reply for.
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r--protocols/jabber/jabber.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index f31abc50..15b88b30 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -578,9 +578,14 @@ static struct groupchat *jabber_chat_join_(struct im_connection *ic, const char
if (strchr(room, '@') == NULL) {
imcb_error(ic, "%s is not a valid Jabber room name. Maybe you mean %s@conference.%s?",
room, room, jd->server);
- } else if (jabber_chat_by_jid(ic, room)) {
- imcb_error(ic, "Already present in chat `%s'", room);
} else {
+ struct groupchat *old;
+
+ if ((old = jabber_chat_by_jid(ic, room))) {
+ imcb_log(ic, "Warning: Already present in chat `%s' - trying to join anyway", room);
+ jabber_chat_free(old);
+ }
+
/* jabber_chat_join without the underscore is the conference.c one */
return jabber_chat_join(ic, room, final_nick, set_getstr(sets, "password"),
set_getbool(sets, "always_use_nicks"));