gossip r2759 - in trunk: . libgossip
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: gossip r2759 - in trunk: . libgossip
- Date: Tue, 4 Mar 2008 08:45:36 +0000 (GMT)
Author: mr
Date: Tue Mar 4 08:45:35 2008
New Revision: 2759
URL: http://svn.gnome.org/viewvc/gossip?rev=2759&view=rev
Log:
Override "image/X-EVOLUTION-UNKNOWN" for ebook photo mime type to
guess "image/png" and include "from" attribute in vcard set Jabber message
Modified:
trunk/ChangeLog
trunk/libgossip/gossip-ebook.c
trunk/libgossip/gossip-jabber-vcard.c
Modified: trunk/libgossip/gossip-ebook.c
==============================================================================
--- trunk/libgossip/gossip-ebook.c (original)
+++ trunk/libgossip/gossip-ebook.c Tue Mar 4 08:45:35 2008
@@ -116,7 +116,13 @@
gchar *id;
ebook_init ();
+
id = e_contact_get (me, E_CONTACT_IM_JABBER_HOME_1);
+
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting id '%s'",
+ id);
+
ebook_term ();
return id;
@@ -161,6 +167,10 @@
name = e_contact_get (me, E_CONTACT_FULL_NAME);
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting name '%s'",
+ name);
+
ebook_term ();
return name;
@@ -205,6 +215,10 @@
ebook_init ();
nickname = e_contact_get (me, E_CONTACT_NICKNAME);
+
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting nickname '%s'",
+ nickname);
ebook_term ();
@@ -252,6 +266,10 @@
email = e_contact_get (me, E_CONTACT_EMAIL_1);
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting email address '%s'",
+ email);
+
ebook_term ();
return email;
@@ -296,6 +314,10 @@
ebook_init ();
website = e_contact_get (me, E_CONTACT_HOMEPAGE_URL);
+
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting website '%s'",
+ website);
ebook_term ();
@@ -317,6 +339,9 @@
birthdate = e_contact_get (me, E_CONTACT_BIRTH_DATE);
if (!birthdate) {
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting NO birthday");
+
ebook_term ();
return NULL;
}
@@ -324,6 +349,10 @@
str = e_contact_date_to_string (birthdate);
e_contact_date_free (birthdate);
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting birthday '%s'",
+ str);
+
/* FIXME: Needs to work with different localisations */
if (sscanf (str, "%04d-%02d-%02d", &year, &month, &day) != 3) {
ebook_term ();
@@ -387,28 +416,46 @@
{
EContactPhoto *photo;
GossipAvatar *avatar;
+ gchar *mime_type = "image/png";
+ guchar *data;
+ gsize length;
ebook_init ();
photo = e_contact_get (me, E_CONTACT_PHOTO);
if (!photo) {
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting NO avatar");
+
ebook_term ();
return NULL;
}
- /* Return NULL, if eds avatar is set to Unknown */
- if (strcmp (EVO_UNKNOWN_IMAGE, (gchar*) photo->data.inlined.mime_type) == 0) {
- e_contact_photo_free (photo);
- ebook_term ();
- return NULL;
+ data = (guchar*) photo->data.inlined.data;
+ length = photo->data.inlined.length;
+
+ /* Return NULL, if eds avatar is set to Unknown? It is ALWAYS unknown? */
+ if (strcmp ((gchar*) photo->data.inlined.mime_type, EVO_UNKNOWN_IMAGE) == 0) {
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting avatar with unknown mime type '%s', trying PNG",
+ photo->data.inlined.mime_type);
+
+ /* e_contact_photo_free (photo); */
+ /* ebook_term (); */
+ /* return NULL; */
+ } else {
+ mime_type = (gchar*) photo->data.inlined.mime_type;
}
- avatar = gossip_avatar_new ((guchar*) photo->data.inlined.data,
- photo->data.inlined.length,
- (gchar*) photo->data.inlined.mime_type);
+ gossip_debug (DEBUG_DOMAIN,
+ "Getting avatar of type '%s' and size %d",
+ photo->data.inlined.mime_type,
+ photo->data.inlined.length);
+ avatar = gossip_avatar_new (data, length, mime_type);
e_contact_photo_free (photo);
+
ebook_term ();
return avatar;
Modified: trunk/libgossip/gossip-jabber-vcard.c
==============================================================================
--- trunk/libgossip/gossip-jabber-vcard.c (original)
+++ trunk/libgossip/gossip-jabber-vcard.c Tue Mar 4 08:45:35 2008
@@ -278,6 +278,8 @@
LmMessageHandler *handler;
GossipCallbackData *data;
GossipAvatar *avatar;
+ GossipContact *own_contact;
+ const gchar *id;
const gchar *str;
gboolean result;
@@ -287,6 +289,10 @@
LM_MESSAGE_TYPE_IQ,
LM_MESSAGE_SUB_TYPE_SET);
+ own_contact = gossip_jabber_get_own_contact (jabber);
+ id = gossip_contact_get_id (own_contact);
+ lm_message_node_set_attribute (m->node, "from", id);
+
node = lm_message_node_add_child (m->node, "vCard", NULL);
lm_message_node_set_attribute (node, "xmlns", "vcard-temp");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]