From 68478cb98a582e4a5b9b8cc188de51287d0da6b0 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Tue, 5 Oct 2010 18:32:18 +0200 Subject: [PATCH] Event backend porting RPL_UMODEIS (221), RPL_STATSCONN (250), RPL_LOCALUSERS (265), RPL_GLOBALUSERS (266) This were stubs in IrcServerHandler, they're supposed to update the network object. I've ported the stubs so we'll actually implement that some day... --- src/core/coresessioneventprocessor.cpp | 20 ++++++++++++++++++ src/core/coresessioneventprocessor.h | 4 ++++ src/core/eventstringifier.cpp | 4 +++- src/core/ircserverhandler.cpp | 28 -------------------------- src/core/ircserverhandler.h | 4 ---- 5 files changed, 27 insertions(+), 33 deletions(-) diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index 7a44fd0f..e3eca41c 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -170,6 +170,26 @@ void CoreSessionEventProcessor::processIrcEvent001(IrcEvent *e) { e->network()->setMyNick(nickFromMask(myhostmask)); } +/* RPL_UMODEIS - " []" */ +void CoreSessionEventProcessor::processIrcEvent221(IrcEvent *) { + // TODO: save information in network object +} + +/* RPL_STATSCONN - "Highest connection cout: 8000 (7999 clients)" */ +void CoreSessionEventProcessor::processIrcEvent250(IrcEvent *) { + // TODO: save information in network object +} + +/* RPL_LOCALUSERS - "Current local user: 5024 Max: 7999 */ +void CoreSessionEventProcessor::processIrcEvent265(IrcEvent *) { + // TODO: save information in network object +} + +/* RPL_GLOBALUSERS - "Current global users: 46093 Max: 47650" */ +void CoreSessionEventProcessor::processIrcEvent266(IrcEvent *) { + // TODO: save information in network object +} + /* template void CoreSessionEventProcessor::processIrcEvent(IrcEvent *e) { if(!checkParamCount(e, 1)) diff --git a/src/core/coresessioneventprocessor.h b/src/core/coresessioneventprocessor.h index 52a2b666..1361205d 100644 --- a/src/core/coresessioneventprocessor.h +++ b/src/core/coresessioneventprocessor.h @@ -48,6 +48,10 @@ public: Q_INVOKABLE void processIrcEventTopic(IrcEvent *event); Q_INVOKABLE void processIrcEvent001(IrcEvent *event); // RPL_WELCOME + Q_INVOKABLE void processIrcEvent221(IrcEvent *event); // RPL_UMODEIS + Q_INVOKABLE void processIrcEvent250(IrcEvent *event); // RPL_STATSCONN + Q_INVOKABLE void processIrcEvent265(IrcEvent *event); // RPL_LOCALUSERS + Q_INVOKABLE void processIrcEvent266(IrcEvent *event); // RPL_GLOBALUSERS // Q_INVOKABLE void processIrcEvent(IrcEvent *event); diff --git a/src/core/eventstringifier.cpp b/src/core/eventstringifier.cpp index b7ad1a60..8b92da03 100644 --- a/src/core/eventstringifier.cpp +++ b/src/core/eventstringifier.cpp @@ -50,7 +50,9 @@ void EventStringifier::processIrcEventNumeric(IrcEventNumeric *e) { //qDebug() << e->number(); switch(e->number()) { // Welcome, status, info messages. Just display these. - case 1: case 2: case 3: case 4: case 5: case 251: case 252: case 253: case 254: case 255: case 372: case 375: + case 1: case 2: case 3: case 4: case 5: + case 221: case 250: case 251: case 252: case 253: case 254: case 255: case 265: case 266: + case 372: case 375: displayMsg(e, Message::Server, e->params().join(" "), e->prefix()); qDebug () << e; break; diff --git a/src/core/ircserverhandler.cpp b/src/core/ircserverhandler.cpp index 382fd966..523b2153 100644 --- a/src/core/ircserverhandler.cpp +++ b/src/core/ircserverhandler.cpp @@ -429,34 +429,6 @@ void IrcServerHandler::handle005(const QString &prefix, const QList network()->determinePrefixes(); } -/* RPL_UMODEIS - " []" */ -void IrcServerHandler::handle221(const QString &prefix, const QList ¶ms) { - Q_UNUSED(prefix) - //TODO: save information in network object - emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("%1").arg(serverDecode(params).join(" "))); -} - -/* RPL_STATSCONN - "Highest connection cout: 8000 (7999 clients)" */ -void IrcServerHandler::handle250(const QString &prefix, const QList ¶ms) { - Q_UNUSED(prefix) - //TODO: save information in network object - emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("%1").arg(serverDecode(params).join(" "))); -} - -/* RPL_LOCALUSERS - "Current local user: 5024 Max: 7999 */ -void IrcServerHandler::handle265(const QString &prefix, const QList ¶ms) { - Q_UNUSED(prefix) - //TODO: save information in network object - emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("%1").arg(serverDecode(params).join(" "))); -} - -/* RPL_GLOBALUSERS - "Current global users: 46093 Max: 47650" */ -void IrcServerHandler::handle266(const QString &prefix, const QList ¶ms) { - Q_UNUSED(prefix) - //TODO: save information in network object - emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("%1").arg(serverDecode(params).join(" "))); -} - /* WHOIS-Message: Replies 311 - 313, 317 - 319 are all replies generated in response to a WHOIS message. diff --git a/src/core/ircserverhandler.h b/src/core/ircserverhandler.h index 93fd0067..9854396e 100644 --- a/src/core/ircserverhandler.h +++ b/src/core/ircserverhandler.h @@ -41,10 +41,6 @@ public slots: void handlePrivmsg(const QString &prefix, const QList ¶ms); void handleQuit(const QString &prefix, const QList ¶ms); void handle005(const QString &prefix, const QList ¶ms); // RPL_ISUPPORT - void handle221(const QString &prefix, const QList ¶ms); // RPL_UMODEIS - void handle250(const QString &prefix, const QList ¶ms); // RPL_STATSDLINE - void handle265(const QString &prefix, const QList ¶ms); // RPL_LOCALUSERS - void handle266(const QString &prefix, const QList ¶ms); // RPL_GLOBALUSERS void handle301(const QString &prefix, const QList ¶ms); // RPL_AWAY void handle305(const QString &prefix, const QList ¶ms); // RPL_UNAWAY void handle306(const QString &prefix, const QList ¶ms); // RPL_NOWAWAY -- 2.20.1