diff options
author | louiz’ <louiz@louiz.org> | 2018-03-19 20:08:35 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2018-03-19 20:15:44 +0100 |
commit | 619c991a691a455efee2baa4e1fe96e64d27ff64 (patch) | |
tree | 57caded9a8d529e8793e920fc1df96d8903c2280 /src/bridge | |
parent | d7427fc9ca4c06fda458e4951559f57163d90b94 (diff) | |
download | biboumi-619c991a691a455efee2baa4e1fe96e64d27ff64.tar.gz biboumi-619c991a691a455efee2baa4e1fe96e64d27ff64.tar.bz2 biboumi-619c991a691a455efee2baa4e1fe96e64d27ff64.tar.xz biboumi-619c991a691a455efee2baa4e1fe96e64d27ff64.zip |
Add a nick field in the IRC server configuration form
fix #3317
Diffstat (limited to 'src/bridge')
-rw-r--r-- | src/bridge/bridge.cpp | 7 | ||||
-rw-r--r-- | src/bridge/bridge.hpp | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index aba2f05..bff86b9 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -166,10 +166,15 @@ IrcClient* Bridge::find_irc_client(const std::string& hostname) const } } -bool Bridge::join_irc_channel(const Iid& iid, const std::string& nickname, const std::string& password, +bool Bridge::join_irc_channel(const Iid& iid, std::string nickname, const std::string& password, const std::string& resource, HistoryLimit history_limit) { const auto& hostname = iid.get_server(); +#ifdef USE_DATABASE + auto soptions = Database::get_irc_server_options(this->get_bare_jid(), hostname); + if (!soptions.col<Database::Nick>().empty()) + nickname = soptions.col<Database::Nick>(); +#endif IrcClient* irc = this->make_irc_client(hostname, nickname); irc->history_limit = history_limit; this->add_resource_to_server(hostname, resource); diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index 3798465..a4ee693 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -75,7 +75,7 @@ public: * Try to join an irc_channel, does nothing and return true if the channel * was already joined. */ - bool join_irc_channel(const Iid& iid, const std::string& nickname, const std::string& password, const std::string& resource, HistoryLimit history_limit); + bool join_irc_channel(const Iid& iid, std::string nickname, const std::string& password, const std::string& resource, HistoryLimit history_limit); void send_channel_message(const Iid& iid, const std::string& body, std::string id); void send_private_message(const Iid& iid, const std::string& body, const std::string& type="PRIVMSG"); |