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.cpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index e031d4d..90353f2 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -19,3 +19,3 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa
m_lines = 0;
- m_description->setText(tr("Connection to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>");
+ m_description->setText(tr("Connecting to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>");
m_textview = new QTextView(this);
@@ -37,2 +37,3 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa
connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
+ connect(m_session, SIGNAL(updateChannels()), this, SLOT(slotUpdateChannels()));
settingsChanged();
@@ -115,3 +116,9 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
stream >> channel;
- if (channel.length() > 0 && (channel.startsWith("#") || channel.startsWith("+"))) {
+ /* According to RFC 1459 */
+ if (channel.length() > 0 && channel.length() < 200 &&
+ channel.find(",") == -1 && channel.find("") == -1) {
+
+ if (!channel.startsWith("#") && !channel.startsWith("&")) {
+ channel = channel.prepend("#");
+ }
m_session->join(channel);
@@ -347,3 +354,3 @@ void IRCServerTab::display(IRCOutput output) {
}
- appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>");
+ IRCChannelTab::enqueue(channel->channelname(), "<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>");
}
@@ -361,15 +368,18 @@ void IRCServerTab::display(IRCOutput output) {
break;
-/* case OUTPUT_NICKCHANGE: {
- //WAS HERE
- QString nick = ((IRCPerson *)output.getParam(0))->nick();
+ case OUTPUT_NICKCHANGE: {
+ QString *nick = static_cast<QString*>(output.getParam(0));
+ if(!nick) {
+ appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>");
+ break;
+ }
QListIterator<IRCChannelTab> it(m_channelTabs);
for (; it.current(); ++it) {
- if (it.current()->list()->hasPerson(nick)) {
+ if (it.current()->list()->hasPerson(*nick)) {
it.current()->appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>");
- it.current()->list()->update();
}
}
+ delete nick;
}
break;
- */ case OUTPUT_OTHERJOIN:
+ case OUTPUT_OTHERJOIN:
case OUTPUT_OTHERKICK:
@@ -388,2 +398,5 @@ void IRCServerTab::display(IRCOutput output) {
break;
+ case OUTPUT_TITLE:
+ m_description->setText(output.message());
+ break;
default:
@@ -393 +406,9 @@ void IRCServerTab::display(IRCOutput output) {
}
+
+void IRCServerTab::slotUpdateChannels() {
+ QListIterator<IRCChannelTab> it(m_channelTabs);
+ for (; it.current(); ++it) {
+ it.current()->list()->update();
+ }
+}
+