summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircsession.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircsession.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircsession.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp
index fd8ba72..c8d7869 100644
--- a/noncore/net/opieirc/ircsession.cpp
+++ b/noncore/net/opieirc/ircsession.cpp
@@ -1,59 +1,60 @@
1 1
2#include "ircsession.h" 2#include "ircsession.h"
3#include "ircmessageparser.h" 3#include "ircmessageparser.h"
4#include "ircchannelperson.h" 4#include "ircchannelperson.h"
5#include "ircversion.h" 5#include "ircversion.h"
6 6
7IRCSession::IRCSession(QWidget *parent, IRCServer *server) { 7IRCSession::IRCSession(QObject *parent, IRCServer *server)
8 : QObject(parent)
9{
8 m_server = server; 10 m_server = server;
9 m_connection = new IRCConnection(m_server); 11 m_connection = new IRCConnection(m_server);
10 m_parser = new IRCMessageParser(this); 12 m_parser = new IRCMessageParser(this);
11 m_parent = parent;
12 connect(m_connection, SIGNAL(messageArrived(IRCMessage*)), this, SLOT(handleMessage(IRCMessage*))); 13 connect(m_connection, SIGNAL(messageArrived(IRCMessage*)), this, SLOT(handleMessage(IRCMessage*)));
13 connect(m_parser, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); 14 connect(m_parser, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput)));
14 connect(m_connection, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); 15 connect(m_connection, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput)));
15} 16}
16 17
17IRCSession::~IRCSession() { 18IRCSession::~IRCSession() {
18 /* We want this to get deleted automatically */ 19 /* We want this to get deleted automatically */
19 m_channels.setAutoDelete(TRUE); 20 m_channels.setAutoDelete(TRUE);
20 m_people.setAutoDelete(TRUE); 21 m_people.setAutoDelete(TRUE);
21 22
22 delete m_parser; 23 delete m_parser;
23 delete m_connection; 24 delete m_connection;
24} 25}
25 26
26void IRCSession::beginSession() { 27void IRCSession::beginSession() {
27 m_connection->doConnect(); 28 m_connection->doConnect();
28} 29}
29 30
30void IRCSession::join(QString channelname) { 31void IRCSession::join(QString channelname) {
31 m_connection->sendLine("JOIN " + channelname); 32 m_connection->sendLine("JOIN " + channelname);
32} 33}
33 34
34void IRCSession::quit(){ 35void IRCSession::quit(){
35 m_connection->sendLine("QUIT :[OI] I'm too good to need a reason"); 36 m_connection->sendLine("QUIT :[OI] I'm too good to need a reason");
36} 37}
37 38
38void IRCSession::quit(QString message){ 39void IRCSession::quit(QString message){
39 m_connection->sendLine("QUIT :" + message); 40 m_connection->sendLine("QUIT :" + message);
40} 41}
41 42
42void IRCSession::topic(IRCChannel *channel, QString message){ 43void IRCSession::topic(IRCChannel *channel, QString message){
43 m_connection->sendLine("TOPIC :" + channel->channelname() + " " + message); 44 m_connection->sendLine("TOPIC :" + channel->channelname() + " " + message);
44} 45}
45 46
46void IRCSession::mode(IRCChannel *channel, QString message){ 47void IRCSession::mode(IRCChannel *channel, QString message){
47 m_connection->sendLine("MODE " + channel->channelname() + " " + message); 48 m_connection->sendLine("MODE " + channel->channelname() + " " + message);
48} 49}
49 50
50void IRCSession::mode(IRCPerson *person, QString message){ 51void IRCSession::mode(IRCPerson *person, QString message){
51 m_connection->sendLine("MODE " + person->nick() + " " + message); 52 m_connection->sendLine("MODE " + person->nick() + " " + message);
52} 53}
53 54
54void IRCSession::mode(QString message){ 55void IRCSession::mode(QString message){
55 m_connection->sendLine("MODE " + message); 56 m_connection->sendLine("MODE " + message);
56} 57}
57 58
58void IRCSession::raw(QString message){ 59void IRCSession::raw(QString message){
59 m_connection->sendLine(message); 60 m_connection->sendLine(message);