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.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index 90353f2..bddc37e 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -1,29 +1,30 @@
#include <qtextstream.h>
#include <qwhatsthis.h>
#include "ircservertab.h"
#include "ircmessageparser.h"
+#include "ircchannelperson.h"
bool IRCServerTab::containsPing( const QString& text, IRCServerTab* tab ) {
return (text.contains(IRCMessageParser::tr("Received a CTCP PING from "))) ||
(text.find("ping") != -1 && text.find( tab->server()->nick() != -1));
}
IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) {
m_server = server;
m_session = new IRCSession(&m_server);
m_mainWindow = mainWindow;
m_close = FALSE;
m_lines = 0;
m_description->setText(tr("Connecting to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>");
m_textview = new QTextView(this);
m_textview->setHScrollBarMode(QScrollView::AlwaysOff);
m_textview->setVScrollBarMode(QScrollView::AlwaysOn);
m_textview->setTextFormat(RichText);
QWhatsThis::add(m_textview, tr("Server messages"));
m_layout->add(m_textview);
m_field = new IRCHistoryLineEdit(this);
connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab()));
connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab()));
@@ -290,49 +291,49 @@ void IRCServerTab::display(IRCOutput output) {
while (m_channelTabs.current() != 0) {
m_mainWindow->killTab(m_channelTabs.current(), true);
}
m_queryTabs.first();
while (m_queryTabs.current() != 0) {
m_mainWindow->killTab(m_queryTabs.current(), true);
}
m_mainWindow->killTab(this);
} else {
appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() +"</font><br>");
QListIterator<IRCChannelTab> it(m_channelTabs);
for (; it.current(); ++it) {
it.current()->appendText("<font color=\"" + m_serverColor + "\">" + output.htmlMessage() +"</font><br>");
}
}
break;
case OUTPUT_SELFJOIN: {
IRCChannelTab *channeltab = new IRCChannelTab((IRCChannel *)output.getParam(0), this, m_mainWindow, (QWidget *)parent());
m_channelTabs.append(channeltab);
m_mainWindow->addTab(channeltab);
}
break;
case OUTPUT_CHANPRIVMSG: {
IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
- channelTab->appendText("<font color=\"" + m_textColor + "\">&lt;</font><font color=\"" + m_otherColor + "\">"+IRCOutput::toHTML(((IRCChannelPerson *)output.getParam(1))->person->nick())+"</font><font color=\"" + m_textColor + "\">&gt; " + output.htmlMessage()+"</font><br>");
+ channelTab->appendText("<font color=\"" + m_textColor + "\">&lt;</font><font color=\"" + m_otherColor + "\">"+IRCOutput::toHTML(((IRCChannelPerson *)output.getParam(1))->nick())+"</font><font color=\"" + m_textColor + "\">&gt; " + output.htmlMessage()+"</font><br>");
}
break;
case OUTPUT_QUERYACTION:
case OUTPUT_QUERYPRIVMSG: {
IRCQueryTab *queryTab = getTabForQuery((IRCPerson *)output.getParam(0));
if (!queryTab) {
queryTab = new IRCQueryTab((IRCPerson *)output.getParam(0), this, m_mainWindow, (QWidget *)parent());
m_queryTabs.append(queryTab);
m_mainWindow->addTab(queryTab);
}
queryTab->display(output);
}
break;
case OUTPUT_SELFPART: {
IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
if (channelTab)
m_mainWindow->killTab(channelTab, true);
}
break;
case OUTPUT_SELFKICK: {
appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() + "</font><br>");
IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
if (channelTab)
m_mainWindow->killTab(channelTab, true);