gossip r2860 - in trunk: . libgossip src



Author: mr
Date: Sat Nov 29 18:01:32 2008
New Revision: 2860
URL: http://svn.gnome.org/viewvc/gossip?rev=2860&view=rev

Log:
	* libgossip/gossip-contact-manager.c:
	* libgossip/gossip-contact.[ch]:
	* libgossip/gossip-jabber-utils.[ch]:
	* libgossip/gossip-jabber.c: 
	* libgossip/gossip-jid.[ch]: 
	* libgossip/gossip-log.c:
	* src/gossip-chat-manager.c: 
	* src/gossip-contact-info-dialog.c:
	* src/gossip-contact-list.c: 
	* src/gossip-edit-contact-dialog.c:
	* src/gossip-ft-dialog.c:
	* src/gossip-group-chat.c:
	* src/gossip-notify.c:
	* src/gossip-private-chat.c:
	* src/gossip-subscription-dialog.c: Added
	gossip_contact_get_display_id() and added backend functions to
	escape and unescape Jabber IDs according to XEP-0106: JID
	Escaping. This means that now in the UI we show "foo hotmail com"
	instead of addresses like "foo\40hotmail com msn jabber org".


Modified:
   trunk/ChangeLog
   trunk/libgossip/gossip-contact-manager.c
   trunk/libgossip/gossip-contact.c
   trunk/libgossip/gossip-contact.h
   trunk/libgossip/gossip-jabber-utils.c
   trunk/libgossip/gossip-jabber-utils.h
   trunk/libgossip/gossip-jabber.c
   trunk/libgossip/gossip-jid.c
   trunk/libgossip/gossip-jid.h
   trunk/libgossip/gossip-log.c
   trunk/src/gossip-chat-manager.c
   trunk/src/gossip-contact-info-dialog.c
   trunk/src/gossip-contact-list.c
   trunk/src/gossip-edit-contact-dialog.c
   trunk/src/gossip-ft-dialog.c
   trunk/src/gossip-group-chat.c
   trunk/src/gossip-notify.c
   trunk/src/gossip-private-chat.c
   trunk/src/gossip-subscription-dialog.c

Modified: trunk/libgossip/gossip-contact-manager.c
==============================================================================
--- trunk/libgossip/gossip-contact-manager.c	(original)
+++ trunk/libgossip/gossip-contact-manager.c	Sat Nov 29 18:01:32 2008
@@ -350,19 +350,25 @@
 
 		return contact;
 	} else {
+		gchar *display_id;
 		gchar *name;
 
+		display_id = gossip_jabber_get_display_id (contact_id);
+		name = gossip_jabber_get_name_to_use (contact_id, NULL, NULL, NULL);
+
 		gossip_debug (DEBUG_DOMAIN,
-			      "New contact:'%s' (%s)",
+			      "New contact:'%s' (%s), display ID:'%s'",
 			      contact_id,
-			      gossip_contact_type_to_string (contact_type));
-
-		name = gossip_jabber_get_name_to_use (contact_id, NULL, NULL, NULL);
+			      gossip_contact_type_to_string (contact_type),
+			      display_id);
 
 		/* Create the contact using a default name as the ID */
 		contact = gossip_contact_new (contact_type, account);
 		gossip_contact_set_id (contact, contact_id);
+		gossip_contact_set_display_id (contact, display_id);
 		gossip_contact_set_name (contact, name);
+
+		g_free (display_id);
 		g_free (name);
 
 		gossip_contact_manager_add (manager, contact);

Modified: trunk/libgossip/gossip-contact.c
==============================================================================
--- trunk/libgossip/gossip-contact.c	(original)
+++ trunk/libgossip/gossip-contact.c	Sat Nov 29 18:01:32 2008
@@ -39,6 +39,7 @@
 	GossipContactType   type;
 
 	gchar              *id;
+	gchar              *display_id;
 	gchar              *name;
 
 	GList              *presences;
@@ -68,6 +69,7 @@
 	PROP_TYPE,
 	PROP_NAME,
 	PROP_ID,
