diff options
author | Florent Le Coz <louiz@louiz.org> | 2013-11-13 01:24:36 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2013-11-13 01:24:36 +0100 |
commit | 0859801230f999889d0f7356864888e8c5936cda (patch) | |
tree | 31b1eed96847157def5c22adb1a55abff6a3dae1 /src/bridge | |
parent | 3cfaab9a2debe03829b1ff26fe94e775e1d18e0a (diff) | |
download | biboumi-0859801230f999889d0f7356864888e8c5936cda.tar.gz biboumi-0859801230f999889d0f7356864888e8c5936cda.tar.bz2 biboumi-0859801230f999889d0f7356864888e8c5936cda.tar.xz biboumi-0859801230f999889d0f7356864888e8c5936cda.zip |
Handle KICK in irc channel, both ways
Diffstat (limited to 'src/bridge')
-rw-r--r-- | src/bridge/bridge.cpp | 12 | ||||
-rw-r--r-- | src/bridge/bridge.hpp | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 0b26a7f..e39cdd3 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -122,6 +122,13 @@ void Bridge::send_irc_nick_change(const Iid& iid, const std::string& new_nick) irc->send_nick_command(new_nick); } +void Bridge::send_irc_kick(const Iid& iid, const std::string& target, const std::string& reason) +{ + IrcClient* irc = this->get_irc_client(iid.server); + if (irc) + irc->send_kick_command(iid.chan, target, reason); +} + void Bridge::send_message(const Iid& iid, const std::string& nick, const std::string& body, const bool muc) { std::string utf8_body = this->sanitize_for_xmpp(body); @@ -180,3 +187,8 @@ std::string Bridge::get_own_nick(const Iid& iid) return irc->get_own_nick(); return ""; } + +void Bridge::kick_muc_user(Iid&& iid, const std::string& target, const std::string& reason, const std::string& author) +{ + this->xmpp->kick_user(iid.chan + "%" + iid.server, target, reason, author, this->user_jid); +} diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index 0466ee1..b2124bd 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -39,6 +39,7 @@ public: void send_private_message(const Iid& iid, const std::string& body); void leave_irc_channel(Iid&& iid, std::string&& status_message); void send_irc_nick_change(const Iid& iid, const std::string& new_nick); + void send_irc_kick(const Iid& iid, const std::string& target, const std::string& reason); /*** ** @@ -76,6 +77,7 @@ public: * true) changed his nick to new_nick */ void send_nick_change(Iid&& iid, const std::string& old_nick, const std::string& new_nick, const bool self); + void kick_muc_user(Iid&& iid, const std::string& target, const std::string& reason, const std::string& author); /** * Misc |