Changeset - 5c2d081a315c
[Not reviewed]
0 2 0
HanzZ - 12 years ago 2013-02-27 14:17:15
hanzz.k@gmail.com
Communi: Log Identify try and NOTICE messages in log
2 files changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
backends/libcommuni/session.cpp
Show inline comments
 
@@ -75,12 +75,13 @@ void MyIrcSession::on_connected() {
 
		sendCommand(IrcCommand::createJoin(FROM_UTF8(it->second->getChannel()), FROM_UTF8(it->second->getPassword())));
 
	}
 

	
 
	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)));
 
	}
 
}
 

	
 
void MyIrcSession::on_socketError(QAbstractSocket::SocketError error) {
 
	std::string reason;
 
@@ -384,12 +385,17 @@ void MyIrcSession::awayTimeout() {
 
			LOG4CXX_INFO(logger, "The time has come. Asking /who " << it->second->getChannel() << " again to get current away states.");
 
			sendCommand(IrcCommand::createWho(FROM_UTF8(it->second->getChannel())));
 
		}
 
	}
 
}
 

	
 
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()) {
 
		case IrcMessage::Join:
 
			on_joined(message);
 
			break;
 
@@ -411,9 +417,12 @@ void MyIrcSession::onMessageReceived(IrcMessage *message) {
 
		case IrcMessage::Private:
 
			on_messageReceived(message);
 
			break;
 
		case IrcMessage::Numeric:
 
			on_numericMessageReceived(message);
 
			break;
 
		case IrcMessage::Notice:
 
			on_noticeMessageReceived(message);
 
			break;
 
		default:break;
 
	}
 
}
backends/libcommuni/session.h
Show inline comments
 
@@ -128,12 +128,13 @@ public:
 
	void on_quit(IrcMessage *message);
 
	void on_nickChanged(IrcMessage *message);
 
	void on_modeChanged(IrcMessage *message);
 
	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;
 

	
 
protected Q_SLOTS:
 
	void on_connected();
0 comments (0 inline, 0 general)