diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-04-25 00:35:57 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-04-25 00:35:57 +0200 |
commit | 77a84fd2d99bcffd562f09c8235e5bcd365accb1 (patch) | |
tree | 1fb5c605ecd2a76bc4c4cdfe20dd24a3a3507cb4 /src/irc/irc_client.cpp | |
parent | 6ebb586b6ce097d5768e3863411042f4dc6c979e (diff) | |
download | biboumi-77a84fd2d99bcffd562f09c8235e5bcd365accb1.tar.gz biboumi-77a84fd2d99bcffd562f09c8235e5bcd365accb1.tar.bz2 biboumi-77a84fd2d99bcffd562f09c8235e5bcd365accb1.tar.xz biboumi-77a84fd2d99bcffd562f09c8235e5bcd365accb1.zip |
NOTICE from channels are displayed in the channel, with a green "[notice]"
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r-- | src/irc/irc_client.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 537b738..f077e37 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -235,6 +235,21 @@ void IrcClient::forward_server_message(const IrcMessage& message) this->bridge->send_xmpp_message(this->hostname, from, body); } +void IrcClient::on_notice(const IrcMessage& message) +{ + std::string from = message.prefix; + const std::string to = message.arguments[0]; + const std::string body = message.arguments[1]; + + if (to == this->current_nick) + this->bridge->send_xmpp_message(this->hostname, from, body); + else + { + IrcMessage modified_message(std::move(from), "PRIVMSG", {to, std::string("\u000303[notice]\u0003 ") + body}); + this->on_channel_message(modified_message); + } +} + void IrcClient::on_isupport_message(const IrcMessage& message) { const size_t len = message.arguments.size(); |