Event backend porting
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 13 Oct 2010 21:22:45 +0000 (23:22 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 13 Oct 2010 23:06:33 +0000 (01:06 +0200)
PING

src/core/coresessioneventprocessor.cpp
src/core/coresessioneventprocessor.h
src/core/ircserverhandler.cpp
src/core/ircserverhandler.h

index bb2c211..d564973 100644 (file)
@@ -302,6 +302,12 @@ void CoreSessionEventProcessor::processIrcEventPart(IrcEvent *e) {
   }
 }
 
+void CoreSessionEventProcessor::processIrcEventPing(IrcEvent *e) {
+  QString param = e->params().count()? e->params().first() : QString();
+  // FIXME use events
+  coreNetwork(e)->putRawLine("PONG " + coreNetwork(e)->serverEncode(param));
+}
+
 void CoreSessionEventProcessor::processIrcEventPong(IrcEvent *e) {
   // the server is supposed to send back what we passed as param. and we send a timestamp
   // but using quote and whatnought one can send arbitrary pings, so we have to do some sanity checks
index 258dc44..b99a778 100644 (file)
@@ -47,6 +47,7 @@ public:
   Q_INVOKABLE void processIrcEventMode(IrcEvent *event);
   Q_INVOKABLE void processIrcEventNick(IrcEvent *event);
   Q_INVOKABLE void processIrcEventPart(IrcEvent *event);
+  Q_INVOKABLE void processIrcEventPing(IrcEvent *event);
   Q_INVOKABLE void processIrcEventPong(IrcEvent *event);
   Q_INVOKABLE void processIrcEventQuit(IrcEvent *event);
   Q_INVOKABLE void lateProcessIrcEventQuit(IrcEvent *event);
index 3638129..235f7d5 100644 (file)
@@ -181,11 +181,6 @@ void IrcServerHandler::handleNotice(const QString &prefix, const QList<QByteArra
 
 }
 
-void IrcServerHandler::handlePing(const QString &prefix, const QList<QByteArray> &params) {
-  Q_UNUSED(prefix);
-  putCmd("PONG", params);
-}
-
 void IrcServerHandler::handlePrivmsg(const QString &prefix, const QList<QByteArray> &params) {
   if(!checkParamCount("IrcServerHandler::handlePrivmsg()", params, 1))
     return;
index a457b30..52ecb6a 100644 (file)
@@ -35,7 +35,6 @@ public:
 
 public slots:
   void handleNotice(const QString &prefix, const QList<QByteArray> &params);
-  void handlePing(const QString &prefix, const QList<QByteArray> &params);
   void handlePrivmsg(const QString &prefix, const QList<QByteArray> &params);
 
   void defaultHandler(QString cmd, const QString &prefix, const QList<QByteArray> &params);