Diffstat (limited to 'noncore/net/opieirc/ircchanneltab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircchanneltab.cpp | 26 |
1 files changed, 21 insertions, 5 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 | |||
@@ -40,7 +40,19 @@ IRCChannelTab::~IRCChannelTab() { | |||
40 | void IRCChannelTab::processCommand() { | 40 | void IRCChannelTab::processCommand() { |
41 | if (m_field->text().length()>0) { | 41 | QString text = m_field->text(); |
42 | session()->sendMessage(m_channel, m_field->text()); | 42 | if (text.length()>0) { |
43 | appendText("<<font color=\"#dd0000\">"+m_parentTab->server()->nick()+"</font>> "+m_field->text()+"<br>"); | 43 | if (session()->isSessionActive()) { |
44 | m_field->clear(); | 44 | if (text.startsWith("/") && !text.startsWith("//")) { |
45 | /* Command mode */ | ||
46 | m_parentTab->executeCommand(this, text);; | ||
47 | } else { | ||
48 | if (session()->isSessionActive()) { | ||
49 | session()->sendMessage(m_channel, m_field->text()); | ||
50 | appendText("<<font color=\"#dd0000\">"+m_parentTab->server()->nick()+"</font>> "+m_field->text()+"<br>"); | ||
51 | } | ||
52 | } | ||
53 | } else { | ||
54 | appendText("<font color=\"#ff0000\">"+tr("Disconnected")+"</font><br>"); | ||
55 | } | ||
45 | } | 56 | } |
57 | m_field->clear(); | ||
46 | } | 58 | } |
@@ -67,3 +79,7 @@ IRCSession *IRCChannelTab::session() { | |||
67 | void IRCChannelTab::remove() { | 79 | void IRCChannelTab::remove() { |
68 | session()->part(m_channel); | 80 | if (session()->isSessionActive()) { |
81 | session()->part(m_channel); | ||
82 | } else { | ||
83 | m_mainWindow->killTab(this); | ||
84 | } | ||
69 | } | 85 | } |