author | zecke <zecke> | 2004-09-06 22:47:48 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-06 22:47:48 (UTC) |
commit | 8f18e8b46dfaaa7e03b9ed1f3faed12da5b30cd5 (patch) (unidiff) | |
tree | 39158cd8abe423cf2df95b5038cdc7848de2e3dc /noncore/net/opieirc/ircmessageparser.cpp | |
parent | 8bf99aaa1b31e770b21b7bf50407a650a8f5d646 (diff) | |
download | opie-8f18e8b46dfaaa7e03b9ed1f3faed12da5b30cd5.zip opie-8f18e8b46dfaaa7e03b9ed1f3faed12da5b30cd5.tar.gz opie-8f18e8b46dfaaa7e03b9ed1f3faed12da5b30cd5.tar.bz2 |
-Some keyboard handling
-ping notification
merge of zautrixs work
Diffstat (limited to 'noncore/net/opieirc/ircmessageparser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircmessageparser.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp index 400ff41..90280d7 100644 --- a/noncore/net/opieirc/ircmessageparser.cpp +++ b/noncore/net/opieirc/ircmessageparser.cpp | |||
@@ -3,7 +3,7 @@ | |||
3 | #include "ircversion.h" | 3 | #include "ircversion.h" |
4 | 4 | ||
5 | /* Lookup table for literal commands */ | 5 | /* Lookup table for literal commands */ |
6 | IRCLiteralMessageParserStruct IRCMessageParser::literalParserProcTable[] = { | 6 | IRCLiteralMessageParserStruct IRCMessageParser::literalParserProcTable[] = { |
7 | { "PING", FUNC(parseLiteralPing) }, | 7 | { "PING", FUNC(parseLiteralPing) }, |
8 | { "NOTICE", FUNC(parseLiteralNotice) }, | 8 | { "NOTICE", FUNC(parseLiteralNotice) }, |
9 | { "JOIN", FUNC(parseLiteralJoin) }, | 9 | { "JOIN", FUNC(parseLiteralJoin) }, |
@@ -20,7 +20,7 @@ IRCLiteralMessageParserStruct IRCMessageParser::literalParserProcTable[] = { | |||
20 | }; | 20 | }; |
21 | 21 | ||
22 | /* Lookup table for literal commands */ | 22 | /* Lookup table for literal commands */ |
23 | IRCCTCPMessageParserStruct IRCMessageParser::ctcpParserProcTable[] = { | 23 | IRCCTCPMessageParserStruct IRCMessageParser::ctcpParserProcTable[] = { |
24 | { "PING", FUNC(parseCTCPPing) }, | 24 | { "PING", FUNC(parseCTCPPing) }, |
25 | { "VERSION", FUNC(parseCTCPVersion) }, | 25 | { "VERSION", FUNC(parseCTCPVersion) }, |
26 | { "ACTION", FUNC(parseCTCPAction) }, | 26 | { "ACTION", FUNC(parseCTCPAction) }, |
@@ -28,7 +28,7 @@ IRCCTCPMessageParserStruct IRCMessageParser::ctcpParserProcTable[] = { | |||
28 | }; | 28 | }; |
29 | 29 | ||
30 | /* Lookup table for numerical commands */ | 30 | /* Lookup table for numerical commands */ |
31 | IRCNumericalMessageParserStruct IRCMessageParser::numericalParserProcTable[] = { | 31 | IRCNumericalMessageParserStruct IRCMessageParser::numericalParserProcTable[] = { |
32 | { 1, FUNC(parseNumerical001) }, // RPL_WELCOME | 32 | { 1, FUNC(parseNumerical001) }, // RPL_WELCOME |
33 | { 2, FUNC(parseNumerical002) }, // RPL_YOURHOST | 33 | { 2, FUNC(parseNumerical002) }, // RPL_YOURHOST |
34 | { 3, FUNC(parseNumerical003) }, // RPL_CREATED | 34 | { 3, FUNC(parseNumerical003) }, // RPL_CREATED |
@@ -171,7 +171,7 @@ void IRCMessageParser::parseLiteralPart(IRCMessage *message) { | |||
171 | } | 171 | } |
172 | 172 | ||
173 | void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { | 173 | void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { |
174 | if (m_session->m_server->nick() == message->param(0)) { | 174 | if (m_session->m_server->nick().lower() == message->param(0).lower() ) { |
175 | /* IRC Query message detected, verify sender and display it */ | 175 | /* IRC Query message detected, verify sender and display it */ |
176 | IRCPerson mask(message->prefix()); | 176 | IRCPerson mask(message->prefix()); |
177 | IRCPerson *person = m_session->getPerson(mask.nick()); | 177 | IRCPerson *person = m_session->getPerson(mask.nick()); |
@@ -206,7 +206,7 @@ void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { | |||
206 | } | 206 | } |
207 | 207 | ||
208 | void IRCMessageParser::parseLiteralNick(IRCMessage *message) { | 208 | void IRCMessageParser::parseLiteralNick(IRCMessage *message) { |
209 | 209 | ||
210 | IRCPerson mask(message->prefix()); | 210 | IRCPerson mask(message->prefix()); |
211 | /* this way of handling nick changes really sucks */ | 211 | /* this way of handling nick changes really sucks */ |
212 | if (mask.nick() == m_session->m_server->nick()) { | 212 | if (mask.nick() == m_session->m_server->nick()) { |
@@ -220,7 +220,7 @@ void IRCMessageParser::parseLiteralNick(IRCMessage *message) { | |||
220 | IRCPerson *person = m_session->getPerson(mask.nick()); | 220 | IRCPerson *person = m_session->getPerson(mask.nick()); |
221 | if (person) { | 221 | if (person) { |
222 | //IRCOutput output(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg( mask.nick() ).arg( message->param(0))); | 222 | //IRCOutput output(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg( mask.nick() ).arg( message->param(0))); |
223 | 223 | ||
224 | /* new code starts here -- this removes the person from all channels */ | 224 | /* new code starts here -- this removes the person from all channels */ |
225 | QList<IRCChannel> channels; | 225 | QList<IRCChannel> channels; |
226 | m_session->getChannelsByPerson(person, channels); | 226 | m_session->getChannelsByPerson(person, channels); |
@@ -234,7 +234,7 @@ void IRCMessageParser::parseLiteralNick(IRCMessage *message) { | |||
234 | output.addParam(person); | 234 | output.addParam(person); |
235 | emit outputReady(output); | 235 | emit outputReady(output); |
236 | } | 236 | } |
237 | /* new code ends here */ | 237 | /* new code ends here */ |
238 | } else { | 238 | } else { |
239 | emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Nickname change of an unknown person"))); | 239 | emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Nickname change of an unknown person"))); |
240 | } | 240 | } |
@@ -248,7 +248,7 @@ void IRCMessageParser::parseLiteralQuit(IRCMessage *message) { | |||
248 | QList<IRCChannel> channels; | 248 | QList<IRCChannel> channels; |
249 | m_session->getChannelsByPerson(person, channels); | 249 | m_session->getChannelsByPerson(person, channels); |
250 | QListIterator<IRCChannel> it(channels); | 250 | QListIterator<IRCChannel> it(channels); |
251 | for (;it.current(); ++it) { | 251 | for (;it.current(); ++it) { |
252 | IRCChannelPerson *chanperson = it.current()->getPerson(mask.nick()); | 252 | IRCChannelPerson *chanperson = it.current()->getPerson(mask.nick()); |
253 | it.current()->removePerson(chanperson); | 253 | it.current()->removePerson(chanperson); |
254 | delete chanperson; | 254 | delete chanperson; |
@@ -325,7 +325,7 @@ void IRCMessageParser::parseCTCPAction(IRCMessage *message) { | |||
325 | } | 325 | } |
326 | } | 326 | } |
327 | } | 327 | } |
328 | 328 | ||
329 | void IRCMessageParser::parseLiteralMode(IRCMessage *message) { | 329 | void IRCMessageParser::parseLiteralMode(IRCMessage *message) { |
330 | IRCPerson mask(message->prefix()); | 330 | IRCPerson mask(message->prefix()); |
331 | 331 | ||
@@ -461,13 +461,13 @@ void IRCMessageParser::parseNumericalNames(IRCMessage *message) { | |||
461 | 461 | ||
462 | while (!stream.atEnd()) { | 462 | while (!stream.atEnd()) { |
463 | stream >> temp; | 463 | stream >> temp; |
464 | 464 | ||
465 | char flagch = temp.at(0).latin1(); | 465 | char flagch = temp.at(0).latin1(); |
466 | int flag = 0; | 466 | int flag = 0; |
467 | QString nick; | 467 | QString nick; |
468 | /* Parse person flags */ | 468 | /* Parse person flags */ |
469 | if (flagch == '@' || flagch == '+' || flagch=='%' || flagch == '*') { | 469 | if (flagch == '@' || flagch == '+' || flagch=='%' || flagch == '*') { |
470 | 470 | ||
471 | nick = temp.right(temp.length()-1); | 471 | nick = temp.right(temp.length()-1); |
472 | switch (flagch) { | 472 | switch (flagch) { |
473 | case '@': flag = PERSON_FLAG_OP; break; | 473 | case '@': flag = PERSON_FLAG_OP; break; |
@@ -478,7 +478,7 @@ void IRCMessageParser::parseNumericalNames(IRCMessage *message) { | |||
478 | } else { | 478 | } else { |
479 | nick = temp; | 479 | nick = temp; |
480 | } | 480 | } |
481 | 481 | ||
482 | IRCChannelPerson *chan_person = new IRCChannelPerson(); | 482 | IRCChannelPerson *chan_person = new IRCChannelPerson(); |
483 | IRCPerson *person = m_session->getPerson(nick); | 483 | IRCPerson *person = m_session->getPerson(nick); |
484 | if (person == 0) { | 484 | if (person == 0) { |