diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/identd/identd_socket.cpp | 9 | ||||
-rw-r--r-- | src/main.cpp | 7 | ||||
-rw-r--r-- | src/xmpp/biboumi_adhoc_commands.cpp | 16 | ||||
-rw-r--r-- | src/xmpp/biboumi_component.cpp | 11 | ||||
-rw-r--r-- | src/xmpp/biboumi_component.hpp | 2 |
5 files changed, 14 insertions, 31 deletions
diff --git a/src/identd/identd_socket.cpp b/src/identd/identd_socket.cpp index 46553ca..a94f172 100644 --- a/src/identd/identd_socket.cpp +++ b/src/identd/identd_socket.cpp @@ -38,14 +38,7 @@ void IdentdSocket::parse_in_buffer(const std::size_t) static std::string hash_jid(const std::string& jid) { - sha1nfo sha1; - sha1_init(&sha1); - sha1_write(&sha1, jid.data(), jid.size()); - const uint8_t* res = sha1_result(&sha1); - std::ostringstream result; - for (int i = 0; i < HASH_LENGTH; i++) - result << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>(res[i]); - return result.str(); + return sha1(jid); } std::string IdentdSocket::generate_answer(const BiboumiComponent& biboumi, uint16_t local, uint16_t remote) diff --git a/src/main.cpp b/src/main.cpp index bc8e779..76ab5d9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -196,7 +196,12 @@ int main(int ac, char** av) } } else - identd.shutdown(); + { +#ifdef UDNS_FOUND + dns_handler.destroy(); +#endif + identd.shutdown(); + } } // If the only existing connection is the one to the XMPP component: // close the XMPP stream. diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index ccb3517..a83af80 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -206,8 +206,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode instructions(x, "instructions"); instructions.set_inner("Edit the form, to configure the settings of the IRC server "s + server_domain); - XmlNode required("required"); - XmlSubNode ports(x, "field"); ports["var"] = "ports"; ports["type"] = "text-multi"; @@ -219,7 +217,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode ports_value(ports, "value"); ports_value.set_inner(val); } - ports.add_child(required); #ifdef BOTAN_FOUND XmlSubNode tls_ports(x, "field"); @@ -233,7 +230,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode tls_ports_value(tls_ports, "value"); tls_ports_value.set_inner(val); } - tls_ports.add_child(required); XmlSubNode verify_cert(x, "field"); verify_cert["var"] = "verify_cert"; @@ -255,7 +251,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode fingerprint_value(fingerprint, "value"); fingerprint_value.set_inner(options.trustedFingerprint.value()); } - fingerprint.add_child(required); #endif XmlSubNode pass(x, "field"); @@ -267,7 +262,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode pass_value(pass, "value"); pass_value.set_inner(options.pass.value()); } - pass.add_child(required); XmlSubNode after_cnt_cmd(x, "field"); after_cnt_cmd["var"] = "after_connect_command"; @@ -279,7 +273,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode after_cnt_cmd_value(after_cnt_cmd, "value"); after_cnt_cmd_value.set_inner(options.afterConnectionCommand.value()); } - after_cnt_cmd.add_child(required); if (Config::get("realname_customization", "true") == "true") { @@ -292,7 +285,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode username_value(username, "value"); username_value.set_inner(options.username.value()); } - username.add_child(required); XmlSubNode realname(x, "field"); realname["var"] = "realname"; @@ -303,7 +295,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode realname_value(realname, "value"); realname_value.set_inner(options.realname.value()); } - realname.add_child(required); } XmlSubNode encoding_out(x, "field"); @@ -316,7 +307,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode encoding_out_value(encoding_out, "value"); encoding_out_value.set_inner(options.encodingOut.value()); } - encoding_out.add_child(required); XmlSubNode encoding_in(x, "field"); encoding_in["var"] = "encoding_in"; @@ -328,7 +318,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode encoding_in_value(encoding_in, "value"); encoding_in_value.set_inner(options.encodingIn.value()); } - encoding_in.add_child(required); XmlSubNode linger_time(x, "field"); linger_time["var"] = "linger_time"; @@ -339,7 +328,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com XmlSubNode linger_time_value(linger_time, "value"); linger_time_value.set_inner(std::to_string(options.lingerTime.value())); } - encoding_in.add_child(required); } void ConfigureIrcServerStep2(XmppComponent&, AdhocSession& session, XmlNode& command_node) @@ -454,8 +442,6 @@ void ConfigureIrcChannelStep1(XmppComponent&, AdhocSession& session, XmlNode& co XmlSubNode instructions(x, "instructions"); instructions.set_inner("Edit the form, to configure the settings of the IRC channel "s + iid.get_local()); - XmlNode required("required"); - XmlSubNode encoding_out(x, "field"); encoding_out["var"] = "encoding_out"; encoding_out["type"] = "text-single"; @@ -466,7 +452,6 @@ void ConfigureIrcChannelStep1(XmppComponent&, AdhocSession& session, XmlNode& co XmlSubNode encoding_out_value(encoding_out, "value"); encoding_out_value.set_inner(options.encodingOut.value()); } - encoding_out.add_child(required); XmlSubNode encoding_in(x, "field"); encoding_in["var"] = "encoding_in"; @@ -478,7 +463,6 @@ void ConfigureIrcChannelStep1(XmppComponent&, AdhocSession& session, XmlNode& co XmlSubNode encoding_in_value(encoding_in, "value"); encoding_in_value.set_inner(options.encodingIn.value()); } - encoding_in.add_child(required); } void ConfigureIrcChannelStep2(XmppComponent&, AdhocSession& session, XmlNode& command_node) diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp index bd6975e..2783b93 100644 --- a/src/xmpp/biboumi_component.cpp +++ b/src/xmpp/biboumi_component.cpp @@ -179,10 +179,11 @@ void BiboumiComponent::handle_presence(const Stanza& stanza) } catch (const IRCNotConnected& ex) { - this->send_stanza_error("presence", from_str, to_str, id, - "cancel", "remote-server-not-found", - "Not connected to IRC server "s + ex.hostname, - true); + if (type != "unavailable") + this->send_stanza_error("presence", from_str, to_str, id, + "cancel", "remote-server-not-found", + "Not connected to IRC server "s + ex.hostname, + true); } stanza_error.disable(); } @@ -737,7 +738,7 @@ void BiboumiComponent::send_irc_server_disco_info(const std::string& id, const s this->send_stanza(iq); } -void BiboumiComponent::send_irc_channel_muc_traffic_info(const std::string id, const std::string& jid_from, const std::string& jid_to) +void BiboumiComponent::send_irc_channel_muc_traffic_info(const std::string id, const std::string& jid_to, const std::string& jid_from) { Stanza iq("iq"); { diff --git a/src/xmpp/biboumi_component.hpp b/src/xmpp/biboumi_component.hpp index 7cafdec..aa0c3db 100644 --- a/src/xmpp/biboumi_component.hpp +++ b/src/xmpp/biboumi_component.hpp @@ -69,7 +69,7 @@ public: * Sends the allowed namespaces in MUC message, according to * http://xmpp.org/extensions/xep-0045.html#impl-service-traffic */ - void send_irc_channel_muc_traffic_info(const std::string id, const std::string& jid_from, const std::string& jid_to); + void send_irc_channel_muc_traffic_info(const std::string id, const std::string& jid_to, const std::string& jid_from); /** * Send a ping request */ |