void MyIrcSession::on_noticeMessageReceived(IrcMessage *message) { IrcNoticeMessage *m = (IrcNoticeMessage *) message; LOG4CXX_INFO(logger, user << ": NOTICE " << TO_UTF8(m->message())); QString msg = m->message(); CommuniBackport::toPlainText(msg); std::string target = TO_UTF8(m->target().toLower()); if (target.find("#") == 0) { std::string nickname = TO_UTF8(m->sender().name()); correctNickname(nickname); np->handleMessage(user, target + suffix, TO_UTF8(msg), nickname); } else { std::string nickname = TO_UTF8(m->sender().name()); correctNickname(nickname); if (nickname.find(".") != std::string::npos) { return; } if (m_pms.find(nickname) != m_pms.end()) { if (hasIRCBuddy(m_pms[nickname], nickname)) { LOG4CXX_INFO(logger, nickname); np->handleMessage(user, m_pms[nickname] + suffix, TO_UTF8(msg), nickname, "", "", false, true); return; } else { nickname = nickname + suffix; } } else { nickname = nickname + suffix; } LOG4CXX_INFO(logger, nickname); np->handleMessage(user, nickname, TO_UTF8(msg), ""); } }
void dlgIRC::onMessageReceived( IrcMessage* msg ) { switch( msg->type() ) { case IrcMessage::Type::Join: { IrcJoinMessage *rmsg = static_cast<IrcJoinMessage*>(msg); slot_joined( rmsg->sender().name(), rmsg->channel() ); break; } case IrcMessage::Type::Notice: { IrcNoticeMessage *rmsg = static_cast<IrcNoticeMessage*>(msg); irc_gotMsg( rmsg->sender().name(), rmsg->target(), rmsg->message() ); break; } case IrcMessage::Type::Private: { IrcPrivateMessage *rmsg = static_cast<IrcPrivateMessage*>(msg); irc_gotMsg( rmsg->sender().name(), rmsg->target(), rmsg->message() ); break; } case IrcMessage::Type::Numeric: { IrcNumericMessage *rmsg = static_cast<IrcNumericMessage*>(msg); irc_gotMsg3( rmsg->sender().name(), rmsg->code(), rmsg->parameters() ); break; } case IrcMessage::Type::Part: { IrcPartMessage *rmsg = static_cast<IrcPartMessage*>(msg); slot_parted( rmsg->sender().name(), rmsg->channel(), rmsg->reason() ); break; } case IrcMessage::Type::Unknown: irc_gotMsg2( msg->sender().name(), msg->parameters() ); break; } /* Nick IrcNickMessage Quit IrcQuitMessage Topic IrcTopicMessage Invite IrcInviteMessage Kick IrcKickMessage Mode IrcModeMessage Ping IrcPingMessage Pong IrcPongMessage Error IrcErrorMessage */ }