summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircchanneltab.cpp
authorskyhusker <skyhusker>2005-01-14 20:54:49 (UTC)
committer skyhusker <skyhusker>2005-01-14 20:54:49 (UTC)
commita808497c334275c4b73e31a9bea37f84e344964d (patch) (side-by-side diff)
tree490b0396494b83b1145fc65ab81e3e437af9aed5 /noncore/net/opieirc/ircchanneltab.cpp
parentb6c5c3b8b1ab130217678ec789db573ffc52c3eb (diff)
downloadopie-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/ircchanneltab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchanneltab.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircchanneltab.cpp b/noncore/net/opieirc/ircchanneltab.cpp
index 581f9a5..4a35929 100644
--- a/noncore/net/opieirc/ircchanneltab.cpp
+++ b/noncore/net/opieirc/ircchanneltab.cpp
@@ -1,11 +1,14 @@
#include <qpe/resource.h>
#include <qwhatsthis.h>
#include <qhbox.h>
+#include <qdict.h>
#include "ircchanneltab.h"
#include "ircservertab.h"
#include "ircmessageparser.h"
+QDict<QString> IRCChannelTab::m_queuedMessages (17);
+
IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) {
m_mainWindow = mainWindow;
m_parentTab = parentTab;
@@ -53,6 +56,12 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
connect(m_list, SIGNAL(doubleClicked ( QListBoxItem * ) ), this, SLOT(popupQuery( QListBoxItem * ) ));
settingsChanged();
+
+ if(m_queuedMessages[m_channel->channelname()]) {
+ appendText(*m_queuedMessages[m_channel->channelname()]);
+ delete m_queuedMessages[m_channel->channelname()];
+ m_queuedMessages.remove(m_channel->channelname());
+ }
}
void IRCChannelTab::scrolling(){
@@ -182,6 +191,13 @@ void IRCChannelTab::remove() {
}
}
+void IRCChannelTab::enqueue(const QString &channel, const QString &message) {
+ if (m_queuedMessages.count() == (m_queuedMessages.size() - 1) )
+ /* 17 messages max */
+ return;
+ m_queuedMessages.insert(channel, new QString(message));
+}
+
IRCChannel *IRCChannelTab::channel() {
return m_channel;
}
@@ -189,3 +205,4 @@ IRCChannel *IRCChannelTab::channel() {
IRCChannelList *IRCChannelTab::list() {
return m_list;
}
+