summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-09-17 22:36:59 +0200
committerlouiz’ <louiz@louiz.org>2018-09-17 22:36:59 +0200
commit88fe1783bfd58ea0dca9e9e507a046e5c982b779 (patch)
tree68a3e23f90234d7ba130fecbab83d7ef8b0f2fcc
parent08085d862fc7390eab6d6492040b178801096b82 (diff)
downloadbiboumi-88fe1783bfd58ea0dca9e9e507a046e5c982b779.tar.gz
biboumi-88fe1783bfd58ea0dca9e9e507a046e5c982b779.tar.bz2
biboumi-88fe1783bfd58ea0dca9e9e507a046e5c982b779.tar.xz
biboumi-88fe1783bfd58ea0dca9e9e507a046e5c982b779.zip
Do not change our nick if we send a presence to a non-joined channel
fix #3378
-rw-r--r--src/xmpp/biboumi_component.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp
index 85617e8..4ed47cf 100644
--- a/src/xmpp/biboumi_component.cpp
+++ b/src/xmpp/biboumi_component.cpp
@@ -185,8 +185,13 @@ void BiboumiComponent::handle_presence(const Stanza& stanza)
}
bridge->join_irc_channel(iid, to.resource, password ? password->get_inner(): "",
from.resource, history_limit, x != nullptr);
- if (!own_nick.empty() && own_nick != to.resource)
- bridge->send_irc_nick_change(iid, to.resource, from.resource);
+ const IrcClient* irc = bridge->find_irc_client(iid.get_server());
+ if (irc)
+ {
+ const auto chan = irc->find_channel(iid.get_local());
+ if (chan->joined)
+ bridge->send_irc_nick_change(iid, to.resource, from.resource);
+ }
}
else if (type == "unavailable")
{