author | skyhusker <skyhusker> | 2005-01-14 20:54:49 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-01-14 20:54:49 (UTC) |
commit | a808497c334275c4b73e31a9bea37f84e344964d (patch) (unidiff) | |
tree | 490b0396494b83b1145fc65ab81e3e437af9aed5 /noncore/net/opieirc/ircservertab.cpp | |
parent | b6c5c3b8b1ab130217678ec789db573ffc52c3eb (diff) | |
download | opie-a808497c334275c4b73e31a9bea37f84e344964d.zip opie-a808497c334275c4b73e31a9bea37f84e344964d.tar.gz opie-a808497c334275c4b73e31a9bea37f84e344964d.tar.bz2 |
Added message queue, now topics always appear in channel tab
Diffstat (limited to 'noncore/net/opieirc/ircservertab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircservertab.cpp | 39 |
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 | |||
@@ -18,5 +18,5 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa | |||
18 | m_close = FALSE; | 18 | m_close = FALSE; |
19 | m_lines = 0; | 19 | m_lines = 0; |
20 | m_description->setText(tr("Connection to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>"); | 20 | m_description->setText(tr("Connecting to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>"); |
21 | m_textview = new QTextView(this); | 21 | m_textview = new QTextView(this); |
22 | m_textview->setHScrollBarMode(QScrollView::AlwaysOff); | 22 | m_textview->setHScrollBarMode(QScrollView::AlwaysOff); |
@@ -36,4 +36,5 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa | |||
36 | connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); | 36 | connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); |
37 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); | 37 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); |
38 | connect(m_session, SIGNAL(updateChannels()), this, SLOT(slotUpdateChannels())); | ||
38 | settingsChanged(); | 39 | settingsChanged(); |
39 | 40 | ||
@@ -114,5 +115,11 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) { | |||
114 | QString channel; | 115 | QString channel; |
115 | stream >> channel; | 116 | stream >> channel; |
116 | if (channel.length() > 0 && (channel.startsWith("#") || channel.startsWith("+"))) { | 117 | /* According to RFC 1459 */ |
118 | if (channel.length() > 0 && channel.length() < 200 && | ||
119 | channel.find(",") == -1 && channel.find("") == -1) { | ||
120 | |||
121 | if (!channel.startsWith("#") && !channel.startsWith("&")) { | ||
122 | channel = channel.prepend("#"); | ||
123 | } | ||
117 | m_session->join(channel); | 124 | m_session->join(channel); |
118 | } else { | 125 | } else { |
@@ -346,5 +353,5 @@ void IRCServerTab::display(IRCOutput output) { | |||
346 | } | 353 | } |
347 | } | 354 | } |
348 | appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>"); | 355 | IRCChannelTab::enqueue(channel->channelname(), "<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>"); |
349 | } | 356 | } |
350 | break; | 357 | break; |
@@ -360,17 +367,20 @@ void IRCServerTab::display(IRCOutput output) { | |||
360 | } | 367 | } |
361 | break; | 368 | break; |
362 | /* case OUTPUT_NICKCHANGE: { | 369 | case OUTPUT_NICKCHANGE: { |
363 | //WAS HERE | 370 | QString *nick = static_cast<QString*>(output.getParam(0)); |
364 | QString nick = ((IRCPerson *)output.getParam(0))->nick(); | 371 | if(!nick) { |
372 | appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>"); | ||
373 | break; | ||
374 | } | ||
365 | QListIterator<IRCChannelTab> it(m_channelTabs); | 375 | QListIterator<IRCChannelTab> it(m_channelTabs); |
366 | for (; it.current(); ++it) { | 376 | for (; it.current(); ++it) { |
367 | if (it.current()->list()->hasPerson(nick)) { | 377 | if (it.current()->list()->hasPerson(*nick)) { |
368 | it.current()->appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>"); | 378 | it.current()->appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>"); |
369 | it.current()->list()->update(); | ||
370 | } | 379 | } |
371 | } | 380 | } |
381 | delete nick; | ||
372 | } | 382 | } |
373 | break; | 383 | break; |
374 | */ case OUTPUT_OTHERJOIN: | 384 | case OUTPUT_OTHERJOIN: |
375 | case OUTPUT_OTHERKICK: | 385 | case OUTPUT_OTHERKICK: |
376 | case OUTPUT_CHANPERSONMODE: | 386 | case OUTPUT_CHANPERSONMODE: |
@@ -387,4 +397,7 @@ void IRCServerTab::display(IRCOutput output) { | |||
387 | appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() + "</font><br>"); | 397 | appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() + "</font><br>"); |
388 | break; | 398 | break; |
399 | case OUTPUT_TITLE: | ||
400 | m_description->setText(output.message()); | ||
401 | break; | ||
389 | default: | 402 | default: |
390 | appendText("<font color=\"" + m_serverColor + "\">" + output.htmlMessage() + "</font><br>"); | 403 | appendText("<font color=\"" + m_serverColor + "\">" + output.htmlMessage() + "</font><br>"); |
@@ -392,2 +405,10 @@ void IRCServerTab::display(IRCOutput output) { | |||
392 | } | 405 | } |
393 | } | 406 | } |
407 | |||
408 | void IRCServerTab::slotUpdateChannels() { | ||
409 | QListIterator<IRCChannelTab> it(m_channelTabs); | ||
410 | for (; it.current(); ++it) { | ||
411 | it.current()->list()->update(); | ||
412 | } | ||
413 | } | ||
414 | |||