Event backend porting
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 5 Oct 2010 16:32:18 +0000 (18:32 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 13 Oct 2010 23:06:32 +0000 (01:06 +0200)
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
src/core/coresessioneventprocessor.h
src/core/eventstringifier.cpp
src/core/ircserverhandler.cpp
src/core/ircserverhandler.h

index 7a44fd0..e3eca41 100644 (file)
@@ -170,6 +170,26 @@ void CoreSessionEventProcessor::processIrcEvent001(IrcEvent *e) {
   e->network()->setMyNick(nickFromMask(myhostmask));
 }
 
   e->network()->setMyNick(nickFromMask(myhostmask));
 }
 
+/* RPL_UMODEIS - "<user_modes> [<user_mode_params>]" */
+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))
 /* template
 void CoreSessionEventProcessor::processIrcEvent(IrcEvent *e) {
   if(!checkParamCount(e, 1))
index 52a2b66..1361205 100644 (file)
@@ -48,6 +48,10 @@ public:
   Q_INVOKABLE void processIrcEventTopic(IrcEvent *event);
 
   Q_INVOKABLE void processIrcEvent001(IrcEvent *event);            // RPL_WELCOME
   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);
 
 
   // Q_INVOKABLE void processIrcEvent(IrcEvent *event);
 
index b7ad1a6..8b92da0 100644 (file)
@@ -50,7 +50,9 @@ void EventStringifier::processIrcEventNumeric(IrcEventNumeric *e) {
   //qDebug() << e->number();
   switch(e->number()) {
   // Welcome, status, info messages. Just display these.
   //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;
 
     displayMsg(e, Message::Server, e->params().join(" "), e->prefix()); qDebug () << e;
     break;
 
index 382fd96..523b215 100644 (file)
@@ -429,34 +429,6 @@ void IrcServerHandler::handle005(const QString &prefix, const QList<QByteArray>
   network()->determinePrefixes();
 }
 
   network()->determinePrefixes();
 }
 
-/* RPL_UMODEIS - "<user_modes> [<user_mode_params>]" */
-void IrcServerHandler::handle221(const QString &prefix, const QList<QByteArray> &params) {
-  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<QByteArray> &params) {
-  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<QByteArray> &params) {
-  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<QByteArray> &params) {
-  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.
 /*
 WHOIS-Message:
    Replies 311 - 313, 317 - 319 are all replies generated in response to a WHOIS message.
index 93fd006..9854396 100644 (file)
@@ -41,10 +41,6 @@ public slots:
   void handlePrivmsg(const QString &prefix, const QList<QByteArray> &params);
   void handleQuit(const QString &prefix, const QList<QByteArray> &params);
   void handle005(const QString &prefix, const QList<QByteArray> &params);   // RPL_ISUPPORT
   void handlePrivmsg(const QString &prefix, const QList<QByteArray> &params);
   void handleQuit(const QString &prefix, const QList<QByteArray> &params);
   void handle005(const QString &prefix, const QList<QByteArray> &params);   // RPL_ISUPPORT
-  void handle221(const QString &prefix, const QList<QByteArray> &params);   // RPL_UMODEIS
-  void handle250(const QString &prefix, const QList<QByteArray> &params);   // RPL_STATSDLINE
-  void handle265(const QString &prefix, const QList<QByteArray> &params);   // RPL_LOCALUSERS
-  void handle266(const QString &prefix, const QList<QByteArray> &params);   // RPL_GLOBALUSERS
   void handle301(const QString &prefix, const QList<QByteArray> &params);   // RPL_AWAY
   void handle305(const QString &prefix, const QList<QByteArray> &params);   // RPL_UNAWAY
   void handle306(const QString &prefix, const QList<QByteArray> &params);   // RPL_NOWAWAY
   void handle301(const QString &prefix, const QList<QByteArray> &params);   // RPL_AWAY
   void handle305(const QString &prefix, const QList<QByteArray> &params);   // RPL_UNAWAY
   void handle306(const QString &prefix, const QList<QByteArray> &params);   // RPL_NOWAWAY