+	PROP_DISPLAY_ID,
 	PROP_PRESENCES,
 	PROP_GROUPS,
 	PROP_SUBSCRIPTION,
@@ -133,29 +135,32 @@
 							      "The name of the contact",
 							      NULL,
 							      G_PARAM_READWRITE));
-
 	g_object_class_install_property (object_class,
 					 PROP_ID,
 					 g_param_spec_string ("id",
 							      "Contact id",
-							      "String identifying contact",
+							      "String identifying the Jabber ID",
+							      NULL,
+							      G_PARAM_READWRITE));
+	g_object_class_install_property (object_class,
+					 PROP_DISPLAY_ID,
+					 g_param_spec_string ("display-id",
+							      "Display id",
+							      "String identifying the REAL ID",
 							      NULL,
 							      G_PARAM_READWRITE));
-
 	g_object_class_install_property (object_class,
 					 PROP_PRESENCES,
 					 g_param_spec_pointer ("presences",
 							       "Contact presences",
 							       "Presences of contact",
 							       G_PARAM_READWRITE));
-
 	g_object_class_install_property (object_class,
 					 PROP_GROUPS,
 					 g_param_spec_pointer ("groups",
 							       "Contact groups",
 							       "Groups of contact",
 							       G_PARAM_READWRITE));
