summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircservertab.cpp
Side-by-side diff
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
@@ -38,48 +38,59 @@ QString IRCServerTab::title() {
}
IRCSession *IRCServerTab::session() {
return m_session;
}
IRCServer *IRCServerTab::server() {
return &m_server;
}
void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
QTextIStream stream(&line);
QString command;
stream >> command;
command = command.upper().right(command.length()-1);
if (command == "JOIN") {
QString channel;
stream >> channel;
if (channel.length() > 0 && channel.startsWith("#")) {
m_session->join(channel);
} else {
tab->appendText("<font color=\"#ff0000\">Unknown channel format!</font><br>");
}
+ } else if (command == "ME") {
+ QString text = IRCOutput::toHTML(line.right(line.length()-4));
+ if (text.length() > 0) {
+ if (tab->isA("IRCChannelTab")) {
+ tab->appendText("<font color=\"#cc0000\">*" + m_server.nick() + " " + text + "</font><br>");
+ m_session->sendAction(((IRCChannelTab *)tab)->channel(), text);
+ } else if (tab->isA("IRCQueryTab")) {
+ } else {
+ tab->appendText("<font color=\"#ff0000\">Invalid tab for this command</font><br>");
+ }
+ }
} else {
tab->appendText("<font color=\"#ff0000\">Unknown command</font><br>");
}
}
void IRCServerTab::processCommand() {
QString text = m_field->text();
if (text.startsWith("/") && !text.startsWith("//")) {
/* Command mode */
executeCommand(this, text);
}
m_field->clear();
}
void IRCServerTab::doConnect() {
m_session->beginSession();
}
void IRCServerTab::remove() {
/* Close requested */
if (m_session->isSessionActive()) {
/* While there is a running session */
m_close = TRUE;
m_session->endSession();