summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircservertab.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircservertab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircservertab.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index 2ad56a8..503a758 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -50,24 +50,35 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
50 QString command; 50 QString command;
51 stream >> command; 51 stream >> command;
52 command = command.upper().right(command.length()-1); 52 command = command.upper().right(command.length()-1);
53 53
54 if (command == "JOIN") { 54 if (command == "JOIN") {
55 QString channel; 55 QString channel;
56 stream >> channel; 56 stream >> channel;
57 if (channel.length() > 0 && channel.startsWith("#")) { 57 if (channel.length() > 0 && channel.startsWith("#")) {
58 m_session->join(channel); 58 m_session->join(channel);
59 } else { 59 } else {
60 tab->appendText("<font color=\"#ff0000\">Unknown channel format!</font><br>"); 60 tab->appendText("<font color=\"#ff0000\">Unknown channel format!</font><br>");
61 } 61 }
62 } else if (command == "ME") {
63 QString text = IRCOutput::toHTML(line.right(line.length()-4));
64 if (text.length() > 0) {
65 if (tab->isA("IRCChannelTab")) {
66 tab->appendText("<font color=\"#cc0000\">*" + m_server.nick() + " " + text + "</font><br>");
67 m_session->sendAction(((IRCChannelTab *)tab)->channel(), text);
68 } else if (tab->isA("IRCQueryTab")) {
69 } else {
70 tab->appendText("<font color=\"#ff0000\">Invalid tab for this command</font><br>");
71 }
72 }
62 } else { 73 } else {
63 tab->appendText("<font color=\"#ff0000\">Unknown command</font><br>"); 74 tab->appendText("<font color=\"#ff0000\">Unknown command</font><br>");
64 } 75 }
65} 76}
66 77
67void IRCServerTab::processCommand() { 78void IRCServerTab::processCommand() {
68 QString text = m_field->text(); 79 QString text = m_field->text();
69 if (text.startsWith("/") && !text.startsWith("//")) { 80 if (text.startsWith("/") && !text.startsWith("//")) {
70 /* Command mode */ 81 /* Command mode */
71 executeCommand(this, text); 82 executeCommand(this, text);
72 } 83 }
73 m_field->clear(); 84 m_field->clear();