-
 	g_object_class_install_property (object_class,
 					 PROP_SUBSCRIPTION,
 					 g_param_spec_int ("subscription",
@@ -165,7 +170,6 @@
 							   GOSSIP_SUBSCRIPTION_BOTH,
 							   GOSSIP_SUBSCRIPTION_NONE,
 							   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
 	g_object_class_install_property (object_class,
 					 PROP_AVATAR,
 					 g_param_spec_boxed ("avatar",
@@ -173,7 +177,6 @@
 							     "The avatar image",
 							     GOSSIP_TYPE_AVATAR,
 							     G_PARAM_READWRITE));
-
 	g_object_class_install_property (object_class,
 					 PROP_ACCOUNT,
 					 g_param_spec_object ("account",
@@ -205,6 +208,7 @@
 	priv = GOSSIP_CONTACT_GET_PRIVATE (object);
 
 	g_free (priv->name);
+	g_free (priv->display_id);
 	g_free (priv->id);
 
 	if (priv->avatar) {
@@ -255,6 +259,9 @@
 	case PROP_ID:
 		g_value_set_string (value, priv->id);
 		break;
+	case PROP_DISPLAY_ID:
+		g_value_set_string (value, priv->display_id);
+		break;
 	case PROP_PRESENCES:
 		g_value_set_pointer (value, priv->presences);
 		break;
@@ -302,6 +309,10 @@
 		gossip_contact_set_id (GOSSIP_CONTACT (object),
 				       g_value_get_string (value));
 		break;
+	case PROP_DISPLAY_ID:
+		gossip_contact_set_display_id (GOSSIP_CONTACT (object),
+					       g_value_get_string (value));
+		break;
 	case PROP_PRESENCES:
 		gossip_contact_set_presence_list (GOSSIP_CONTACT (object),
 						  g_value_get_pointer (value));
@@ -346,6 +357,7 @@
 gossip_contact_new_full (GossipContactType  type,
 			 GossipAccount     *account,
 			 const gchar       *id,
+			 const gchar       *display_id,
 			 const gchar       *name)
 {
 	return g_object_new (GOSSIP_TYPE_CONTACT,
@@ -353,6 +365,7 @@
 			     "account", account,
 			     "name", name,
 			     "id", id,
+			     "display-id", display_id,
 			     NULL);
 }
 
@@ -369,6 +382,7 @@
 	new_contact = gossip_contact_new_full (gossip_contact_get_type (contact),
 					       priv->account,
 					       priv->id,
+					       priv->display_id,
 					       priv->name);
 
 	gossip_contact_set_subscription (new_contact, priv->subscription);
@@ -409,6 +423,22 @@
 }
 
 const gchar *
+gossip_contact_get_display_id (GossipContact *contact)
+{
+	GossipContactPrivate *priv;
+
+	g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), "");
+
+	priv = GOSSIP_CONTACT_GET_PRIVATE (contact);
+
+	if (priv->display_id) {
+		return priv->display_id;
+	}
+
+	return "";
+}
+
+const gchar *
 gossip_contact_get_name (GossipContact *contact)
 {
 	GossipContactPrivate *priv;
@@ -610,6 +640,23 @@
 }
 
 void
+gossip_contact_set_display_id (GossipContact *contact,
+			       const gchar   *display_id)
+{
+	GossipContactPrivate *priv;
+
+	g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+	g_return_if_fail (display_id != NULL);
+
+	priv = GOSSIP_CONTACT_GET_PRIVATE (contact);
+
+	g_free (priv->display_id);
+	priv->display_id = g_strdup (display_id);
+
+	g_object_notify (G_OBJECT (contact), "display-id");
+}
+
+void
 gossip_contact_set_name (GossipContact *contact,
 			 const gchar   *name)
 {

Modified: trunk/libgossip/gossip-contact.h
==============================================================================
--- trunk/libgossip/gossip-contact.h	(original)
+++ trunk/libgossip/gossip-contact.h	Sat Nov 29 18:01:32 2008
@@ -70,11 +70,13 @@
 GossipContact *    gossip_contact_new_full                  (GossipContactType   type,
 							     GossipAccount      *account,
 							     const gchar        *id,
+							     const gchar        *display_id,
 							     const gchar        *name);
 GossipContact *    gossip_contact_copy                      (GossipContact      *contact);
 
 GossipContactType  gossip_contact_get_type                  (GossipContact      *contact);
 const gchar *      gossip_contact_get_id                    (GossipContact      *contact);
+const gchar *      gossip_contact_get_display_id            (GossipContact      *contact);
 const gchar *      gossip_contact_get_name                  (GossipContact      *contact);
 GossipAvatar *     gossip_contact_get_avatar                (GossipContact      *contact);
 GdkPixbuf *        gossip_contact_get_avatar_pixbuf         (GossipContact      *contact);
@@ -87,6 +89,8 @@
 							     GossipContactType   type);
 void               gossip_contact_set_id                    (GossipContact      *contact,
 							     const gchar        *id);
+void               gossip_contact_set_display_id            (GossipContact      *contact,
+							     const gchar        *display_id);
 void               gossip_contact_set_name                  (GossipContact      *contact,
 							     const gchar        *name);
 void               gossip_contact_set_avatar                (GossipContact      *contact,

Modified: trunk/libgossip/gossip-jabber-utils.c
==============================================================================
--- trunk/libgossip/gossip-jabber-utils.c	(original)
+++ trunk/libgossip/gossip-jabber-utils.c	Sat Nov 29 18:01:32 2008
@@ -394,6 +394,46 @@
 	return g_strdup ("");
 }
 
+gchar *
+gossip_jabber_get_display_id (const gchar *jid_str)
+{
+	gchar *unescaped;
+	gchar *at;
+
+	/* For more information about this,
+	 * see XEP-0106: JID Escaping. 
+	 */
+	
+	if (G_STR_EMPTY (jid_str)) {
+		return g_strdup (jid_str);
+	}
+
+	unescaped = gossip_jid_string_unescape (jid_str);
+	
+	/* Find first '@' */
+	at = strchr (unescaped, '@');
+
+	if (!at) {
+		return unescaped;
+	}
+
+	/* If we find another '@', it is likely the ID is something
+	 * like "martyn hotmail com@msn.jabber.org". In this case, we
+	 * drop anything after the second '@'. 
+	 *
+	 * This feels like a hack, not sure if there is a better way
+	 * round it. I thought you could query the service itself for
+	 * this stuff - msn.jabber.org for example.
+	 */
+	at = strchr (at + 1, '@');
+	
+	if (at) {	
+		*at = '\0';
+	}
+
+	return unescaped;
+}
+
 GError *
 gossip_jabber_error_create (GossipJabberError  code,
 			    const gchar       *reason)
@@ -469,3 +509,4 @@
 
 	return str;
 }
+

Modified: trunk/libgossip/gossip-jabber-utils.h
==============================================================================
--- trunk/libgossip/gossip-jabber-utils.h	(original)
+++ trunk/libgossip/gossip-jabber-utils.h	Sat Nov 29 18:01:32 2008
@@ -77,6 +77,7 @@
 								  const gchar            *nickname,
 								  const gchar            *full_name,
 								  const gchar            *current_name);
