From 4f6bf078d2e60cab47f43a09decc12aa4fba08ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 15 May 2018 19:29:37 +0200 Subject: Improve the forward_server_message to concatenate everything --- src/irc/irc_client.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 8f77e0d..fca043c 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); } -- cgit v1.2.3 From a8e922fc890a8ef2c1c43b940f0cfc3768ea1cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 15 May 2018 19:31:26 +0200 Subject: Handle the NAMES message for an already-joined or non-existing channel If a user manually does a NAMES query, the result were interpreted as a user list, which is wrong. And with the special * argument, this would even cause a crash. Fix #3357 --- src/irc/irc_client.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index fca043c..d0b2153 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -641,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 nicks = utils::split(message.arguments[3], ' '); for (const std::string& nick: nicks) { @@ -776,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); -- cgit v1.2.3 From 861f55ed83aedfc7bcd2de1ac0ae0a9f21b910cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 15 May 2018 19:47:40 +0200 Subject: Add a e2e test for a raw NAMES command --- tests/end_to_end/__main__.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py index a7a6a91..f8ef2d4 100644 --- a/tests/end_to_end/__main__.py +++ b/tests/end_to_end/__main__.py @@ -608,6 +608,23 @@ if __name__ == '__main__': ), partial(expect_stanza, "/message[@from='#foo%{irc_server_one}'][@type='groupchat']/subject[not(text())]"), ]), + Scenario("raw_names_command", + [ + handshake_sequence(), + partial(send_stanza, + ""), + connection_sequence("irc.localhost", '{jid_one}/{resource_one}'), + partial(expect_stanza, + "/message/body"), + partial(expect_stanza, + "/presence/muc_user:x/muc_user:status[@code='110']" + ), + partial(expect_stanza, "/message/subject[not(text())]"), + partial(send_stanza, + "NAMES"), + partial(expect_stanza, "/message/body[text()='irc.localhost: = #foo @{nick_one} ']"), + partial(expect_stanza, "/message/body[text()='irc.localhost: * End of /NAMES list. ']"), + ]), Scenario("quit", [ handshake_sequence(), -- cgit v1.2.3 From 1c4620d992d64e585c028659b0001b5f8ba94235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 15 May 2018 19:50:41 +0200 Subject: Release version 8.1 --- CHANGELOG.rst | 5 +++++ CMakeLists.txt | 2 +- packaging/biboumi.spec.cmake | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 194c75c..1385f40 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,8 @@ +Version 8.1 - 2018-05-14 +======================== + +- Fix a crash on a raw NAMES command + Version 8.0 - 2018-05-02 ======================== diff --git a/CMakeLists.txt b/CMakeLists.txt index 1112f0a..0d59aa7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0) project(biboumi) set(${PROJECT_NAME}_VERSION_MAJOR 8) -set(${PROJECT_NAME}_VERSION_MINOR 0) +set(${PROJECT_NAME}_VERSION_MINOR 1) set(${PROJECT_NAME}_VERSION_SUFFIX "") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/packaging/biboumi.spec.cmake b/packaging/biboumi.spec.cmake index 4b15540..119505c 100644 --- a/packaging/biboumi.spec.cmake +++ b/packaging/biboumi.spec.cmake @@ -63,6 +63,9 @@ make check %{?_smp_mflags} %changelog +* Wed May 14 2018 Le Coz Florent - 8.1-1 + Update to version 8.1 + * Wed May 2 2018 Le Coz Florent - 8.0-1 Update to version 8.0 -- cgit v1.2.3