soylent r293 - trunk/libsoylent



Author: svenp
Date: Mon Aug 18 12:52:47 2008
New Revision: 293
URL: http://svn.gnome.org/viewvc/soylent?rev=293&view=rev

Log:
fixed: SlPerson get_string checks for NULL nick (was segfault)
added stubs for communicate call / email

Modified:
   trunk/libsoylent/sl-book.c
   trunk/libsoylent/sl-entity-eds.c
   trunk/libsoylent/sl-person.c
   trunk/libsoylent/sl-person.h
   trunk/libsoylent/sl-priv-util.h

Modified: trunk/libsoylent/sl-book.c
==============================================================================
--- trunk/libsoylent/sl-book.c	(original)
+++ trunk/libsoylent/sl-book.c	Mon Aug 18 12:52:47 2008
@@ -601,6 +601,9 @@
 void
 sl_book_emit_person_presence_changed (SlBook *self, SlPerson *person)
 {
+  g_return_if_fail (self != NULL && SL_IS_BOOK (self));
+  g_return_if_fail (person != NULL && SL_IS_PERSON (person));
+
   g_signal_emit_by_name (self, "person-presence-changed", person);
 }
 

Modified: trunk/libsoylent/sl-entity-eds.c
==============================================================================
--- trunk/libsoylent/sl-entity-eds.c	(original)
+++ trunk/libsoylent/sl-entity-eds.c	Mon Aug 18 12:52:47 2008
@@ -608,7 +608,7 @@
       imcontacts_iter = imcontacts_iter->next;
       self->priv->presence = empathy_contact_get_presence (imcontact);
     }
-  
+
   for (; imcontacts_iter != NULL; imcontacts_iter = imcontacts_iter->next)
     {
       McPresence presence = MC_PRESENCE_UNSET;
@@ -621,7 +621,7 @@
           self->priv->presence = presence;
         }
     }
-  
+
   if (old_presence != self->priv->presence)
     {
       sl_debug_entity ("presence %d -> %d", sl_priv_util_presence_to_gint (old_presence),

Modified: trunk/libsoylent/sl-person.c
==============================================================================
--- trunk/libsoylent/sl-person.c	(original)
+++ trunk/libsoylent/sl-person.c	Mon Aug 18 12:52:47 2008
@@ -245,7 +245,7 @@
 sl_person_get_string (SlPerson *self)
 {
   gchar *nick = sl_person_get_nick (self);
-  if (g_str_equal (nick, ""))
+  if (nick == NULL || g_str_equal (nick, ""))
     {
       return "?";
     }
@@ -382,6 +382,20 @@
 
 }
 
+gboolean
+sl_person_communicate_call (SlPerson *self, SlCall call_type, GError **error)
+{
+  g_warning ("%s not yet implemented", __FUNCTION__);
+  return FALSE;
+}
+
+gboolean
+sl_person_communicate_email (SlPerson *self, GError **error)
+{
+  g_warning ("%s not yet implemented", __FUNCTION__);
+  return FALSE;
+}
+
 static void
 mc_chat_ready (MissionControl *mc, GError *error, SlPerson *self)
 {

Modified: trunk/libsoylent/sl-person.h
==============================================================================
--- trunk/libsoylent/sl-person.h	(original)
+++ trunk/libsoylent/sl-person.h	Mon Aug 18 12:52:47 2008
@@ -193,13 +193,68 @@
 #define SL_ATTR_JOB_ROLE      "job-role"
 #define SL_ATTR_JOB_TITLE     "job-title"
 
-/*#define EVC_X_AIM              "X-AIM"
-#define EVC_X_GADUGADU        "X-GADUGADU"
-#define EVC_X_ICQ              "X-ICQ"
-#define EVC_X_JABBER           "X-JABBER"
-#define EVC_X_MSN           	"X-MSN"
-#define EVC_X_YAHOO         	"X-YAHOO"
-#define EVC_X_GROUPWISE     	"X-GROUPWISE"*/
+/**
+ * SL_ATTR_AIM:
+ *
+ * An AIM-id of a person.
+ *
+ * type: <type>string</type>
+ */
+#define SL_ATTR_AIM "aim"
+
+/**
+ * SL_ATTR_GADUGADU:
+ *
+ * A GaduGadu-id of a person.
+ *
+ * type: <type>string</type>
+ */
+#define SL_ATTR_GADUGADU "gadugadu"
+
+/**
+ * SL_ATTR_ICQ:
+ *
+ * An ICQ-id of a person.
+ *
+ * type: <type>string</type>
+ */
+#define SL_ATTR_ICQ "icq"
+
+/**
+ * SL_ATTR_JABBER:
+ *
+ * A Jabber-id of a person.
+ *
+ * type: <type>string</type>
+ */
+#define SL_ATTR_JABBER "jabber"
+
+/**
+ * SL_ATTR_MSN:
+ *
+ * A MSN-id of a person.
+ *
+ * type: <type>string</type>
+ */
+#define SL_ATTR_MSN "msn"
+
+/**
+ * SL_ATTR_YAHOO:
+ *
+ * A Yahoo-id of a person.
+ *
+ * type: <type>string</type>
+ */
+#define SL_ATTR_YAHOO "yahoo"
+
+/**
+ * SL_ATTR_GROUPWISE:
+ *
+ * A Groupwise-id of a person.
+ *
+ * type: <type>string</type>
+ */
+#define SL_ATTR_GROUPWISE "groupwise"
 
 /*#define EVC_GEO		    "GEO"*/
 /*#define EVC_ICSCALENDAR     "ICSCALENDAR"*/
@@ -284,7 +339,16 @@
   (sl_entity_modified (SL_ENTITY (self), attrname))
 #define sl_person_modified_at(self, attrname, index) \
   (sl_entity_modified_at (SL_ENTITY (self), attrname, index))
-  
+
+#define sl_person_has_iminfo(self) \
+  (sl_entity_has_iminfo (SL_ENTITY (self)))
+#define sl_person_is_online(self) \
+  (sl_entity_is_online (SL_ENTITY (self)))
+#define sl_person_get_presence(self) \
+  (sl_entity_get_presence (SL_ENTITY (self)))
+#define sl_person_get_imcontacts(self) \
+  (sl_entity_get_imcontacts (SL_ENTITY (self)))
+
 #define SL_PERSON_COMMUNICATION_CHAT_CB(cb) ((SlPersonCommunicateChatCb) cb)
 
 typedef void (*SlPersonCommunicateChatCb) (SlPerson *person, GError *error,
@@ -373,4 +437,7 @@
 void sl_person_communicate_chat_from_async (SlPerson *self, const gchar *from_id, SlPersonCommunicateChatCb callback, gpointer user_data);
 void sl_person_launch_chat (SlPerson *self, EmpathyContact *imcontact);
 
+gboolean sl_person_communicate_call (SlPerson *self, SlCall call_type, GError **error);
+gboolean sl_person_communicate_email (SlPerson *self, GError **error);
+
 #endif

Modified: trunk/libsoylent/sl-priv-util.h
==============================================================================
--- trunk/libsoylent/sl-priv-util.h	(original)
+++ trunk/libsoylent/sl-priv-util.h	Mon Aug 18 12:52:47 2008
@@ -28,7 +28,6 @@
 #include <libempathy/empathy-contact.h>
 
 /*#define SL_ENABLE_DEBUG_ALL*/
-#define SL_ENABLE_DEBUG_BOOK
 
 #define sl_debug(unit, format, ...) g_printerr ("dbg[%s]: ", unit); \
                                     g_printerr (format, __VA_ARGS__); \



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