+gchar *                gossip_jabber_get_display_id              (const gchar            *jid_str);
 
 /* Error utils */
 GError *               gossip_jabber_error_create                (GossipJabberError       code,

Modified: trunk/libgossip/gossip-jabber.c
==============================================================================
--- trunk/libgossip/gossip-jabber.c	(original)
+++ trunk/libgossip/gossip-jabber.c	Sat Nov 29 18:01:32 2008
@@ -184,13 +184,13 @@
 							     LmConnection               *connection,
 							     LmMessage                  *m,
 							     GossipJabber               *jabber);
-static void             jabber_request_version              (GossipJabber               *jabber,
+static void             jabber_request_for_version          (GossipJabber               *jabber,
 							     LmMessage                  *m);
-static void             jabber_request_ping                 (GossipJabber               *jabber,
+static void             jabber_request_for_ping             (GossipJabber               *jabber,
 							     LmMessage                  *m);
-static void             jabber_request_roster               (GossipJabber               *jabber,
+static void             jabber_request_for_roster           (GossipJabber               *jabber,
 							     LmMessage                  *m);
-static void             jabber_request_unknown              (GossipJabber               *jabber,
+static void             jabber_request_for_unknown          (GossipJabber               *jabber,
 							     LmMessage                  *m);
 
 /* Chatrooms */
@@ -2521,7 +2521,7 @@
 	if (node) {
 		xmlns = lm_message_node_get_attribute (node, "xmlns");
 		if (xmlns && strcmp (xmlns, XMPP_PING_XMLNS) == 0) {
-			jabber_request_ping (jabber, m);
+			jabber_request_for_ping (jabber, m);
 			return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
 		}	
 	}
@@ -2533,7 +2533,7 @@
 
 	xmlns = lm_message_node_get_attribute (node, "xmlns");
 	if (xmlns && strcmp (xmlns, XMPP_ROSTER_XMLNS) == 0) {
-		jabber_request_roster (jabber, m);
+		jabber_request_for_roster (jabber, m);
 		return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
 	}
 
@@ -2543,14 +2543,14 @@
 	}
 
 	if (xmlns && strcmp (xmlns, XMPP_VERSION_XMLNS) == 0) {
-		jabber_request_version (jabber, m);
+		jabber_request_for_version (jabber, m);
 		return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
 	}
 
 	/* If a get, return error for unsupported IQ */
 	if (lm_message_get_sub_type (m) == LM_MESSAGE_SUB_TYPE_GET ||
 	    lm_message_get_sub_type (m) == LM_MESSAGE_SUB_TYPE_SET) {
-		jabber_request_unknown (jabber, m);
+		jabber_request_for_unknown (jabber, m);
 		return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
 	}
 
@@ -2611,8 +2611,8 @@
  * Requests
  */
 static void
-jabber_request_version (GossipJabber *jabber,
-			LmMessage    *m)
+jabber_request_for_version (GossipJabber *jabber,
+			    LmMessage    *m)
 {
 	GossipJabberPrivate  *priv;
 	LmMessage         *r;
@@ -2665,7 +2665,8 @@
 }
 
 static void
-jabber_request_ping (GossipJabber *jabber, LmMessage *m)
+jabber_request_for_ping (GossipJabber *jabber, 
+			 LmMessage    *m)
 {
 	GossipJabberPrivate *priv;
 	LmMessage        *reply;
@@ -2693,8 +2694,8 @@
 }
 
 static void
-jabber_request_roster (GossipJabber *jabber,
-		       LmMessage    *m)
+jabber_request_for_roster (GossipJabber *jabber,
+			   LmMessage    *m)
 {
 	GossipJabberPrivate *priv;
 	LmMessageNode    *node;
@@ -2709,18 +2710,20 @@
 	for (node = node->children; node; node = node->next) {
 		GossipContact     *contact;
 		GossipContactType  type;
-		const gchar       *jid_str;
 		const gchar       *subscription;
 		gboolean           added_item = FALSE;
 		LmMessageNode     *child;
 		GList             *groups;
 		const gchar       *name;
+		const gchar       *jid_str;
 
 		if (strcmp (node->name, "item") != 0) {
 			continue;
 		}
 
+		/* This is before it has been converted */
 		jid_str = lm_message_node_get_attribute (node, "jid");
+
 		if (!jid_str) {
 			continue;
 		}
@@ -2812,8 +2815,8 @@
 }
 
 static void
-jabber_request_unknown (GossipJabber *jabber,
-			LmMessage    *m)
+jabber_request_for_unknown (GossipJabber *jabber,
+			    LmMessage    *m)
 {
 	GossipJabberPrivate *priv;
 	LmMessageNode    *node;

Modified: trunk/libgossip/gossip-jid.c
==============================================================================
--- trunk/libgossip/gossip-jid.c	(original)
+++ trunk/libgossip/gossip-jid.c	Sat Nov 29 18:01:32 2008
@@ -511,6 +511,143 @@
 	return NULL;
 }
 
+gchar *                
+gossip_jid_string_escape (const gchar *jid_str)
+{
+	GString *s;
+	gchar    c;
+
+	/* Conversions are:
+	 *
+	 *   <space>  \20 *
+	 *   "	      \22
+	 *   &	      \26
+	 *   '	      \27
+	 *   /	      \2f
+	 *   :	      \3a
+	 *   <	      \3c
+	 *   >	      \3e
+	 *   @	      \40
+	 *   \	      \5c
+	 */
+	
+	if (!jid_str) {
+		return NULL;
+	}
+	
+	s = g_string_new_len ("", strlen (jid_str) + 1);
+	
+	while ((c = *jid_str++)) {
+		switch (c) {
+		case ' ':
+			s = g_string_append (s, "\20");
+			break;
+		case '"':
+			s = g_string_append (s, "\22");
+			break;
+		case '&':
+			s = g_string_append (s, "\26");
+			break;
+		case '\'':
+			s = g_string_append (s, "\27");
+			break;
+		case '/':
+			s = g_string_append (s, "\2f");
+			break;
+		case ':':
+			s = g_string_append (s, "\3a");
+			break;
+		case '<':
+			s = g_string_append (s, "\3c");
+			break;
+		case '>':
+			s = g_string_append (s, "\3e");
+			break;
+		case '@':
+			s = g_string_append (s, "\40");
+			break;
+		case '\\':
+			s = g_string_append (s, "\5c");
+			break;
+		default:
+			s = g_string_append_c (s, c);
+			break;
+		}
+
+	}
+	
+	return g_string_free (s, FALSE);
+}
+
+gchar *                
+gossip_jid_string_unescape (const gchar *jid_str)
+{
+	gchar *text, *p, c;
+
+	/* Conversions are:
+	 *
+	 *   <space>  \20 *
+	 *   "	      \22
+	 *   &	      \26
+	 *   '	      \27
+	 *   /	      \2f
+	 *   :	      \3a
+	 *   <	      \3c
+	 *   >	      \3e
+	 *   @	      \40
+	 *   \	      \5c
+	 */
+	
+	if (!jid_str) {
+		return NULL;
+	}
+	
+	p = text = g_malloc (strlen (jid_str) + 1);
+	
+	while ((c = *jid_str++)) {
+		if (G_LIKELY (c != '\\')) {
+			*p++ = c;
+			continue;
+		}
+
+		if (!memcmp (jid_str, "20", 2)) {
+			*p++ = ' ';
+			jid_str += 2;
+		} else if (!memcmp (jid_str, "22", 2)) {
+			*p++ = '"';
+			jid_str += 2;
+		} else if (!memcmp (jid_str, "26", 2)) {
+			*p++ = '&';
+			jid_str += 2;
+		} else if (!memcmp (jid_str, "27", 2)) {
+			*p++ = '\'';
+			jid_str += 2;
+		} else if (!memcmp (jid_str, "2f", 2)) {
+			*p++ = '/';
+			jid_str += 2;
+		} else if (!memcmp (jid_str, "3a", 2)) {
+			*p++ = ':';
+			jid_str += 2;
+		} else if (!memcmp (jid_str, "3c", 2)) {
+			*p++ = '<';
+			jid_str += 2;
+		} else if (!memcmp (jid_str, "3e", 2)) {
+			*p++ = '>';
+			jid_str += 2;
+		} else if (!memcmp (jid_str, "40", 2)) {
+			*p++ = '@';
+			jid_str += 2;
+		} else if (!memcmp (jid_str, "5c", 2)) {
+			*p++ = '\\';
+			jid_str += 2;
+		}
+	}
+
+	*p = 0;
+	
+	return text;
+}
+
 gint
 gossip_jid_case_compare (gconstpointer a,
 			 gconstpointer b)
@@ -604,4 +741,3 @@
 {
 	return "user jabber org";
 }
-

Modified: trunk/libgossip/gossip-jid.h
==============================================================================
--- trunk/libgossip/gossip-jid.h	(original)
+++ trunk/libgossip/gossip-jid.h	Sat Nov 29 18:01:32 2008
@@ -69,6 +69,8 @@
 gchar *      gossip_jid_string_get_part_name     (const gchar   *str);
 gchar *      gossip_jid_string_get_part_host     (const gchar   *str);
 const gchar *gossip_jid_string_get_part_resource (const gchar   *str);
+gchar *      gossip_jid_string_escape            (const gchar   *jid_str);
+gchar *      gossip_jid_string_unescape          (const gchar   *jid_str);
 
 gint         gossip_jid_case_compare             (gconstpointer  a,
 						  gconstpointer  b);

Modified: trunk/libgossip/gossip-log.c
==============================================================================
--- trunk/libgossip/gossip-log.c	(original)
+++ trunk/libgossip/gossip-log.c	Sat Nov 29 18:01:32 2008
@@ -2145,6 +2145,7 @@
 		gchar          *time;
 		GossipTime      t;
 		gchar          *who;
+		gchar          *who_display;
 		gchar          *name;
 		gchar          *body;
 
@@ -2157,6 +2158,13 @@
 			continue;
 		}
 
+		who_display = xmlGetProp (node, "from-display");
+		if (!who_display) {
+			gossip_debug (DEBUG_DOMAIN, 
+				      "Couldn't find display name for '%s'",
+				      who);
+		}
+
 		name = xmlGetProp (node, "nick");
 		if (!name) {
 			g_free (who);
@@ -2170,7 +2178,9 @@
 		
 		contact = gossip_contact_new_full (GOSSIP_CONTACT_TYPE_CHATROOM,
 						   gossip_chatroom_get_account (chatroom),
-						   who, name);
+						   who, 
+						   who_display,
+						   name);
 
 		message = gossip_message_new (GOSSIP_MESSAGE_TYPE_CHAT_ROOM,
 					      own_contact);
@@ -2185,6 +2195,7 @@
 
 		xmlFree (time);
 		xmlFree (who);
+		xmlFree (who_display);
 		xmlFree (name);
 		xmlFree (body);
 	}

Modified: trunk/src/gossip-chat-manager.c
==============================================================================
--- trunk/src/gossip-chat-manager.c	(original)
+++ trunk/src/gossip-chat-manager.c	Sat Nov 29 18:01:32 2008
@@ -126,7 +126,8 @@
 
 	/* Add event to event manager if one doesn't exist already. */
 	if (!chat) {
-		gossip_debug (DEBUG_DOMAIN, "New chat for: %s",
+		gossip_debug (DEBUG_DOMAIN, 
+			      "New chat for: %s",
 			      gossip_contact_get_id (sender));
 		chat = gossip_chat_manager_get_chat (manager, sender);
 

Modified: trunk/src/gossip-contact-info-dialog.c
==============================================================================
--- trunk/src/gossip-contact-info-dialog.c	(original)
+++ trunk/src/gossip-contact-info-dialog.c	Sat Nov 29 18:01:32 2008
@@ -604,7 +604,7 @@
 
 	/* Set labels */
 	gtk_label_set_text (GTK_LABEL (dialog->id_label),
-			    gossip_contact_get_id (contact));
+			    gossip_contact_get_display_id (contact));
 
 	gtk_label_set_text (GTK_LABEL (dialog->name_label),
 			    gossip_contact_get_name (contact));

Modified: trunk/src/gossip-contact-list.c
==============================================================================
--- trunk/src/gossip-contact-list.c	(original)
+++ trunk/src/gossip-contact-list.c	Sat Nov 29 18:01:32 2008
@@ -3233,7 +3233,7 @@
 				       "%s\n",
 				       _("Do you want to remove this contact from your roster?"),
 				       gossip_contact_get_name (contact),
-				       gossip_contact_get_id (contact));
+				       gossip_contact_get_display_id (contact));
 	gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), str);
 	g_free (str);
 

