Ejemplo n.º 1
0
MyIrcBuffer::MyIrcBuffer(const QString& receiver, Irc::Session* parent)
    : Irc::Buffer(receiver, parent)
{
    connect(this, SIGNAL(receiverChanged(QString)), SLOT(on_receiverChanged(QString)));
    connect(this, SIGNAL(joined(QString)), SLOT(on_joined(QString)));
    connect(this, SIGNAL(parted(QString, QString)), SLOT(on_parted(QString, QString)));
    connect(this, SIGNAL(quit(QString, QString)), SLOT(on_quit(QString, QString)));
    connect(this, SIGNAL(nickChanged(QString, QString)), SLOT(on_nickChanged(QString, QString)));
    connect(this, SIGNAL(modeChanged(QString, QString, QString)), SLOT(on_modeChanged(QString, QString, QString)));
    connect(this, SIGNAL(topicChanged(QString, QString)), SLOT(on_topicChanged(QString, QString)));
    connect(this, SIGNAL(invited(QString, QString, QString)), SLOT(on_invited(QString, QString, QString)));
    connect(this, SIGNAL(kicked(QString, QString, QString)), SLOT(on_kicked(QString, QString, QString)));
    connect(this, SIGNAL(messageReceived(QString, QString, Irc::Buffer::MessageFlags)),
                  SLOT(on_messageReceived(QString, QString, Irc::Buffer::MessageFlags)));
    connect(this, SIGNAL(noticeReceived(QString, QString, Irc::Buffer::MessageFlags)),
                  SLOT(on_noticeReceived(QString, QString, Irc::Buffer::MessageFlags)));
    connect(this, SIGNAL(ctcpRequestReceived(QString, QString, Irc::Buffer::MessageFlags)),
                  SLOT(on_ctcpRequestReceived(QString, QString, Irc::Buffer::MessageFlags)));
    connect(this, SIGNAL(ctcpReplyReceived(QString, QString, Irc::Buffer::MessageFlags)),
                  SLOT(on_ctcpReplyReceived(QString, QString, Irc::Buffer::MessageFlags)));
    connect(this, SIGNAL(ctcpActionReceived(QString, QString, Irc::Buffer::MessageFlags)),
                  SLOT(on_ctcpActionReceived(QString, QString, Irc::Buffer::MessageFlags)));
    connect(this, SIGNAL(numericMessageReceived(QString, uint, QStringList)), SLOT(on_numericMessageReceived(QString, uint, QStringList)));
    connect(this, SIGNAL(unknownMessageReceived(QString, QStringList)), SLOT(on_unknownMessageReceived(QString, QStringList)));
}
Ejemplo n.º 2
0
void MyIrcSession::onMessageReceived(IrcMessage *message) {
	LOG4CXX_INFO(logger, user << ": " << TO_UTF8(message->toString()));
	switch (message->type()) {
		case IrcMessage::Join:
			on_joined(message);
			break;
		case IrcMessage::Part:
			on_parted(message);
			break;
		case IrcMessage::Quit:
			on_quit(message);
			break;
		case IrcMessage::Nick:
			on_nickChanged(message);
			break;
		case IrcMessage::Mode:
			on_modeChanged(message);
			break;
		case IrcMessage::Topic:
			on_topicChanged(message);
			break;
		case IrcMessage::Private:
			on_messageReceived(message);
			break;
		case IrcMessage::Numeric:
			on_numericMessageReceived(message);
			break;
		default:break;
	}
}