From 5c2d081a315c963f13c0ca56fe570714b71cfd4c Mon Sep 17 00:00:00 2001 From: HanzZ Date: Wed, 27 Feb 2013 14:17:15 +0100 Subject: [PATCH] Communi: Log Identify try and NOTICE messages in log --- backends/libcommuni/session.cpp | 9 +++++++++ backends/libcommuni/session.h | 1 + 2 files changed, 10 insertions(+) diff --git a/backends/libcommuni/session.cpp b/backends/libcommuni/session.cpp index 45015a90..40dbc51e 100644 --- a/backends/libcommuni/session.cpp +++ b/backends/libcommuni/session.cpp @@ -78,6 +78,7 @@ void MyIrcSession::on_connected() { if (getIdentify().find(" ") != std::string::npos) { std::string to = getIdentify().substr(0, getIdentify().find(" ")); std::string what = getIdentify().substr(getIdentify().find(" ") + 1); + LOG4CXX_INFO(logger, user << ": Sending IDENTIFY message to " << to); sendCommand(IrcCommand::createMessage(FROM_UTF8(to), FROM_UTF8(what))); } } @@ -387,6 +388,11 @@ void MyIrcSession::awayTimeout() { } } +void MyIrcSession::on_noticeMessageReceived(IrcMessage *message) { + IrcNoticeMessage *m = (IrcNoticeMessage *) message; + LOG4CXX_INFO(logger, user << ": NOTICE " << TO_UTF8(m->message())); +} + void MyIrcSession::onMessageReceived(IrcMessage *message) { // LOG4CXX_INFO(logger, user << ": " << TO_UTF8(message->toString())); switch (message->type()) { @@ -414,6 +420,9 @@ void MyIrcSession::onMessageReceived(IrcMessage *message) { case IrcMessage::Numeric: on_numericMessageReceived(message); break; + case IrcMessage::Notice: + on_noticeMessageReceived(message); + break; default:break; } } diff --git a/backends/libcommuni/session.h b/backends/libcommuni/session.h index 4d7a16de..e4122d43 100644 --- a/backends/libcommuni/session.h +++ b/backends/libcommuni/session.h @@ -131,6 +131,7 @@ public: void on_topicChanged(IrcMessage *message); void on_messageReceived(IrcMessage *message); void on_numericMessageReceived(IrcMessage *message); + void on_noticeMessageReceived(IrcMessage *message); std::string suffix; int rooms;