summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-05-15 19:58:03 +0200
committerlouiz’ <louiz@louiz.org>2018-05-15 19:58:03 +0200
commit28d79a9eaa5a85f1f44d03a224517e1ccae294ba (patch)
treea8f7212f26daaa3f94ccadcd028027c896887e0e /src/irc/irc_client.cpp
parentba61d2034058818fe76cef6b23f311259d37b3fe (diff)
parent1c4620d992d64e585c028659b0001b5f8ba94235 (diff)
downloadbiboumi-28d79a9eaa5a85f1f44d03a224517e1ccae294ba.tar.gz
biboumi-28d79a9eaa5a85f1f44d03a224517e1ccae294ba.tar.bz2
biboumi-28d79a9eaa5a85f1f44d03a224517e1ccae294ba.tar.xz
biboumi-28d79a9eaa5a85f1f44d03a224517e1ccae294ba.zip
Merge branch 'v8'
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index 8f77e0d..d0b2153 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -536,7 +536,9 @@ void IrcClient::send_ping_command()
void IrcClient::forward_server_message(const IrcMessage& message)
{
const std::string from = message.prefix;
- const std::string body = message.arguments[1];
+ std::string body;
+ for (auto it = std::next(message.arguments.begin()); it != message.arguments.end(); ++it)
+ body += *it + ' ';
this->bridge.send_xmpp_message(this->hostname, from, body);
}
@@ -639,6 +641,11 @@ void IrcClient::set_and_forward_user_list(const IrcMessage& message)
{
const std::string chan_name = utils::tolower(message.arguments[2]);
IrcChannel* channel = this->get_channel(chan_name);
+ if (channel->joined)
+ {
+ this->forward_server_message(message);
+ return;
+ }
std::vector<std::string> nicks = utils::split(message.arguments[3], ' ');
for (const std::string& nick: nicks)
{
@@ -774,6 +781,16 @@ void IrcClient::on_channel_completely_joined(const IrcMessage& message)
{
const std::string chan_name = utils::tolower(message.arguments[1]);
IrcChannel* channel = this->get_channel(chan_name);
+ if (chan_name == "*" || channel->joined)
+ {
+ this->forward_server_message(message);
+ return;
+ }
+ if (!channel->get_self())
+ {
+ log_error("End of NAMES list but we never received our own nick.");
+ return;
+ }
channel->joined = true;
this->bridge.send_user_join(this->hostname, chan_name, channel->get_self(),
channel->get_self()->get_most_significant_mode(this->sorted_user_modes), true);