Use late CoreSessionEventProcessor handler rather than early EventStringifier ones
[quassel.git] / src / core / ircserverhandler.h
1 /***************************************************************************
2  *   Copyright (C) 2005-10 by the Quassel Project                          *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) version 3.                                           *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20
21 #ifndef IRCSERVERHANDLER_H
22 #define IRCSERVERHANDLER_H
23
24 #include "corebasichandler.h"
25 #include "netsplit.h"
26
27 class IrcServerHandler : public CoreBasicHandler {
28   Q_OBJECT
29
30 public:
31   IrcServerHandler(CoreNetwork *parent);
32   ~IrcServerHandler();
33
34   void handleServerMsg(QByteArray rawMsg);
35
36 public slots:
37   void handleNotice(const QString &prefix, const QList<QByteArray> &params);
38   void handlePrivmsg(const QString &prefix, const QList<QByteArray> &params);
39
40   void defaultHandler(QString cmd, const QString &prefix, const QList<QByteArray> &params);
41
42 private:
43   void tryNextNick(const QString &errnick, bool erroneus = false);
44   bool checkParamCount(const QString &methodName, const QList<QByteArray> &params, int minParams);
45
46   // holds the target for numeric replies or is invalid otherwise
47   inline const QString &target() const { return _target; }
48
49   bool _whois;
50   QString _target;
51
52   // structure to organize netsplits
53   // key: quit message
54   // value: the corresponding netsplit object
55   QHash<QString, Netsplit*> _netsplits;
56
57 #ifdef HAVE_QCA2
58   QByteArray decrypt(const QString &target, const QByteArray &message, bool isTopic = false);
59 #endif
60 };
61
62 #endif