From e4fcbd3030f033c24102db9f6b6abfb540332c9d Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 14 Jan 2015 12:38:46 +0100 Subject: Add support for password-protected IRC rooms. --- src/bridge/bridge.cpp | 4 ++-- src/bridge/bridge.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bridge') diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index c925f9e..5fa96c8 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -108,7 +108,7 @@ IrcClient* Bridge::get_irc_client(const std::string& hostname) } } -bool Bridge::join_irc_channel(const Iid& iid, const std::string& username) +bool Bridge::join_irc_channel(const Iid& iid, const std::string& username, const std::string& password) { IrcClient* irc = this->get_irc_client(iid.get_server(), username); if (iid.get_local().empty()) @@ -135,7 +135,7 @@ bool Bridge::join_irc_channel(const Iid& iid, const std::string& username) } if (irc->is_channel_joined(iid.get_local()) == false) { - irc->send_join_command(iid.get_local()); + irc->send_join_command(iid.get_local(), password); return true; } return false; diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index c20bba2..698a017 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -58,7 +58,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& username); + bool join_irc_channel(const Iid& iid, const std::string& username, const std::string& password = ""); void send_channel_message(const Iid& iid, const std::string& body); void send_private_message(const Iid& iid, const std::string& body, const std::string& type="PRIVMSG"); void leave_irc_channel(Iid&& iid, std::string&& status_message); -- cgit v1.2.3