Modified: trunk/src/gossip-edit-contact-dialog.c
==============================================================================
--- trunk/src/gossip-edit-contact-dialog.c	(original)
+++ trunk/src/gossip-edit-contact-dialog.c	Sat Nov 29 18:01:32 2008
@@ -715,7 +715,7 @@
 					 "<b>%s</b>\n"
 					 "\n"
 					 "You can retrieve contact information from the server."),
-				       gossip_contact_get_id (contact));
+				       gossip_contact_get_display_id (contact));
 	gtk_label_set_markup (GTK_LABEL (dialog->label_name), str);
 	g_free (str);
 

Modified: trunk/src/gossip-ft-dialog.c
==============================================================================
--- trunk/src/gossip-ft-dialog.c	(original)
+++ trunk/src/gossip-ft-dialog.c	Sat Nov 29 18:01:32 2008
@@ -593,8 +593,8 @@
 	gtk_size_group_add_widget (size_group, label_location_stub);
 	g_object_unref (size_group);
 
-	gtk_label_set_text (GTK_LABEL (label_id), gossip_contact_get_id (contact));
-
+	gtk_label_set_text (GTK_LABEL (label_id), 
+			    gossip_contact_get_display_id (contact));
 
 	if (gossip_ft_get_type (dialog->ft) == GOSSIP_FT_TYPE_RECEIVING) {
 		if (name) {

Modified: trunk/src/gossip-group-chat.c
==============================================================================
--- trunk/src/gossip-group-chat.c	(original)
+++ trunk/src/gossip-group-chat.c	Sat Nov 29 18:01:32 2008
@@ -918,7 +918,7 @@
 		
 		/* Send event to chat window */
 		str = g_strdup_printf (_("Invited %s to join this chat conference."),
-				       gossip_contact_get_id (contact));
+				       gossip_contact_get_name (contact));
 
 		group_chat_set_scrolling_for_events (chat, TRUE);
 		gossip_chat_view_append_event (GOSSIP_CHAT (chat)->view, str);
@@ -1974,7 +1974,8 @@
 
 	priv = GET_PRIV (chat);
 
-	gossip_debug (DEBUG_DOMAIN, "Contact joined:'%s' (refs:%d)",
+	gossip_debug (DEBUG_DOMAIN, 
+		      "Contact joined:'%s' (refs:%d)",
 		      gossip_contact_get_id (contact),
 		      G_OBJECT (contact)->ref_count);
 
@@ -2016,7 +2017,8 @@
 
 	priv = GET_PRIV (chat);
 
-	gossip_debug (DEBUG_DOMAIN, "Contact left:'%s' (refs:%d)",
+	gossip_debug (DEBUG_DOMAIN, 
+		      "Contact left:'%s' (refs:%d)",
 		      gossip_contact_get_id (contact),
 		      G_OBJECT (contact)->ref_count);
 
@@ -2132,7 +2134,8 @@
 
 	priv = GET_PRIV (chat);
 
-	gossip_debug (DEBUG_DOMAIN, "Contact Presence Updated:'%s'",
+	gossip_debug (DEBUG_DOMAIN, 
+		      "Contact Presence Updated:'%s'",
 		      gossip_contact_get_id (contact));
 
 	if (group_chat_cl_find (chat, contact, &iter)) {

Modified: trunk/src/gossip-notify.c
==============================================================================
--- trunk/src/gossip-notify.c	(original)
+++ trunk/src/gossip-notify.c	Sat Nov 29 18:01:32 2008
@@ -191,7 +191,8 @@
 		return;
 	}
 
-	gossip_debug (DEBUG_DOMAIN, "Setting up notification for online contact:'%s'",
+	gossip_debug (DEBUG_DOMAIN, 
+		      "Setting up notification for online contact:'%s'",
 		      gossip_contact_get_id (contact));
 
 	presence = gossip_contact_get_active_presence (contact);
@@ -496,13 +497,15 @@
 
 	len = g_utf8_strlen (body_stripped, -1);
 	if (len < 1) {
-		gossip_debug (DEBUG_DOMAIN, "Ignoring new message from:'%s', no message content",
+		gossip_debug (DEBUG_DOMAIN, 
+			      "Ignoring new message from:'%s', no message content",
 			      gossip_contact_get_id (contact));
 		g_free (body_copy);
 		return NULL;
 	}
 
-	gossip_debug (DEBUG_DOMAIN, "Setting up notification for new message from:'%s'",
+	gossip_debug (DEBUG_DOMAIN, 
+		      "Setting up notification for new message from:'%s'",
 		      gossip_contact_get_id (contact));
 
 	show_avatars = FALSE;
@@ -678,7 +681,8 @@
 	presence = gossip_contact_get_active_presence (contact);
 	if (!presence) {
 		if (g_hash_table_lookup (contact_states, contact)) {
-			gossip_debug (DEBUG_DOMAIN, "Presence update, contact:'%s' is now offline",
+			gossip_debug (DEBUG_DOMAIN, 
+				      "Presence update, contact:'%s' is now offline",
 				      gossip_contact_get_id (contact));
 		}
 

Modified: trunk/src/gossip-private-chat.c
==============================================================================
--- trunk/src/gossip-private-chat.c	(original)
+++ trunk/src/gossip-private-chat.c	Sat Nov 29 18:01:32 2008
@@ -871,7 +871,7 @@
 	status = gossip_contact_get_status (contact);
 
 	return g_strdup_printf ("%s\n%s",
-				gossip_contact_get_id (contact),
+				gossip_contact_get_display_id (contact),
 				status);
 }
 

Modified: trunk/src/gossip-subscription-dialog.c
==============================================================================
--- trunk/src/gossip-subscription-dialog.c	(original)
+++ trunk/src/gossip-subscription-dialog.c	Sat Nov 29 18:01:32 2008
@@ -155,7 +155,8 @@
 	GossipSubscription  subscription;
 	gchar              *str;
 
-	gossip_debug (DEBUG_DOMAIN, "New request from:'%s'",
+	gossip_debug (DEBUG_DOMAIN, 
+		      "New request from:'%s'",
 		      gossip_contact_get_id (contact));
 
 	type = gossip_contact_get_type (contact);
@@ -263,7 +264,7 @@
 	g_object_unref (size_group);
 
 	gtk_entry_set_text (GTK_ENTRY (dialog->name_entry),
-			    gossip_contact_get_id (dialog->contact));
+			    gossip_contact_get_display_id (dialog->contact));
 
 	session = gossip_app_get_session ();
 	account_manager = gossip_session_get_account_manager (session);
@@ -301,7 +302,7 @@
 	g_free (question);
 
 	gtk_label_set_text (GTK_LABEL (dialog->id_label_value),
-			    gossip_contact_get_id (dialog->contact));
+			    gossip_contact_get_display_id (dialog->contact));
 
 	gtk_widget_hide (dialog->website_label);
 



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