* This is a server object, managing a single connection to an IRC server, handling the associated channels and so on.
* We have this run in its own thread mainly to not block other server objects or the core if something goes wrong,
* e.g. if some scripts starts running wild...
* This is a server object, managing a single connection to an IRC server, handling the associated channels and so on.
* We have this run in its own thread mainly to not block other server objects or the core if something goes wrong,
* e.g. if some scripts starts running wild...
public slots:
// void setServerOptions();
void connectToIrc(const QString &host, quint16 port = DEFAULT_PORT);
void disconnectFromIrc();
public slots:
// void setServerOptions();
void connectToIrc(const QString &host, quint16 port = DEFAULT_PORT);
void disconnectFromIrc();
- void putRawLine(const QString &input /*, Buffer *source = 0 */);
+ void putRawLine(QString input);
+ void putCmd(QString cmd, QStringList params, QString prefix = 0);
- private:
- QTcpSocket *socket;
- QTextStream stream;
+ /* Message Handlers */
+ /* handleXxxxFromServer(QString prefix, QStringList params); */
+ void handleNoticeFromServer(QString, QStringList);
+ void handlePingFromServer(QString, QStringList);
+ void handleServerMsg(QString rawMsg);
+ void handleUserMsg(QString usrMsg);
+ //static inline void dispatchServerMsg(Message *msg) { msg->getServer()->handleServerMsg(msg); }
+ //static inline void dispatchUserMsg(Message *msg) { msg->getServer()->handleUserMsg(msg); }
- public slots:
- void connectToHost(const QString &host, quint16 port = DEFAULT_PORT);
- void disconnectFromHost();
- void sendLine(const QString &);
+ class UnknownCmdError : public Exception {
+ public:
+ UnknownCmdError(QString cmd, QString prefix, QStringList params);
+ };
+};