Diffstat (limited to 'noncore/net/opieirc/ircsession.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircsession.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp index 122a943..1cc1ee2 100644 --- a/noncore/net/opieirc/ircsession.cpp +++ b/noncore/net/opieirc/ircsession.cpp | |||
@@ -19,24 +19,60 @@ IRCSession::~IRCSession() { | |||
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(){ | ||
32 | m_connection->sendLine("QUIT :[OI] I'm too good to need a reason"); | ||
33 | } | ||
34 | |||
35 | void IRCSession::quit(QString message){ | ||
36 | m_connection->sendLine("QUIT :" + message); | ||
37 | } | ||
38 | |||
39 | void IRCSession::topic(IRCChannel *channel, QString message){ | ||
40 | m_connection->sendLine("TOPIC :" + channel->channelname() + " " + message); | ||
41 | } | ||
42 | |||
43 | void IRCSession::mode(IRCChannel *channel, QString message){ | ||
44 | m_connection->sendLine("MODE " + channel->channelname() + " " + message); | ||
45 | } | ||
46 | |||
47 | void IRCSession::mode(IRCPerson *person, QString message){ | ||
48 | m_connection->sendLine("MODE " + person->nick() + " " + message); | ||
49 | } | ||
50 | |||
51 | void IRCSession::mode(QString message){ | ||
52 | m_connection->sendLine("MODE " + message); | ||
53 | } | ||
54 | |||
55 | void IRCSession::raw(QString message){ | ||
56 | m_connection->sendLine(message); | ||
57 | } | ||
58 | |||
59 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person) { | ||
60 | m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :0wn3d - no reason"); | ||
61 | } | ||
62 | |||
63 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person, QString message) { | ||
64 | m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :" + message); | ||
65 | } | ||
66 | |||
31 | void IRCSession::sendMessage(IRCPerson *person, QString message) { | 67 | void IRCSession::sendMessage(IRCPerson *person, QString message) { |
32 | m_connection->sendLine("PRIVMSG " + person->nick() + " :" + message); | 68 | m_connection->sendLine("PRIVMSG " + person->nick() + " :" + message); |
33 | } | 69 | } |
34 | 70 | ||
35 | void IRCSession::sendMessage(IRCChannel *channel, QString message) { | 71 | void IRCSession::sendMessage(IRCChannel *channel, QString message) { |
36 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :" + message); | 72 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :" + message); |
37 | } | 73 | } |
38 | 74 | ||
39 | void IRCSession::sendAction(IRCChannel *channel, QString message) { | 75 | void IRCSession::sendAction(IRCChannel *channel, QString message) { |
40 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :\001ACTION " + message + "\001"); | 76 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :\001ACTION " + message + "\001"); |
41 | } | 77 | } |
42 | 78 | ||
@@ -99,13 +135,12 @@ void IRCSession::addChannel(IRCChannel *channel) { | |||
99 | 135 | ||
100 | void IRCSession::removeChannel(IRCChannel *channel) { | 136 | void IRCSession::removeChannel(IRCChannel *channel) { |
101 | m_channels.remove(channel); | 137 | m_channels.remove(channel); |
102 | } | 138 | } |
103 | 139 | ||
104 | void IRCSession::removePerson(IRCPerson *person) { | 140 | void IRCSession::removePerson(IRCPerson *person) { |
105 | m_people.remove(person); | 141 | m_people.remove(person); |
106 | } | 142 | } |
107 | 143 | ||
108 | void IRCSession::handleMessage(IRCMessage *message) { | 144 | void IRCSession::handleMessage(IRCMessage *message) { |
109 | m_parser->parse(message); | 145 | m_parser->parse(message); |
110 | } | 146 | } |
111 | |||