summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircchanneltab.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opieirc/ircchanneltab.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchanneltab.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircchanneltab.cpp b/noncore/net/opieirc/ircchanneltab.cpp
index c96a365..754442a 100644
--- a/noncore/net/opieirc/ircchanneltab.cpp
+++ b/noncore/net/opieirc/ircchanneltab.cpp
@@ -38,12 +38,24 @@ IRCChannelTab::~IRCChannelTab() {
}
void IRCChannelTab::processCommand() {
- if (m_field->text().length()>0) {
+ QString text = m_field->text();
+ if (text.length()>0) {
+ if (session()->isSessionActive()) {
+ if (text.startsWith("/") && !text.startsWith("//")) {
+ /* Command mode */
+ m_parentTab->executeCommand(this, text);;
+ } else {
+ if (session()->isSessionActive()) {
session()->sendMessage(m_channel, m_field->text());
appendText("&lt;<font color=\"#dd0000\">"+m_parentTab->server()->nick()+"</font>&gt; "+m_field->text()+"<br>");
- m_field->clear();
}
}
+ } else {
+ appendText("<font color=\"#ff0000\">"+tr("Disconnected")+"</font><br>");
+ }
+ }
+ m_field->clear();
+}
void IRCChannelTab::toggleList() {
if (m_listVisible) {
@@ -65,7 +77,11 @@ IRCSession *IRCChannelTab::session() {
}
void IRCChannelTab::remove() {
+ if (session()->isSessionActive()) {
session()->part(m_channel);
+ } else {
+ m_mainWindow->killTab(this);
+ }
}
IRCChannel *IRCChannelTab::channel() {