[ekiga] Handle the presence unavailable messages in the loudmouth code



commit ac96f53eab3e5f5f0c3aef041c156ccf97dd2dff
Author: Julien Puydt <jpuydt gnome org>
Date:   Mon Sep 21 01:03:19 2009 +0200

    Handle the presence unavailable messages in the loudmouth code
    
    Now they're recognized as such, so things look better :-)

 plugins/loudmouth/loudmouth-presentity.cpp |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/plugins/loudmouth/loudmouth-presentity.cpp b/plugins/loudmouth/loudmouth-presentity.cpp
index 0aede34..237da91 100644
--- a/plugins/loudmouth/loudmouth-presentity.cpp
+++ b/plugins/loudmouth/loudmouth-presentity.cpp
@@ -244,6 +244,16 @@ LM::Presentity::push_presence (const std::string resource,
     info.presence = "online";
   }
 
+  // FIXME: this code works but is ugly -- there has to be a better way
+  const gchar* oftype = lm_message_node_get_attribute (presence, "type");
+  if (oftype != NULL) {
+
+    if (oftype == std::string ("unavailable")) {
+
+      info.presence = "unavailable";
+    }
+  }
+
   infos[resource] = info;
 
   if (info.presence == "unavailable") {



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