summaryrefslogtreecommitdiffstats
path: root/src/jabber_whiteboard/message-queue.cpp
diff options
context:
space:
mode:
authordaleharvey <daleharvey@users.sourceforge.net>2006-06-23 13:15:16 +0000
committerdaleharvey <daleharvey@users.sourceforge.net>2006-06-23 13:15:16 +0000
commitfcadbfb31e9e8bd463a16369e3de2ec96a413a6a (patch)
tree41c3f39b304687f41ec169c8aa95a5984aa5910f /src/jabber_whiteboard/message-queue.cpp
parentquick g_message UndoStackObserver for tracing calls to the undo system (diff)
downloadinkscape-fcadbfb31e9e8bd463a16369e3de2ec96a413a6a.tar.gz
inkscape-fcadbfb31e9e8bd463a16369e3de2ec96a413a6a.zip
manually merging the INKBOARD_PEDRO branch into trunk
(bzr r1268)
Diffstat (limited to 'src/jabber_whiteboard/message-queue.cpp')
-rw-r--r--src/jabber_whiteboard/message-queue.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/src/jabber_whiteboard/message-queue.cpp b/src/jabber_whiteboard/message-queue.cpp
index 4bd1e9ab1..b2c5d28d4 100644
--- a/src/jabber_whiteboard/message-queue.cpp
+++ b/src/jabber_whiteboard/message-queue.cpp
@@ -22,117 +22,117 @@ namespace Inkscape {
namespace Whiteboard {
-MessageQueue::MessageQueue(SessionManager* sm) : _sm(sm)
-{
-
-}
-
-MessageQueue::~MessageQueue()
-{
-
-}
+//###################################
+//# MESSAGE QUEUE
+//###################################
MessageNode*
MessageQueue::first()
{
- return this->_queue.front();
+ return _queue.front();
}
void
MessageQueue::popFront()
{
- this->_queue.pop_front();
-// g_log(NULL, G_LOG_LEVEL_DEBUG, "Removed element, queue size (for %s): %u", this->_sm->session_data->jid, this->_queue.size());
+ _queue.pop_front();
+ //g_log(NULL, G_LOG_LEVEL_DEBUG,
+ // "Removed element, queue size (for %s): %u",
+ //lm_connection_get_jid(this->_sm->session_data->connection), this->_queue.size());
}
unsigned int
MessageQueue::size()
{
- return this->_queue.size();
+ return _queue.size();
}
bool
MessageQueue::empty()
{
- return this->_queue.empty();
+ return _queue.empty();
}
void
MessageQueue::clear()
{
- this->_queue.clear();
+ _queue.clear();
}
-ReceiveMessageQueue::ReceiveMessageQueue(SessionManager* sm) : MessageQueue(sm), _latest(0)
-{
-}
+//###################################
+//# RECEIVE MESSAGE QUEUE
+//###################################
void
ReceiveMessageQueue::insert(MessageNode* msg)
{
- // Check to see if the incoming message has a sequence number
- // lower than the sequence number of the latest message processed
- // by this message's sender. If it does, drop the message and produce
- // a warning.
- if (msg->sequence() < this->_latest) {
- g_warning("Received late message (message sequence number is %u, but latest processed message had sequence number %u). Discarding message; session may be desynchronized.", msg->sequence(), this->_latest);
- return;
- }
-
- // Otherwise, it is safe to insert this message.
-// Inkscape::GC::anchor(msg);
- this->_queue.push_back(msg);
- sp_desktop_message_stack(this->_sm->desktop())->flashF(Inkscape::NORMAL_MESSAGE,
- ngettext("%u change in receive queue.",
- "%u changes in receive queue.",
- this->_queue.size()),
- this->_queue.size());
-// g_log(NULL, G_LOG_LEVEL_DEBUG, "Receive queue size (for %s): %u", this->_sm->session_data->jid, this->_queue.size());
+ // Check to see if the incoming message has a sequence number
+ // lower than the sequence number of the latest message processed
+ // by this message's sender. If it does, drop the message and produce
+ // a warning.
+ if (msg->sequence() < _latest) {
+ g_warning(_("Received late message (message sequence number is %u, but latest processed message had sequence number %u). Discarding message; session may be desynchronized."), msg->sequence(), this->_latest);
+ return;
+ }
+
+ // Otherwise, it is safe to insert this message.
+ //Inkscape::GC::anchor(msg);
+ _queue.push_back(msg);
+ /*
+ SP_DT_MSGSTACK(_sm->getDesktop())->flashF(
+ Inkscape::NORMAL_MESSAGE,
+ _("%u changes queued in receive queue."),
+ _queue.size());
+ */
+ //g_log(NULL, G_LOG_LEVEL_DEBUG, "Receive queue size (for %s): %u",
+ // lm_connection_get_jid(this->_sm->session_data->connection), this->_queue.size());
}
void
ReceiveMessageQueue::insertDeferred(MessageNode* msg)
{
- this->_deferred.push_back(msg);
+ _deferred.push_back(msg);
}
void
ReceiveMessageQueue::setLatestProcessedPacket(unsigned int seq)
{
- this->_latest = seq;
+ _latest = seq;
}
-SendMessageQueue::SendMessageQueue(SessionManager* sm) : MessageQueue(sm)
-{
-
-}
+//###################################
+//# SEND MESSAGE QUEUE
+//###################################
void
SendMessageQueue::insert(MessageNode* msg)
{
-// Inkscape::GC::anchor(msg);
- this->_queue.push_back(msg);
- sp_desktop_message_stack(this->_sm->desktop())->flashF(Inkscape::NORMAL_MESSAGE,
- ngettext("%u change in send queue.",
- "%u changes in send queue.",
- this->_queue.size()),
- this->_queue.size());
-// g_log(NULL, G_LOG_LEVEL_DEBUG, "Send queue size (for %s): %u", this->_sm->session_data->jid, this->_queue.size());
+ //Inkscape::GC::anchor(msg);
+ _queue.push_back(msg);
+ /*
+ SP_DT_MSGSTACK(_sm->getDesktop())->flashF(
+ Inkscape::NORMAL_MESSAGE,
+ _("%u changes queued in send queue."),
+ _queue.size());
+ */
+ //g_log(NULL, G_LOG_LEVEL_DEBUG, "Send queue size (for %s): %u",
+ // lm_connection_get_jid(this->_sm->session_data->connection),
+ //this->_queue.size());
}
-}
+} // namespace Whiteboard
-}
+} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
- c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ c-file-offsets:((innamespace . 0)(inline-open . 0))
indent-tabs-mode:nil
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :