GLIB_REQUIRED=2.28.0
GNUTLS_REQUIRED=2.8.5
GTK_REQUIRED=3.0.2
+ GSTREAMER_REQUIRED=0.10.32
KEYRING_REQUIRED=2.26.0
GCR_REQUIRED=2.91.4
LIBCANBERRA_GTK_REQUIRED=0.25
#ifelse(empathy_released, 1, [], [enable_maintainer_mode="yes"])
#GNOME_MAINTAINER_MODE_DEFINES
+ # telepathy-yell
+ prev_top_build_prefix=$ac_top_build_prefix
+ prev_ac_configure_args=$ac_configure_args
+ ac_configure_args="$ac_configure_args --disable-shared-library"
+ AX_CONFIG_DIR([telepathy-yell])
+ ac_top_build_prefix=$prev_top_build_prefix
+ ac_configure_args=$prev_ac_configure_args
+ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$ac_top_build_prefix"telepathy-yell/telepathy-yell
+
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([configure.ac])
gmodule-export-2.0
gobject-2.0
gsettings-desktop-schemas
- gstreamer-0.10
+ gstreamer-0.10 >= $GSTREAMER_REQUIRED
gstreamer-interfaces-0.10
libxml-2.0
telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
gcr-3 >= $GCR_REQUIRED
])
+ PKG_CHECK_MODULES(YELL, [telepathy-yell])
+
PKG_CHECK_MODULES(EMPATHY_AV,
[
farsight2-0.10
telepathy-farsight >= $TELEPATHY_FARSIGHT_REQUIRED
])
+ # -----------------------------------------------------------
+ # Call interface
+ # -----------------------------------------------------------
+ AC_ARG_WITH(call,
+ AC_HELP_STRING([--enable-call=@<:@no/yes/auto@:>@],
+ [build with Call interface support]),,
+ [with_call=auto])
+ if test "x$with_call" != "xno" ; then
+ PKG_CHECK_MODULES(EMPATHY_CALL,
+ [
+ farsight2-0.10
+ telepathy-farstream
+ ], have_farstream="yes", have_farstream="no" )
+
+ if test "x$have_farstream" = "xyes"; then
+ AC_DEFINE(HAVE_CALL, 1, [Define if you have Call channel support])
+ fi
+ else
+ have_farstream=no
+ fi
+
+ if test "x$with_call" = "xyes" -a "x$have_farstream" != "xyes"; then
+ AC_MSG_ERROR([Could not find Call handler dependencies.])
+ fi
+ AM_CONDITIONAL(HAVE_CALL, test "x$have_farstream" = "xyes")
+
# -----------------------------------------------------------
# evolution-data-server (about-me)
# -----------------------------------------------------------
AC_SUBST(GEOCLUE_CFLAGS)
AC_SUBST(GEOCLUE_LIBS)
+# -----------------------------------------------------------
+# location checks: geocode-glib
+# -----------------------------------------------------------
+AC_ARG_ENABLE(geocode,
+ AS_HELP_STRING([--enable-geocode=@<:@no/yes/auto@:>@],
+ [Enable geocode support]), ,
+ enable_geocode=auto)
+
+if test "x$enable_geocode" != "xno"; then
+ PKG_CHECK_MODULES(GEOCODE,
+ [
+ geocode-glib
+ ], have_geocode="yes", have_geocode="no")
+
+ if test "x$have_geoclue" = "xyes"; then
+ AC_DEFINE(HAVE_GEOCODE, 1, [Define if you have geocode])
+ fi
+else
+ have_geocode="no"
+fi
+
+if test "x$enable_geocode" = "xyes" -a "x$have_geocode" != "xyes"; then
+ AC_MSG_ERROR([Could not find geocode dependencies.])
+fi
+
+AM_CONDITIONAL(HAVE_GEOCODE, test "x$have_geocode" = "xyes")
+AC_SUBST(GEOCODE_CFLAGS)
+AC_SUBST(GEOCODE_LIBS)
+
# -----------------------------------------------------------
# meego widgets support
# -----------------------------------------------------------
Spell checking (enchant)....: ${have_enchant}
Display maps (libchamplain).: ${have_libchamplain}
Location awareness (Geoclue): ${have_geoclue}
+ Geocode support (Geoclue): ${have_geocode}
Adium themes (Webkit).......: ${have_webkit}
- Meego widgets ..............: ${have_meego}
+ Meego widgets...............: ${have_meego}
Control center embedding....: ${have_control_center_embedding}
Cheese webcam support ......: ${have_cheese}
Extras:
Nautilus-sendto plugin......: ${have_nst}
Salut E-D-S support.........: ${with_eds}
+ Exp. Call channel handler...: ${have_farstream}
"
#include <telepathy-glib/account-manager.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
+ #include <telepathy-yell/telepathy-yell.h>
#include <telepathy-logger/log-manager.h>
#include <folks/folks.h>
#include <folks/folks-telepathy.h>
-#ifdef HAVE_GEOCLUE
-#include <geoclue/geoclue-geocode.h>
+#ifdef HAVE_GEOCODE
+#include <geocode-glib/geocode-glib.h>
#endif
#include "empathy-contact.h"
static void contact_set_property (GObject *object, guint param_id,
const GValue *value, GParamSpec *pspec);
-#ifdef HAVE_GEOCLUE
+#ifdef HAVE_GEOCODE
static void update_geocode (EmpathyContact *contact);
#endif
g_hash_table_unref (priv->location);
priv->location = g_hash_table_ref (location);
-#ifdef HAVE_GEOCLUE
+#ifdef HAVE_GEOCODE
update_geocode (contact);
#endif
g_object_notify (G_OBJECT (contact), "location");
return FALSE;
}
-#ifdef HAVE_GEOCLUE
-#define GEOCODE_SERVICE "org.freedesktop.Geoclue.Providers.Yahoo"
-#define GEOCODE_PATH "/org/freedesktop/Geoclue/Providers/Yahoo"
-
-/* This callback is called by geoclue when it found a position
+#ifdef HAVE_GEOCODE
+/* This callback is called by geocode-glib when it found a position
* for the given address. A position is necessary for a contact
* to show up on the map
*/
static void
-geocode_cb (GeoclueGeocode *geocode,
- GeocluePositionFields fields,
- double latitude,
- double longitude,
- double altitude,
- GeoclueAccuracy *accuracy,
- GError *error,
- gpointer contact)
+geocode_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
{
+ EmpathyContact *contact = user_data;
EmpathyContactPriv *priv = GET_PRIV (contact);
+ GError *error = NULL;
GHashTable *new_location;
+ GHashTable *resolved;
+ gdouble latitude, longitude;
if (priv->location == NULL)
goto out;
- if (error != NULL)
+ resolved = geocode_object_resolve_finish (GEOCODE_OBJECT (source), result,
+ &error);
+
+ if (resolved == NULL)
{
- DEBUG ("Error geocoding location : %s", error->message);
+ DEBUG ("Failed to resolve geocode: %s", error->message);
+ g_error_free (error);
goto out;
}
- /* No need to change location if we didn't find the position */
- if (!(fields & GEOCLUE_POSITION_FIELDS_LATITUDE))
- goto out;
-
- if (!(fields & GEOCLUE_POSITION_FIELDS_LONGITUDE))
+ if (!geocode_object_get_coords (resolved, &longitude, &latitude))
goto out;
new_location = tp_asv_new (
tp_g_hash_table_update (new_location, priv->location,
(GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup);
- /* Set the altitude only if it wasn't defined before */
- if (fields & GEOCLUE_POSITION_FIELDS_ALTITUDE &&
- g_hash_table_lookup (new_location, EMPATHY_LOCATION_ALT) == NULL)
- {
- tp_asv_set_double (new_location, g_strdup (EMPATHY_LOCATION_ALT),
- altitude);
- DEBUG ("\t - Altitude: %f", altitude);
- }
-
/* Don't change the accuracy as we used an address to get this position */
g_hash_table_unref (priv->location);
priv->location = new_location;
- g_object_notify (contact, "location");
+ g_object_notify ((GObject *) contact, "location");
+
out:
- g_object_unref (geocode);
+ tp_clear_pointer (&result, g_hash_table_unref);
g_object_unref (contact);
}
-static gchar *
-get_dup_string (GHashTable *location,
- gchar *key)
-{
- GValue *value;
-
- value = g_hash_table_lookup (location, key);
- if (value != NULL)
- return g_value_dup_string (value);
-
- return NULL;
-}
-
static void
update_geocode (EmpathyContact *contact)
{
- static GeoclueGeocode *geocode;
- gchar *str;
- GHashTable *address;
+ GeocodeObject *geocode;
GHashTable *location;
location = empathy_contact_get_location (contact);
g_hash_table_lookup (location, EMPATHY_LOCATION_LON) != NULL)
return;
- if (geocode == NULL)
- {
- geocode = geoclue_geocode_new (GEOCODE_SERVICE, GEOCODE_PATH);
- g_object_add_weak_pointer (G_OBJECT (geocode), (gpointer *) &geocode);
- }
- else
- {
- g_object_ref (geocode);
- }
-
- address = geoclue_address_details_new ();
-
- str = get_dup_string (location, EMPATHY_LOCATION_COUNTRY_CODE);
- if (str != NULL)
- {
- g_hash_table_insert (address,
- g_strdup (GEOCLUE_ADDRESS_KEY_COUNTRYCODE), str);
- DEBUG ("\t - countrycode: %s", str);
- }
-
- str = get_dup_string (location, EMPATHY_LOCATION_COUNTRY);
- if (str != NULL)
- {
- g_hash_table_insert (address,
- g_strdup (GEOCLUE_ADDRESS_KEY_COUNTRY), str);
- DEBUG ("\t - country: %s", str);
- }
-
- str = get_dup_string (location, EMPATHY_LOCATION_POSTAL_CODE);
- if (str != NULL)
- {
- g_hash_table_insert (address,
- g_strdup (GEOCLUE_ADDRESS_KEY_POSTALCODE), str);
- DEBUG ("\t - postalcode: %s", str);
- }
-
- str = get_dup_string (location, EMPATHY_LOCATION_REGION);
- if (str != NULL)
- {
- g_hash_table_insert (address,
- g_strdup (GEOCLUE_ADDRESS_KEY_REGION), str);
- DEBUG ("\t - region: %s", str);
- }
-
- str = get_dup_string (location, EMPATHY_LOCATION_LOCALITY);
- if (str != NULL)
- {
- g_hash_table_insert (address,
- g_strdup (GEOCLUE_ADDRESS_KEY_LOCALITY), str);
- DEBUG ("\t - locality: %s", str);
- }
-
- str = get_dup_string (location, EMPATHY_LOCATION_STREET);
- if (str != NULL)
- {
- g_hash_table_insert (address,
- g_strdup (GEOCLUE_ADDRESS_KEY_STREET), str);
- DEBUG ("\t - street: %s", str);
- }
-
- if (g_hash_table_size (address) > 0)
- {
- g_object_ref (contact);
+ geocode = geocode_object_new_for_params (location);
- geoclue_geocode_address_to_position_async (geocode, address,
- geocode_cb, contact);
- }
+ geocode_object_resolve_async (geocode, NULL, geocode_cb,
+ g_object_ref (contact));
- g_hash_table_unref (address);
+ g_object_unref (geocode);
}
#endif
TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL, NULL))
capabilities |= EMPATHY_CAPABILITIES_SMS;
}
+ else if (!tp_strdiff (chan_type,
+ TPY_IFACE_CHANNEL_TYPE_CALL))
+ {
+ guint j;
+
+ if (tp_asv_get_boolean (fixed_prop,
+ TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL))
+ capabilities |= EMPATHY_CAPABILITIES_AUDIO;
+
+ if (tp_asv_get_boolean (fixed_prop,
+ TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL))
+ capabilities |= EMPATHY_CAPABILITIES_VIDEO;
+
+ for (j = 0; allowed_prop[j] != NULL; j++)
+ {
+ if (!tp_strdiff (allowed_prop[j],
+ TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO))
+ capabilities |= EMPATHY_CAPABILITIES_AUDIO;
+ else if (!tp_strdiff (allowed_prop[j],
+ TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO))
+ capabilities |= EMPATHY_CAPABILITIES_VIDEO;
+ }
+ }
}
return capabilities;