diff -Nru biboumi-8.0/CHANGELOG.rst biboumi-8.3/CHANGELOG.rst --- biboumi-8.0/CHANGELOG.rst 2018-05-02 17:49:31.000000000 +0000 +++ biboumi-8.3/CHANGELOG.rst 2018-06-01 10:43:34.000000000 +0000 @@ -1,3 +1,20 @@ +Version 8.3 - 2018-06-01 +======================== + +- The global ad-hoc configure command is now available on biboumi’s JID in + fixed_irc_server mode. + +Version 8.2 - 2018-05-23 +======================== + +- The users are not able to bypass the fixed mode by just configuring a + different Address for the IRC server anymore. + +Version 8.1 - 2018-05-14 +======================== + +- Fix a crash on a raw NAMES command + Version 8.0 - 2018-05-02 ======================== diff -Nru biboumi-8.0/CMakeLists.txt biboumi-8.3/CMakeLists.txt --- biboumi-8.0/CMakeLists.txt 2018-05-02 17:49:31.000000000 +0000 +++ biboumi-8.3/CMakeLists.txt 2018-06-01 10:43:34.000000000 +0000 @@ -3,7 +3,7 @@ project(biboumi) set(${PROJECT_NAME}_VERSION_MAJOR 8) -set(${PROJECT_NAME}_VERSION_MINOR 0) +set(${PROJECT_NAME}_VERSION_MINOR 3) set(${PROJECT_NAME}_VERSION_SUFFIX "") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff -Nru biboumi-8.0/debian/changelog biboumi-8.3/debian/changelog --- biboumi-8.0/debian/changelog 2018-05-07 14:42:16.000000000 +0000 +++ biboumi-8.3/debian/changelog 2018-06-20 20:40:30.000000000 +0000 @@ -1,3 +1,13 @@ +biboumi (8.3-1) unstable; urgency=medium + + [ upstream ] + * New release(s). + + [ Jonas Smedegaard ] + * Fix typo in watch file usage comment. + + -- Jonas Smedegaard Wed, 20 Jun 2018 22:40:30 +0200 + biboumi (8.0-1) unstable; urgency=medium [ upstream ] diff -Nru biboumi-8.0/debian/watch biboumi-8.3/debian/watch --- biboumi-8.0/debian/watch 2018-05-07 12:47:31.000000000 +0000 +++ biboumi-8.3/debian/watch 2018-06-20 20:39:24.000000000 +0000 @@ -1,4 +1,4 @@ -# run "uscan --report" to check or "gbb import-orig --uscan" to update +# run "uscan --report" to check or "gbp import-orig --uscan" to update version=4 https://lab.louiz.org/louiz/biboumi/tags \ /louiz/biboumi/-/archive/[^/]+/biboumi@ANY_VERSION@@ARCHIVE_EXT@ diff -Nru biboumi-8.0/packaging/biboumi.spec.cmake biboumi-8.3/packaging/biboumi.spec.cmake --- biboumi-8.0/packaging/biboumi.spec.cmake 2018-05-02 17:49:31.000000000 +0000 +++ biboumi-8.3/packaging/biboumi.spec.cmake 2018-06-01 10:43:34.000000000 +0000 @@ -63,6 +63,15 @@ %changelog +* Wed Jun 1 2018 Le Coz Florent - 8.3-1 + Update to version 8.3 + +* Wed May 25 2018 Le Coz Florent - 8.2-1 + Update to version 8.2 + +* 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 diff -Nru biboumi-8.0/src/irc/irc_client.cpp biboumi-8.3/src/irc/irc_client.cpp --- biboumi-8.0/src/irc/irc_client.cpp 2018-05-02 17:49:31.000000000 +0000 +++ biboumi-8.3/src/irc/irc_client.cpp 2018-06-01 10:43:34.000000000 +0000 @@ -195,7 +195,8 @@ # ifdef BOTAN_FOUND this->credential_manager.set_trusted_fingerprint(options.col()); # endif - if (!options.col().empty()) + if (Config::get("fixed_irc_server", "").empty() && + !options.col().empty()) address = options.col(); #endif this->bridge.send_xmpp_message(this->hostname, "", "Connecting to " + @@ -536,7 +537,9 @@ 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 +642,11 @@ { 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) { @@ -774,6 +782,16 @@ { 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); diff -Nru biboumi-8.0/src/xmpp/biboumi_adhoc_commands.cpp biboumi-8.3/src/xmpp/biboumi_adhoc_commands.cpp --- biboumi-8.0/src/xmpp/biboumi_adhoc_commands.cpp 2018-05-02 17:49:31.000000000 +0000 +++ biboumi-8.3/src/xmpp/biboumi_adhoc_commands.cpp 2018-06-01 10:43:34.000000000 +0000 @@ -230,6 +230,7 @@ XmlSubNode instructions(x, "instructions"); instructions.set_inner("Edit the form, to configure the settings of the IRC server " + server_domain); + if (Config::get("fixed_irc_server", "").empty()) { XmlSubNode field(x, "field"); field["var"] = "address"; @@ -409,7 +410,7 @@ const XmlNode* value = field->get_child("value", "jabber:x:data"); const std::vector values = field->get_children("value", "jabber:x:data"); - if (field->get_tag("var") == "address" && value) + if (field->get_tag("var") == "address" && value && Config::get("fixed_irc_server", "").empty()) options.col() = value->get_inner(); if (field->get_tag("var") == "ports") diff -Nru biboumi-8.0/src/xmpp/biboumi_component.cpp biboumi-8.3/src/xmpp/biboumi_component.cpp --- biboumi-8.0/src/xmpp/biboumi_component.cpp 2018-05-02 17:49:31.000000000 +0000 +++ biboumi-8.3/src/xmpp/biboumi_component.cpp 2018-06-01 10:43:34.000000000 +0000 @@ -72,11 +72,16 @@ AdhocCommand configure_global_command({&ConfigureGlobalStep1, &ConfigureGlobalStep2}, "Configure a few settings", false); if (!Config::get("fixed_irc_server", "").empty()) - this->adhoc_commands_handler.add_command("configure", configure_server_command); + { + this->adhoc_commands_handler.add_command("server-configure", configure_server_command); + this->adhoc_commands_handler.add_command("global-configure", configure_global_command); + } else - this->adhoc_commands_handler.add_command("configure", configure_global_command); + { + this->adhoc_commands_handler.add_command("configure", configure_global_command); + this->irc_server_adhoc_commands_handler.add_command("configure", configure_server_command); + } - this->irc_server_adhoc_commands_handler.add_command("configure", configure_server_command); this->irc_channel_adhoc_commands_handler.add_command("configure", {{&ConfigureIrcChannelStep1, &ConfigureIrcChannelStep2}, "Configure a few settings for that IRC channel", false}); #endif } diff -Nru biboumi-8.0/tests/end_to_end/__main__.py biboumi-8.3/tests/end_to_end/__main__.py --- biboumi-8.0/tests/end_to_end/__main__.py 2018-05-02 17:49:31.000000000 +0000 +++ biboumi-8.3/tests/end_to_end/__main__.py 2018-06-01 10:43:34.000000000 +0000 @@ -608,6 +608,23 @@ ), 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(), @@ -874,28 +891,35 @@ handshake_sequence(), partial(send_stanza, ""), partial(expect_stanza, ("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", - "/iq/disco_items:query/disco_items:item[3]")), + "/iq/disco_items:query/disco_items:item[@node='configure']", + "/iq/disco_items:query/disco_items:item[4]", + "!/iq/disco_items:query/disco_items:item[5]")), ]), Scenario("list_admin_adhoc", [ handshake_sequence(), partial(send_stanza, ""), partial(expect_stanza, ("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", - "/iq/disco_items:query/disco_items:item[5]")), + "/iq/disco_items:query/disco_items:item[6]", + "!/iq/disco_items:query/disco_items:item[7]")), ]), Scenario("list_adhoc_fixed_server", [ handshake_sequence(), partial(send_stanza, ""), partial(expect_stanza, ("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", - "/iq/disco_items:query/disco_items:item[5]")), + "/iq/disco_items:query/disco_items:item[@node='global-configure']", + "/iq/disco_items:query/disco_items:item[@node='server-configure']", + "/iq/disco_items:query/disco_items:item[6]", + "!/iq/disco_items:query/disco_items:item[7]")), ], conf='fixed_server'), Scenario("list_admin_adhoc_fixed_server", [ handshake_sequence(), partial(send_stanza, ""), partial(expect_stanza, ("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", - "/iq/disco_items:query/disco_items:item[5]")), + "/iq/disco_items:query/disco_items:item[8]", + "!/iq/disco_items:query/disco_items:item[9]")), ], conf='fixed_server'), Scenario("list_adhoc_irc", [ @@ -904,20 +928,6 @@ partial(expect_stanza, ("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", "/iq/disco_items:query/disco_items:item[2]")), ]), - Scenario("list_adhoc_irc_fixed_server", - [ - handshake_sequence(), - partial(send_stanza, ""), - partial(expect_stanza, ("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", - "/iq/disco_items:query/disco_items:item[4]")), - ], conf='fixed_server'), - Scenario("list_admin_adhoc_irc_fixed_server", - [ - handshake_sequence(), - partial(send_stanza, ""), - partial(expect_stanza, ("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", - "/iq/disco_items:query/disco_items:item[6]")), - ], conf='fixed_server'), Scenario("list_muc_user_adhoc", [ handshake_sequence(), @@ -2790,6 +2800,40 @@ partial(send_stanza, ""), partial(expect_stanza, "/iq[@type='result']/commands:command[@node='configure'][@status='canceled']"), ]), + Scenario("global_configure_fixed", + [ + handshake_sequence(), + partial(send_stanza, ""), + partial(expect_stanza, ("/iq[@type='result']/commands:command[@node='global-configure'][@sessionid][@status='executing']", + "/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure some global default settings.']", + "/iq/commands:command/dataform:x[@type='form']/dataform:instructions[text()='Edit the form, to configure your global settings for the component.']", + "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='max_history_length']/dataform:value[text()='20']", + "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='boolean'][@var='record_history']/dataform:value[text()='true']", + "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='boolean'][@var='persistent']/dataform:value[text()='false']", + "/iq/commands:command/commands:actions/commands:next", + ), + after = partial(save_value, "sessionid", partial(extract_attribute, "/iq[@type='result']/commands:command[@node='global-configure']", "sessionid")) + ), + partial(send_stanza, "042"), + partial(expect_stanza, "/iq[@type='result']/commands:command[@node='global-configure'][@status='completed']/commands:note[@type='info'][text()='Configuration successfully applied.']"), + + partial(send_stanza, ""), + partial(expect_stanza, ("/iq[@type='result']/commands:command[@node='global-configure'][@sessionid][@status='executing']", + "/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure some global default settings.']", + "/iq/commands:command/dataform:x[@type='form']/dataform:instructions[text()='Edit the form, to configure your global settings for the component.']", + "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='max_history_length']/dataform:value[text()='42']", + "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='boolean'][@var='record_history']/dataform:value[text()='false']", + "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='boolean'][@var='persistent']/dataform:value[text()='false']", + "/iq/commands:command/commands:actions/commands:next", + ), + after = partial(save_value, "sessionid", partial(extract_attribute, "/iq[@type='result']/commands:command[@node='global-configure']", "sessionid")) + ), + partial(send_stanza, ""), + partial(expect_stanza, "/iq[@type='result']/commands:command[@node='global-configure'][@status='canceled']"), + + partial(send_stanza, ""), + partial(expect_stanza, ("/iq[@type='result']/commands:command[@node='server-configure'][@sessionid][@status='executing']",)) + ], conf='fixed_server'), Scenario("global_configure_persistent_by_default", [ handshake_sequence(),