[ekiga] Made arrangements to the loudmouth message handling code, to make room for a future MUC implementati



commit b73f06ab72620d4c8a0416be43581933a64c4061
Author: Julien Puydt <jpuydt newton localdomain>
Date:   Wed Sep 14 13:31:08 2011 +0200

    Made arrangements to the loudmouth message handling code, to make room for a future MUC implementation

 plugins/loudmouth/loudmouth-heap.cpp |   37 +++++++++++++++++++++++++++++++++-
 plugins/loudmouth/loudmouth-heap.h   |    9 ++++++++
 2 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/plugins/loudmouth/loudmouth-heap.cpp b/plugins/loudmouth/loudmouth-heap.cpp
index cd32ee4..382ec6b 100644
--- a/plugins/loudmouth/loudmouth-heap.cpp
+++ b/plugins/loudmouth/loudmouth-heap.cpp
@@ -157,6 +157,18 @@ LM::Heap::disconnected ()
 LmHandlerResult
 LM::Heap::iq_handler (LmMessage* message)
 {
+  return iq_handler_roster (message);
+}
+
+LmHandlerResult
+LM::Heap::iq_handler_muc (LmMessage* message)
+{
+  return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; // FIXME: implement properly
+}
+
+LmHandlerResult
+LM::Heap::iq_handler_roster (LmMessage* message)
+{
   if (lm_message_get_sub_type (message) == LM_MESSAGE_SUB_TYPE_SET
       || lm_message_get_sub_type (message) == LM_MESSAGE_SUB_TYPE_RESULT) {
 
@@ -174,10 +186,21 @@ LM::Heap::iq_handler (LmMessage* message)
   return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
 }
 
-
 LmHandlerResult
 LM::Heap::presence_handler (LmMessage* message)
 {
+  return presence_handler_roster (message);
+}
+
+LmHandlerResult
+LM::Heap::presence_handler_muc (LmMessage* message)
+{
+  return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; // FIXME: implement properly
+}
+
+LmHandlerResult
+LM::Heap::presence_handler_roster (LmMessage* message)
+{
   const gchar* from_c = lm_message_node_get_attribute (lm_message_get_node (message), "from");
   const gchar* type_attr = lm_message_node_get_attribute (lm_message_get_node (message), "type");
   std::string base_jid;
@@ -245,6 +268,18 @@ LM::Heap::presence_handler (LmMessage* message)
 LmHandlerResult
 LM::Heap::message_handler (LmMessage* message)
 {
+  return message_handler_roster (message);
+}
+
+LmHandlerResult
+LM::Heap::message_handler_muc (LmMessage* message)
+{
+  return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; // FIXME: implement properly
+}
+
+LmHandlerResult
+LM::Heap::message_handler_roster (LmMessage* message)
+{
   LmMessageNode* node = lm_message_get_node (message);
   const gchar* from_c = lm_message_node_get_attribute (node, "from");
   const gchar* type_attr = lm_message_node_get_attribute (node, "type");
diff --git a/plugins/loudmouth/loudmouth-heap.h b/plugins/loudmouth/loudmouth-heap.h
index 5a7488e..34c9f2b 100644
--- a/plugins/loudmouth/loudmouth-heap.h
+++ b/plugins/loudmouth/loudmouth-heap.h
@@ -106,6 +106,15 @@ namespace LM
     void on_personal_details_updated ();
 
     void on_chat_requested (PresentityPtr presentity);
+
+    LmHandlerResult iq_handler_roster (LmMessage* message);
+    LmHandlerResult iq_handler_muc (LmMessage* message);
+
+    LmHandlerResult presence_handler_roster (LmMessage* message);
+    LmHandlerResult presence_handler_muc (LmMessage* message);
+
+    LmHandlerResult message_handler_roster (LmMessage* message);
+    LmHandlerResult message_handler_muc (LmMessage* message);
   };
 
   typedef boost::shared_ptr<Heap> HeapPtr;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]