aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-contact.c25
-rw-r--r--libempathy/empathy-utils.c21
-rw-r--r--libempathy/empathy-utils.h3
3 files changed, 38 insertions, 11 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 4fe428957..83f59f4c6 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -1623,6 +1623,8 @@ geocode_cb (GObject *source,
EmpathyContact *contact = user_data;
EmpathyContactPriv *priv = GET_PRIV (contact);
GError *error = NULL;
+ GList *res;
+ GeocodeLocation *loc;
GHashTable *new_location;
GHashTable *resolved = NULL;
gdouble latitude, longitude;
@@ -1630,26 +1632,27 @@ geocode_cb (GObject *source,
if (priv->location == NULL)
goto out;
- resolved = geocode_object_resolve_finish (GEOCODE_OBJECT (source), result,
+ res = geocode_forward_search_finish (GEOCODE_FORWARD (source), result,
&error);
- if (resolved == NULL)
+ if (res == NULL)
{
DEBUG ("Failed to resolve geocode: %s", error->message);
g_error_free (error);
goto out;
}
- if (!geocode_object_get_coords (resolved, &longitude, &latitude))
- goto out;
+ loc = res->data;
new_location = tp_asv_new (
- EMPATHY_LOCATION_LAT, G_TYPE_DOUBLE, latitude,
- EMPATHY_LOCATION_LON, G_TYPE_DOUBLE, longitude,
+ EMPATHY_LOCATION_LAT, G_TYPE_DOUBLE, loc->latitude,
+ EMPATHY_LOCATION_LON, G_TYPE_DOUBLE, loc->longitude,
NULL);
- DEBUG ("\t - Latitude: %f", latitude);
- DEBUG ("\t - Longitude: %f", longitude);
+ DEBUG ("\t - Latitude: %f", loc->latitude);
+ DEBUG ("\t - Longitude: %f", loc->longitude);
+
+ g_list_free_full (res, (GDestroyNotify) geocode_location_free);
/* Copy remaning fields. LAT and LON were not defined so we won't overwrite
* the values we just set. */
@@ -1669,7 +1672,7 @@ out:
static void
update_geocode (EmpathyContact *contact)
{
- GeocodeObject *geocode;
+ GeocodeForward *geocode;
GHashTable *location;
location = empathy_contact_get_location (contact);
@@ -1682,11 +1685,11 @@ update_geocode (EmpathyContact *contact)
g_hash_table_lookup (location, EMPATHY_LOCATION_LON) != NULL)
return;
- geocode = geocode_object_new_for_params (location);
+ geocode = geocode_forward_new_for_params (location);
if (geocode == NULL)
return;
- geocode_object_resolve_async (geocode, NULL, geocode_cb,
+ geocode_forward_search_async (geocode, NULL, geocode_cb,
g_object_ref (contact));
g_object_unref (geocode);
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index e33bf3af4..191544fbf 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -502,6 +502,13 @@ empathy_protocol_name_to_display_name (const gchar *proto_name)
{ "yahoojp", N_("Yahoo! Japan"), TRUE },
{ "groupwise", "GroupWise", FALSE },
{ "sip", "SIP", FALSE },
+ { "gadugadu", "Gadu-Gadu", FALSE },
+ { "mxit", "Mxit", FALSE },
+ { "myspace", "Myspace", FALSE },
+ { "sametime", "Sametime", FALSE },
+ { "skype-dbus", "Skype (D-BUS)", FALSE },
+ { "skype-x11", "Skype (X11)", FALSE },
+ { "zephyr", "Zephyr", FALSE },
{ NULL, NULL }
};
@@ -1115,6 +1122,20 @@ while_finish:
*can_video_call = can_video;
}
+gboolean
+empathy_client_types_contains_mobile_device (const GStrv types) {
+ int i;
+
+ if (types == NULL)
+ return FALSE;
+
+ for (i = 0; types[i] != NULL; i++)
+ if (!tp_strdiff (types[i], "phone") || !tp_strdiff (types[i], "handheld"))
+ return TRUE;
+
+ return FALSE;
+}
+
static FolksIndividual *
create_individual_from_persona (FolksPersona *persona)
{
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index a310d2b02..3950c5be3 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -115,6 +115,9 @@ void empathy_individual_can_audio_video_call (FolksIndividual *individual,
gboolean *can_video_call,
EmpathyContact **out_contact);
+gboolean empathy_client_types_contains_mobile_device (
+ const GStrv types);
+
FolksIndividual * empathy_create_individual_from_tp_contact (
TpContact *contact);