]> git.0d.be Git - empathy.git/commitdiff
Merge branch 'call'
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Thu, 9 Jun 2011 09:28:44 +0000 (10:28 +0100)
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Thu, 9 Jun 2011 09:28:44 +0000 (10:28 +0100)
1  2 
configure.ac
libempathy-gtk/Makefile.am
libempathy/Makefile.am
libempathy/empathy-contact.c

diff --combined configure.ac
index 3e998de911d7132a52110012d4f27e0774168a00,fbe42221cccaf094607e53825c747a306810c895..a8a272be188d325a0d9420760594b02f759e076d
@@@ -35,6 -35,7 +35,7 @@@ FOLKS_REQUIRED=0.5.
  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
@@@ -62,6 -63,15 +63,15 @@@ GNOME_CONTROL_CENTER_REQUIRED=2.31.
  #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])
@@@ -154,7 -164,7 +164,7 @@@ PKG_CHECK_MODULES(EMPATHY
     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)
  # -----------------------------------------------------------
@@@ -374,35 -412,6 +412,35 @@@ AM_CONDITIONAL(HAVE_GEOCLUE, test "x$ha
  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
  # -----------------------------------------------------------
@@@ -554,9 -563,8 +592,9 @@@ Configure summary
        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}
  "
index bb2565885a81d559dffc5d5e84b1c7b5daf463cc,a834679c1e7d0e28d5da3430d5419673fd418b8f..7023ecfe53e004f5f61dc50bb4c978648b206369
@@@ -8,10 -8,10 +8,11 @@@ AM_CPPFLAGS 
        -DPKGDATADIR=\""$(pkgdatadir)"\"                \
        -DGCR_API_SUBJECT_TO_CHANGE                     \
        $(EMPATHY_CFLAGS)                               \
+       $(YELL_CFLAGS)                                  \
        $(ENCHANT_CFLAGS)                               \
        $(LIBCHAMPLAIN_CFLAGS)                          \
        $(GEOCLUE_CFLAGS)                               \
 +      $(GEOCODE_CFLAGS)                               \
        $(MEEGO_CFLAGS)                                 \
        $(WEBKIT_CFLAGS)                                \
        $(CHEESE_CFLAGS)                                \
@@@ -35,6 -35,7 +36,7 @@@ libempathy_gtk_handwritten_source 
        empathy-account-widget.c                \
        empathy-avatar-chooser.c                \
        empathy-avatar-image.c                  \
+       empathy-call-utils.c                    \
        empathy-cell-renderer-activatable.c     \
        empathy-cell-renderer-expander.c        \
        empathy-cell-renderer-text.c            \
@@@ -95,6 -96,7 +97,7 @@@ libempathy_gtk_headers =                      
        empathy-account-widget.h                \
        empathy-avatar-chooser.h                \
        empathy-avatar-image.h                  \
+       empathy-call-utils.h                    \
        empathy-cell-renderer-activatable.h     \
        empathy-cell-renderer-expander.h        \
        empathy-cell-renderer-text.h            \
@@@ -159,6 -161,7 +162,7 @@@ nodist_libempathy_gtk_la_SOURCES =
        $(BUILT_SOURCES)
  
  libempathy_gtk_la_LIBADD =                    \
+       $(EMPATHY_LIBS)                 \
        $(EMPATHY_LIBS)                 \
        $(GTK_LIBS)                     \
        $(LIBNOTIFY_LIBS)                       \
        $(ENCHANT_LIBS)                         \
        $(LIBCHAMPLAIN_LIBS)                    \
        $(GEOCLUE_LIBS)                         \
 +      $(GEOCODE_LIBS)                         \
        $(GCR_LIBS)                             \
        $(MEEGO_LIBS)                           \
        $(WEBKIT_LIBS)                          \
diff --combined libempathy/Makefile.am
index 41cec88fde3f3735de79b740d9b6bc0ffa465f64,186f08aa9981200eba90731bb2d5631cd4fe8bb4..48846311f0ea756323ee397128f3207cfa7fe211
@@@ -10,8 -10,8 +10,9 @@@ AM_CPPFLAGS 
        -DG_LOG_DOMAIN=\"empathy\"                      \
        -DGCR_API_SUBJECT_TO_CHANGE                     \
        $(EMPATHY_CFLAGS)                               \
+       $(YELL_CFLAGS)                                  \
        $(GEOCLUE_CFLAGS)                               \
 +      $(GEOCODE_CFLAGS)                               \
        $(NETWORK_MANAGER_CFLAGS)                       \
        $(CONNMAN_CFLAGS)                               \
        $(WARN_CFLAGS)                                  \
@@@ -110,10 -110,10 +111,11 @@@ nodist_libempathy_la_SOURCES =
  
  libempathy_la_LIBADD =                \
        $(top_builddir)/extensions/libemp-extensions.la \
+       $(top_builddir)/telepathy-yell/telepathy-yell/libtelepathy-yell.la \
        $(GCR_LIBS) \
        $(EMPATHY_LIBS) \
        $(GEOCLUE_LIBS) \
 +      $(GEOCODE_LIBS) \
        $(NETWORK_MANAGER_LIBS) \
        $(CONNMAN_LIBS)
  
@@@ -134,12 -134,12 +136,12 @@@ empathy-marshal.list: $(libempathy_la_S
                mv $@.tmp $@; \
        fi
  
%-marshal.h: %-marshal.list Makefile
-       $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
empathy-marshal.h: empathy-marshal.list Makefile
+       $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_empathy_marshal $< > empathy-marshal.h
  
%-marshal.c: %-marshal.list Makefile
empathy-marshal.c: empathy-marshal.list Makefile
        $(AM_V_GEN)echo "#include \"empathy-marshal.h\"" > $@ && \
-       $(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
+       $(GLIB_GENMARSHAL) --body --prefix=_empathy_marshal $< >> empathy-marshal.c
  
  empathy-enum-types.h: stamp-empathy-enum-types.h
        $(AM_V_GEN)true
index a90b20eced50ed5c2b5a9622fe5223dcf2ff4f40,6cdb3b6d99f3279f07cdcbe462cc98dd28ce838a..55bc40bdd5cae52fa6ef5d2994c770014bc6329b
  #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"
@@@ -79,7 -80,7 +80,7 @@@ static void contact_get_property (GObje
  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
  
@@@ -1440,7 -1441,7 +1441,7 @@@ empathy_contact_set_location (EmpathyCo
      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");
@@@ -1508,37 -1509,41 +1509,37 @@@ empathy_contact_equal (gconstpointer co
    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
  
@@@ -1660,6 -1751,29 +1661,29 @@@ tp_caps_to_capabilities (TpCapabilitie
                  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;