author | wazlaf <wazlaf> | 2002-09-20 23:28:14 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-09-20 23:28:14 (UTC) |
commit | 912092425248f7fc5155b4c7c46b7d00ec2676bc (patch) (side-by-side diff) | |
tree | 5bbf746e83b2dffad89542c42031a573c34da751 /noncore/net/opieirc/ircchanneltab.cpp | |
parent | cd3df897c1b0ed93c2be3ab411011a0bdfe88bf9 (diff) | |
download | opie-912092425248f7fc5155b4c7c46b7d00ec2676bc.zip opie-912092425248f7fc5155b4c7c46b7d00ec2676bc.tar.gz opie-912092425248f7fc5155b4c7c46b7d00ec2676bc.tar.bz2 |
support for client commands (only /join implemented so far), crash bugfix, fixed 2 leaks, server browser now includes a channel list
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 @@ -38,11 +38,23 @@ IRCChannelTab::~IRCChannelTab() { } void IRCChannelTab::processCommand() { - if (m_field->text().length()>0) { - session()->sendMessage(m_channel, m_field->text()); - appendText("<<font color=\"#dd0000\">"+m_parentTab->server()->nick()+"</font>> "+m_field->text()+"<br>"); - m_field->clear(); + 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("<<font color=\"#dd0000\">"+m_parentTab->server()->nick()+"</font>> "+m_field->text()+"<br>"); + } + } + } else { + appendText("<font color=\"#ff0000\">"+tr("Disconnected")+"</font><br>"); + } } + m_field->clear(); } void IRCChannelTab::toggleList() { @@ -65,7 +77,11 @@ IRCSession *IRCChannelTab::session() { } void IRCChannelTab::remove() { - session()->part(m_channel); + if (session()->isSessionActive()) { + session()->part(m_channel); + } else { + m_mainWindow->killTab(this); + } } IRCChannel *IRCChannelTab::channel() { |