From 1e56c59e8241dbfc6a2526c371cc2e894f9d0f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 25 Apr 2016 11:29:52 +0200 Subject: Include the Configure ad-hoc command on biboumi's JID for fixed_irc_server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because a jid like “freenode.example.org” is both the JID for the configured IRC server, and biboumi’s JID. fix #3175 --- src/xmpp/biboumi_adhoc_commands.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/xmpp/biboumi_adhoc_commands.cpp') diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index 7c157cb..eec930d 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -118,16 +118,19 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com { const Jid owner(session.get_owner_jid()); const Jid target(session.get_target_jid()); + std::string server_domain; + if ((server_domain = Config::get("fixed_irc_server", "")).empty()) + server_domain = target.local; auto options = Database::get_irc_server_options(owner.local + "@" + owner.domain, - target.local); + server_domain); XmlNode x("jabber:x:data:x"); x["type"] = "form"; XmlNode title("title"); - title.set_inner("Configure the IRC server "s + target.local); + title.set_inner("Configure the IRC server "s + server_domain); x.add_child(std::move(title)); XmlNode instructions("instructions"); - instructions.set_inner("Edit the form, to configure the settings of the IRC server "s + target.local); + instructions.set_inner("Edit the form, to configure the settings of the IRC server "s + server_domain); x.add_child(std::move(instructions)); XmlNode required("required"); @@ -285,8 +288,11 @@ void ConfigureIrcServerStep2(XmppComponent&, AdhocSession& session, XmlNode& com { const Jid owner(session.get_owner_jid()); const Jid target(session.get_target_jid()); + std::string server_domain; + if ((server_domain = Config::get("fixed_irc_server", "")).empty()) + server_domain = target.local; auto options = Database::get_irc_server_options(owner.local + "@" + owner.domain, - target.local); + server_domain); for (const XmlNode* field: x->get_children("field", "jabber:x:data")) { const XmlNode* value = field->get_child("value", "jabber:x:data"); -- cgit v1.2.3