]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-contact.c
Updated Oriya translation
[empathy.git] / libempathy / empathy-contact.c
index 4fe4289575c7463157c0b4498d9efa8ac1b59af4..d2284806f639c48179546d0dcd73ca3f4eb56c2f 100644 (file)
  */
 
 #include "config.h"
+#include "empathy-contact.h"
 
-#include <string.h>
-
-#include <glib/gi18n-lib.h>
-
-#include <folks/folks.h>
-#include <folks/folks-telepathy.h>
+#include <tp-account-widgets/tpaw-utils.h>
 
 #ifdef HAVE_GEOCODE
 #include <geocode-glib/geocode-glib.h>
 #endif
 
-#include "empathy-contact.h"
-#include "empathy-camera-monitor.h"
-#include "empathy-individual-manager.h"
+#include "empathy-location.h"
 #include "empathy-utils.h"
 #include "empathy-enum-types.h"
-#include "empathy-location.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
 #include "empathy-debug.h"
@@ -332,7 +325,7 @@ empathy_contact_class_init (EmpathyContactClass *class)
         "Contact presence",
         "Presence of contact",
         TP_CONNECTION_PRESENCE_TYPE_UNSET,
-        NUM_TP_CONNECTION_PRESENCE_TYPES,
+        TP_NUM_CONNECTION_PRESENCE_TYPES,
         TP_CONNECTION_PRESENCE_TYPE_UNSET,
         G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
@@ -471,7 +464,7 @@ empathy_contact_set_id (EmpathyContact *contact,
       priv->id = g_strdup (id);
 
       g_object_notify (G_OBJECT (contact), "id");
-      if (EMP_STR_EMPTY (priv->alias))
+      if (TPAW_STR_EMPTY (priv->alias))
           g_object_notify (G_OBJECT (contact), "alias");
     }
 
@@ -777,7 +770,7 @@ empathy_contact_from_tpl_contact (TpAccount *account,
         }
     }
 
-  if (!EMP_STR_EMPTY (tpl_entity_get_avatar_token (tpl_entity)))
+  if (!TPAW_STR_EMPTY (tpl_entity_get_avatar_token (tpl_entity)))
     contact_load_avatar_cache (retval,
         tpl_entity_get_avatar_token (tpl_entity));
 
@@ -821,12 +814,12 @@ empathy_contact_get_alias (EmpathyContact *contact)
 
   priv = GET_PRIV (contact);
 
-  if (!EMP_STR_EMPTY (priv->alias))
+  if (!TPAW_STR_EMPTY (priv->alias))
     alias = priv->alias;
   else if (priv->tp_contact != NULL)
     alias = tp_contact_get_alias (priv->tp_contact);
 
-  if (!EMP_STR_EMPTY (alias))
+  if (!TPAW_STR_EMPTY (alias))
     return alias;
   else
     return empathy_contact_get_id (contact);
@@ -923,7 +916,7 @@ empathy_contact_change_group (EmpathyContact *contact, const gchar *group,
   if (priv->groups == NULL)
     {
       priv->groups = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup,
-          g_free, g_str_hash, g_str_equal);
+          g_free, NULL, NULL, NULL, NULL, NULL, NULL);
     }
 
   gee_collection_add (GEE_COLLECTION (priv->groups), group);
@@ -1194,7 +1187,7 @@ empathy_contact_get_status (EmpathyContact *contact)
   g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), "");
 
   message = empathy_contact_get_presence_message (contact);
-  if (!EMP_STR_EMPTY (message))
+  if (!TPAW_STR_EMPTY (message))
     return message;
 
   return empathy_presence_get_default_message (
@@ -1339,7 +1332,7 @@ contact_get_avatar_filename (EmpathyContact *contact,
   gchar *avatar_file;
   gchar *token_escaped;
 
-  if (EMP_STR_EMPTY (empathy_contact_get_id (contact)))
+  if (TPAW_STR_EMPTY (empathy_contact_get_id (contact)))
     return NULL;
 
   token_escaped = tp_escape_as_identifier (token);
@@ -1372,7 +1365,7 @@ contact_load_avatar_cache (EmpathyContact *contact,
   GError *error = NULL;
 
   g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), FALSE);
-  g_return_val_if_fail (!EMP_STR_EMPTY (token), FALSE);
+  g_return_val_if_fail (!TPAW_STR_EMPTY (token), FALSE);
 
   /* Load the avatar from file if it exists */
   filename = contact_get_avatar_filename (contact, token);
@@ -1623,33 +1616,35 @@ 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;
 
   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, geocode_location_get_latitude (loc),
+      EMPATHY_LOCATION_LON, G_TYPE_DOUBLE, geocode_location_get_longitude (loc),
       NULL);
 
-  DEBUG ("\t - Latitude: %f", latitude);
-  DEBUG ("\t - Longitude: %f", longitude);
+  DEBUG ("\t - Latitude: %f", geocode_location_get_latitude (loc));
+  DEBUG ("\t - Longitude: %f", geocode_location_get_longitude (loc));
+
+  g_list_free_full (res, g_object_unref);
 
   /* Copy remaning fields. LAT and LON were not defined so we won't overwrite
    * the values we just set. */
@@ -1669,7 +1664,7 @@ out:
 static void
 update_geocode (EmpathyContact *contact)
 {
-  GeocodeObject *geocode;
+  GeocodeForward *geocode;
   GHashTable *location;
 
   location = empathy_contact_get_location (contact);
@@ -1682,11 +1677,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);