-rw-r--r-- | noncore/net/opieirc/config.in | 2 | ||||
-rw-r--r-- | noncore/net/opieirc/ircchannellist.cpp | 11 | ||||
-rw-r--r-- | noncore/net/opieirc/ircchannellist.h | 1 | ||||
-rw-r--r-- | noncore/net/opieirc/ircchanneltab.cpp | 1 | ||||
-rw-r--r-- | noncore/net/opieirc/ircmessageparser.cpp | 17 | ||||
-rw-r--r-- | noncore/net/opieirc/ircservertab.cpp | 24 | ||||
-rw-r--r-- | noncore/net/opieirc/ircsession.cpp | 4 | ||||
-rw-r--r-- | noncore/net/opieirc/ircsession.h | 1 |
8 files changed, 50 insertions, 11 deletions
diff --git a/noncore/net/opieirc/config.in b/noncore/net/opieirc/config.in index 30184a9..7c6949d 100644 --- a/noncore/net/opieirc/config.in +++ b/noncore/net/opieirc/config.in | |||
@@ -1,3 +1,3 @@ | |||
1 | config OPIEIRC | 1 | config OPIEIRC |
2 | boolean "opieirc" | 2 | boolean "opie-irc (chat via your favorite IRC server)" |
3 | default "y" | 3 | default "y" |
diff --git a/noncore/net/opieirc/ircchannellist.cpp b/noncore/net/opieirc/ircchannellist.cpp index e592d05..566b223 100644 --- a/noncore/net/opieirc/ircchannellist.cpp +++ b/noncore/net/opieirc/ircchannellist.cpp | |||
@@ -37 +37,12 @@ bool IRCChannelList::hasPerson(QString nick) { | |||
37 | } | 37 | } |
38 | |||
39 | bool IRCChannelList::removePerson(QString nick) { | ||
40 | for (unsigned int i=0; i<count(); i++) { | ||
41 | if (text(i) == nick){ | ||
42 | removeItem(i); | ||
43 | return TRUE; | ||
44 | } | ||
45 | } | ||
46 | return FALSE; | ||
47 | } | ||
48 | |||
diff --git a/noncore/net/opieirc/ircchannellist.h b/noncore/net/opieirc/ircchannellist.h index fa3c8cd..deab649 100644 --- a/noncore/net/opieirc/ircchannellist.h +++ b/noncore/net/opieirc/ircchannellist.h | |||
@@ -31,2 +31,3 @@ public: | |||
31 | bool hasPerson(QString nick); | 31 | bool hasPerson(QString nick); |
32 | bool removePerson(QString nick); | ||
32 | protected: | 33 | protected: |
diff --git a/noncore/net/opieirc/ircchanneltab.cpp b/noncore/net/opieirc/ircchanneltab.cpp index beb8bce..2b8b65e 100644 --- a/noncore/net/opieirc/ircchanneltab.cpp +++ b/noncore/net/opieirc/ircchanneltab.cpp | |||
@@ -64,2 +64,3 @@ void IRCChannelTab::appendText(QString text) { | |||
64 | } | 64 | } |
65 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | ||
65 | m_textview->setText(txt); | 66 | m_textview->setText(txt); |
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp index 6b88f34..400ff41 100644 --- a/noncore/net/opieirc/ircmessageparser.cpp +++ b/noncore/net/opieirc/ircmessageparser.cpp | |||
@@ -208,4 +208,5 @@ void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { | |||
208 | void IRCMessageParser::parseLiteralNick(IRCMessage *message) { | 208 | void IRCMessageParser::parseLiteralNick(IRCMessage *message) { |
209 | IRCPerson mask(message->prefix()); | ||
210 | 209 | ||
210 | IRCPerson mask(message->prefix()); | ||
211 | /* this way of handling nick changes really sucks */ | ||
211 | if (mask.nick() == m_session->m_server->nick()) { | 212 | if (mask.nick() == m_session->m_server->nick()) { |
@@ -220,2 +221,13 @@ void IRCMessageParser::parseLiteralNick(IRCMessage *message) { | |||
220 | if (person) { | 221 | if (person) { |
222 | //IRCOutput output(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg( mask.nick() ).arg( message->param(0))); | ||
223 | |||
224 | /* new code starts here -- this removes the person from all channels */ | ||
225 | QList<IRCChannel> channels; | ||
226 | m_session->getChannelsByPerson(person, channels); | ||
227 | QListIterator<IRCChannel> it(channels); | ||
228 | for (;it.current(); ++it) { | ||
229 | IRCChannelPerson *chanperson = it.current()->getPerson(mask.nick()); | ||
230 | it.current()->removePerson(chanperson); | ||
231 | chanperson->person->setNick(message->param(0)); | ||
232 | it.current()->addPerson(chanperson); | ||
221 | IRCOutput output(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg( mask.nick() ).arg( message->param(0 ))); | 233 | IRCOutput output(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg( mask.nick() ).arg( message->param(0 ))); |
@@ -223,2 +235,4 @@ void IRCMessageParser::parseLiteralNick(IRCMessage *message) { | |||
223 | emit outputReady(output); | 235 | emit outputReady(output); |
236 | } | ||
237 | /* new code ends here */ | ||
224 | } else { | 238 | } else { |
@@ -399,2 +413,3 @@ void IRCMessageParser::parseLiteralKick(IRCMessage *message) { | |||
399 | } else { | 413 | } else { |
414 | /* someone else got kicked */ | ||
400 | channel->removePerson(person); | 415 | channel->removePerson(person); |
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp index 1d9520a..2c28507 100644 --- a/noncore/net/opieirc/ircservertab.cpp +++ b/noncore/net/opieirc/ircservertab.cpp | |||
@@ -125,12 +125,6 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) { | |||
125 | if (nickname.length() > 0) { | 125 | if (nickname.length() > 0) { |
126 | if (line.length() > 7 + nickname.length()) { | 126 | QString text = line.right(line.length()-nickname.length()-5); |
127 | QString text = line.right(line.length()-nickname.length()-7); | ||
128 | IRCPerson person; | 127 | IRCPerson person; |
129 | person.setNick(nickname); | 128 | person.setNick(nickname); |
130 | m_session->kick(((IRCChannelTab *)tab)->channel(), &person, text); | 129 | m_session->op(((IRCChannelTab *)tab)->channel(), &person); |
131 | } else { | ||
132 | IRCPerson person; | ||
133 | person.setNick(nickname); | ||
134 | m_session->kick(((IRCChannelTab *)tab)->channel(), &person); | ||
135 | } | ||
136 | } | 130 | } |
@@ -348,3 +342,15 @@ void IRCServerTab::display(IRCOutput output) { | |||
348 | break; | 342 | break; |
349 | case OUTPUT_OTHERJOIN: | 343 | /* case OUTPUT_NICKCHANGE: { |
344 | //WAS HERE | ||
345 | QString nick = ((IRCPerson *)output.getParam(0))->nick(); | ||
346 | QListIterator<IRCChannelTab> it(m_channelTabs); | ||
347 | for (; it.current(); ++it) { | ||
348 | if (it.current()->list()->hasPerson(nick)) { | ||
349 | it.current()->appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>"); | ||
350 | it.current()->list()->update(); | ||
351 | } | ||
352 | } | ||
353 | } | ||
354 | break; | ||
355 | */ case OUTPUT_OTHERJOIN: | ||
350 | case OUTPUT_OTHERKICK: | 356 | case OUTPUT_OTHERKICK: |
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp index 1cc1ee2..6404d71 100644 --- a/noncore/net/opieirc/ircsession.cpp +++ b/noncore/net/opieirc/ircsession.cpp | |||
@@ -62,2 +62,6 @@ void IRCSession::kick(IRCChannel *channel, IRCPerson *person) { | |||
62 | 62 | ||
63 | void IRCSession::op(IRCChannel *channel, IRCPerson *person) { | ||
64 | m_connection->sendLine("MODE "+ channel->channelname() + " +ooo " + person->nick()); | ||
65 | } | ||
66 | |||
63 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person, QString message) { | 67 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person, QString message) { |
diff --git a/noncore/net/opieirc/ircsession.h b/noncore/net/opieirc/ircsession.h index a6a3e50..f6330d8 100644 --- a/noncore/net/opieirc/ircsession.h +++ b/noncore/net/opieirc/ircsession.h | |||
@@ -53,2 +53,3 @@ public: | |||
53 | void part(IRCChannel *channel); | 53 | void part(IRCChannel *channel); |
54 | void op(IRCChannel *channel, IRCPerson *person); | ||
54 | void kick(IRCChannel *channel, IRCPerson *person); | 55 | void kick(IRCChannel *channel, IRCPerson *person); |