X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresessioneventprocessor.h;h=9647bc6de9222d66b01e782bbb22594107c818b2;hp=59b4879325e16266ebae8c52c0b13fd1bde0b9e5;hb=fdfd62334f728bd05470c5191194d55027fec86e;hpb=3ec6f311bb4fff1540a01c26069300ad17f6d134 diff --git a/src/core/coresessioneventprocessor.h b/src/core/coresessioneventprocessor.h index 59b48793..9647bc6d 100644 --- a/src/core/coresessioneventprocessor.h +++ b/src/core/coresessioneventprocessor.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2010 by the Quassel Project * + * Copyright (C) 2005-2012 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,14 +21,17 @@ #ifndef CORESESSIONEVENTPROCESSOR_H #define CORESESSIONEVENTPROCESSOR_H +#include "basichandler.h" #include "corenetwork.h" #include "networkevent.h" class CoreSession; +class CtcpEvent; class IrcEvent; class IrcEventNumeric; +class Netsplit; -class CoreSessionEventProcessor : public QObject { +class CoreSessionEventProcessor : public BasicHandler { Q_OBJECT public: @@ -41,10 +44,15 @@ public: Q_INVOKABLE void processIrcEventAuthenticate(IrcEvent *event); // SASL auth Q_INVOKABLE void processIrcEventCap(IrcEvent *event); // CAP framework Q_INVOKABLE void processIrcEventInvite(IrcEvent *event); - Q_INVOKABLE void processIrcEventKick(IrcEvent *event); - Q_INVOKABLE void processIrcEventNick(IrcEvent *event); - Q_INVOKABLE void processIrcEventPart(IrcEvent *event); + Q_INVOKABLE void processIrcEventJoin(IrcEvent *event); + Q_INVOKABLE void lateProcessIrcEventKick(IrcEvent *event); + Q_INVOKABLE void processIrcEventMode(IrcEvent *event); + Q_INVOKABLE void lateProcessIrcEventNick(IrcEvent *event); + Q_INVOKABLE void lateProcessIrcEventPart(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); Q_INVOKABLE void processIrcEventTopic(IrcEvent *event); Q_INVOKABLE void processIrcEvent001(IrcEvent *event); // RPL_WELCOME @@ -65,23 +73,76 @@ public: Q_INVOKABLE void processIrcEvent317(IrcEvent *event); // RPL_WHOISIDLE Q_INVOKABLE void processIrcEvent322(IrcEvent *event); // RPL_LIST Q_INVOKABLE void processIrcEvent323(IrcEvent *event); // RPL_LISTEND + Q_INVOKABLE void processIrcEvent324(IrcEvent *event); // RPL_CHANNELMODEIS Q_INVOKABLE void processIrcEvent331(IrcEvent *event); // RPL_NOTOPIC Q_INVOKABLE void processIrcEvent332(IrcEvent *event); // RPL_TOPIC Q_INVOKABLE void processIrcEvent352(IrcEvent *event); // RPL_WHOREPLY Q_INVOKABLE void processIrcEvent353(IrcEvent *event); // RPL_NAMREPLY - Q_INVOKABLE void processIrcEvent432(IrcEventNumeric *event); // ERR_ERRONEUSNICKNAME - Q_INVOKABLE void processIrcEvent433(IrcEventNumeric *event); // ERR_NICKNAMEINUSE - Q_INVOKABLE void processIrcEvent437(IrcEventNumeric *event); // ERR_UNAVAILRESOURCE + Q_INVOKABLE void processIrcEvent432(IrcEventNumeric *event); // ERR_ERRONEUSNICKNAME + Q_INVOKABLE void processIrcEvent433(IrcEventNumeric *event); // ERR_NICKNAMEINUSE + Q_INVOKABLE void processIrcEvent437(IrcEventNumeric *event); // ERR_UNAVAILRESOURCE // Q_INVOKABLE void processIrcEvent(IrcEvent *event); + /* CTCP handlers */ + Q_INVOKABLE void processCtcpEvent(CtcpEvent *event); + + Q_INVOKABLE void handleCtcpAction(CtcpEvent *event); + Q_INVOKABLE void handleCtcpClientinfo(CtcpEvent *event); + Q_INVOKABLE void handleCtcpPing(CtcpEvent *event); + Q_INVOKABLE void handleCtcpTime(CtcpEvent *event); + Q_INVOKABLE void handleCtcpVersion(CtcpEvent *event); + Q_INVOKABLE void defaultHandler(const QString &ctcpCmd, CtcpEvent *event); + +signals: + void newEvent(Event *event); + protected: bool checkParamCount(IrcEvent *event, int minParams); inline CoreNetwork *coreNetwork(NetworkEvent *e) const { return qobject_cast(e->network()); } void tryNextNick(NetworkEvent *e, const QString &errnick, bool erroneous = false); +private slots: + //! Joins after a netsplit + /** This slot handles a bulk-join after a netsplit is over + * \param net The network + * \param channel The channel the users joined + * \param users The list of users that joind the channel + * \param modes The list of modes the users get set + * \param quitMessage The message we received when the netsplit occured + */ + void handleNetsplitJoin(Network *net, const QString &channel, const QStringList &users, const QStringList &modes, const QString &quitMessage); + + //! Quits after a netsplit + /** This slot handles a bulk-quit after a netsplit occured + * \param net The network + * \param channel The channel the users quitted + * \param users The list of users that got split + * \param quitMessage The message we received when the netsplit occured + */ + void handleNetsplitQuit(Network *net, const QString &channel, const QStringList &users, const QString &quitMessage); + + //! Netsplit finished + /** This slot deletes the netsplit object that sent the finished() signal + */ + void handleNetsplitFinished(); + + void handleEarlyNetsplitJoin(Network *net, const QString &channel, const QStringList &users, const QStringList &modes); + + //! Destroy any existing netsplits + /** This slot deletes all netsplit objects + * Used to get rid of existing netsplits on network reconnect + * \param network The network we want to clear + */ + void destroyNetsplits(NetworkId network); + private: CoreSession *_coreSession; + + // structure to organize netsplits + // key: quit message + // value: the corresponding netsplit object + QHash > _netsplits; }; #endif