Diffstat (limited to 'noncore/net/opieirc/ircsession.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircsession.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp index 6404d71..3b176d0 100644 --- a/noncore/net/opieirc/ircsession.cpp +++ b/noncore/net/opieirc/ircsession.cpp | |||
@@ -1,105 +1,105 @@ | |||
1 | #include "ircsession.h" | 1 | #include "ircsession.h" |
2 | #include "ircmessageparser.h" | 2 | #include "ircmessageparser.h" |
3 | #include "ircversion.h" | 3 | #include "ircversion.h" |
4 | 4 | ||
5 | IRCSession::IRCSession(IRCServer *server) { | 5 | IRCSession::IRCSession(IRCServer *server) { |
6 | m_server = server; | 6 | m_server = server; |
7 | m_connection = new IRCConnection(m_server); | 7 | m_connection = new IRCConnection(m_server); |
8 | m_parser = new IRCMessageParser(this); | 8 | m_parser = new IRCMessageParser(this); |
9 | connect(m_connection, SIGNAL(messageArrived(IRCMessage *)), this, SLOT(handleMessage(IRCMessage *))); | 9 | connect(m_connection, SIGNAL(messageArrived(IRCMessage*)), this, SLOT(handleMessage(IRCMessage*))); |
10 | connect(m_parser, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); | 10 | connect(m_parser, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); |
11 | connect(m_connection, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); | 11 | connect(m_connection, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); |
12 | } | 12 | } |
13 | 13 | ||
14 | IRCSession::~IRCSession() { | 14 | IRCSession::~IRCSession() { |
15 | /* We want this to get deleted automatically */ | 15 | /* We want this to get deleted automatically */ |
16 | m_channels.setAutoDelete(TRUE); | 16 | m_channels.setAutoDelete(TRUE); |
17 | m_people.setAutoDelete(TRUE); | 17 | m_people.setAutoDelete(TRUE); |
18 | 18 | ||
19 | delete m_parser; | 19 | delete m_parser; |
20 | delete m_connection; | 20 | delete m_connection; |
21 | } | 21 | } |
22 | 22 | ||
23 | void IRCSession::beginSession() { | 23 | void IRCSession::beginSession() { |
24 | m_connection->doConnect(); | 24 | m_connection->doConnect(); |
25 | } | 25 | } |
26 | 26 | ||
27 | void IRCSession::join(QString channelname) { | 27 | void IRCSession::join(QString channelname) { |
28 | m_connection->sendLine("JOIN "+channelname); | 28 | m_connection->sendLine("JOIN "+channelname); |
29 | } | 29 | } |
30 | 30 | ||
31 | void IRCSession::quit(){ | 31 | void IRCSession::quit(){ |
32 | m_connection->sendLine("QUIT :[OI] I'm too good to need a reason"); | 32 | m_connection->sendLine("QUIT :[OI] I'm too good to need a reason"); |
33 | } | 33 | } |
34 | 34 | ||
35 | void IRCSession::quit(QString message){ | 35 | void IRCSession::quit(QString message){ |
36 | m_connection->sendLine("QUIT :" + message); | 36 | m_connection->sendLine("QUIT :" + message); |
37 | } | 37 | } |
38 | 38 | ||
39 | void IRCSession::topic(IRCChannel *channel, QString message){ | 39 | void IRCSession::topic(IRCChannel *channel, QString message){ |
40 | m_connection->sendLine("TOPIC :" + channel->channelname() + " " + message); | 40 | m_connection->sendLine("TOPIC :" + channel->channelname() + " " + message); |
41 | } | 41 | } |
42 | 42 | ||
43 | void IRCSession::mode(IRCChannel *channel, QString message){ | 43 | void IRCSession::mode(IRCChannel *channel, QString message){ |
44 | m_connection->sendLine("MODE " + channel->channelname() + " " + message); | 44 | m_connection->sendLine("MODE " + channel->channelname() + " " + message); |
45 | } | 45 | } |
46 | 46 | ||
47 | void IRCSession::mode(IRCPerson *person, QString message){ | 47 | void IRCSession::mode(IRCPerson *person, QString message){ |
48 | m_connection->sendLine("MODE " + person->nick() + " " + message); | 48 | m_connection->sendLine("MODE " + person->nick() + " " + message); |
49 | } | 49 | } |
50 | 50 | ||
51 | void IRCSession::mode(QString message){ | 51 | void IRCSession::mode(QString message){ |
52 | m_connection->sendLine("MODE " + message); | 52 | m_connection->sendLine("MODE " + message); |
53 | } | 53 | } |
54 | 54 | ||
55 | void IRCSession::raw(QString message){ | 55 | void IRCSession::raw(QString message){ |
56 | m_connection->sendLine(message); | 56 | m_connection->sendLine(message); |
57 | } | 57 | } |
58 | 58 | ||
59 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person) { | 59 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person) { |
60 | m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :0wn3d - no reason"); | 60 | m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :0wn3d - no reason"); |
61 | } | 61 | } |
62 | 62 | ||
63 | void IRCSession::op(IRCChannel *channel, IRCPerson *person) { | 63 | void IRCSession::op(IRCChannel *channel, IRCPerson *person) { |
64 | m_connection->sendLine("MODE "+ channel->channelname() + " +ooo " + person->nick()); | 64 | m_connection->sendLine("MODE "+ channel->channelname() + " +ooo " + person->nick()); |
65 | } | 65 | } |
66 | 66 | ||
67 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person, QString message) { | 67 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person, QString message) { |
68 | m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :" + message); | 68 | m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :" + message); |
69 | } | 69 | } |
70 | 70 | ||
71 | void IRCSession::sendMessage(IRCPerson *person, QString message) { | 71 | void IRCSession::sendMessage(IRCPerson *person, QString message) { |
72 | m_connection->sendLine("PRIVMSG " + person->nick() + " :" + message); | 72 | m_connection->sendLine("PRIVMSG " + person->nick() + " :" + message); |
73 | } | 73 | } |
74 | 74 | ||
75 | void IRCSession::sendMessage(IRCChannel *channel, QString message) { | 75 | void IRCSession::sendMessage(IRCChannel *channel, QString message) { |
76 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :" + message); | 76 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :" + message); |
77 | } | 77 | } |
78 | 78 | ||
79 | void IRCSession::sendAction(IRCChannel *channel, QString message) { | 79 | void IRCSession::sendAction(IRCChannel *channel, QString message) { |
80 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :\001ACTION " + message + "\001"); | 80 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :\001ACTION " + message + "\001"); |
81 | } | 81 | } |
82 | 82 | ||
83 | void IRCSession::sendAction(IRCPerson *person, QString message) { | 83 | void IRCSession::sendAction(IRCPerson *person, QString message) { |
84 | m_connection->sendLine("PRIVMSG " + person->nick() + " :\001ACTION " + message + "\001"); | 84 | m_connection->sendLine("PRIVMSG " + person->nick() + " :\001ACTION " + message + "\001"); |
85 | } | 85 | } |
86 | 86 | ||
87 | bool IRCSession::isSessionActive() { | 87 | bool IRCSession::isSessionActive() { |
88 | return m_connection->isConnected(); | 88 | return m_connection->isConnected(); |
89 | } | 89 | } |
90 | 90 | ||
91 | void IRCSession::endSession() { | 91 | void IRCSession::endSession() { |
92 | if (m_connection->isLoggedIn()) | 92 | if (m_connection->isLoggedIn()) |
93 | m_connection->sendLine("QUIT :" APP_VERSION); | 93 | m_connection->sendLine("QUIT :" APP_VERSION); |
94 | else | 94 | else |
95 | m_connection->close(); | 95 | m_connection->close(); |
96 | } | 96 | } |
97 | 97 | ||
98 | void IRCSession::part(IRCChannel *channel) { | 98 | void IRCSession::part(IRCChannel *channel) { |
99 | m_connection->sendLine("PART " + channel->channelname() + " :" + APP_VERSION); | 99 | m_connection->sendLine("PART " + channel->channelname() + " :" + APP_VERSION); |
100 | } | 100 | } |
101 | 101 | ||
102 | 102 | ||
103 | IRCChannel *IRCSession::getChannel(QString channelname) { | 103 | IRCChannel *IRCSession::getChannel(QString channelname) { |
104 | QListIterator<IRCChannel> it(m_channels); | 104 | QListIterator<IRCChannel> it(m_channels); |
105 | for (; it.current(); ++it) { | 105 | for (; it.current(); ++it) { |