Conflicts:
authorXavier Claessens <xclaesse@src.gnome.org>
Sun, 2 Dec 2007 22:38:02 +0000 (22:38 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Sun, 2 Dec 2007 22:38:02 +0000 (22:38 +0000)
ChangeLog

svn path=/trunk/; revision=455

23 files changed:
ChangeLog
configure.ac
libempathy-gtk/empathy-account-chooser.c
libempathy-gtk/empathy-accounts-dialog.c
libempathy-gtk/empathy-chat.c
libempathy-gtk/empathy-contact-dialogs.c
libempathy-gtk/empathy-group-chat.c
libempathy-gtk/empathy-main-window.c
libempathy-gtk/empathy-presence-chooser.c
libempathy-gtk/empathy-status-presets.c
libempathy/empathy-avatar.c
libempathy/empathy-contact-factory.c
libempathy/empathy-contact-manager.c
libempathy/empathy-tp-call.c
libempathy/empathy-tp-chat.c
libempathy/empathy-tp-chat.h
libempathy/empathy-tp-contact-list.c
libempathy/empathy-tp-group.c
libempathy/empathy-tp-roomlist.c
libempathy/empathy-utils.c
libempathy/empathy-utils.h
python/pyempathy/pyempathy.defs
src/empathy.c

index 5b4dd7f19e1461431df2a2a8fb3c2c8c986e7137..36fdbd3351964084381222b4705c807ac4dc06d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2007-12-02  Xavier Claessens  <xclaesse@gmail.com>
+
+        * configure.ac:
+        * libempathy-gtk/empathy-account-chooser.c:
+        * libempathy-gtk/empathy-accounts-dialog.c:
+        * libempathy-gtk/empathy-chat.c:
+        * libempathy-gtk/empathy-contact-dialogs.c:
+        * libempathy-gtk/empathy-group-chat.c:
+        * libempathy-gtk/empathy-main-window.c:
+        * libempathy-gtk/empathy-presence-chooser.c:
+        * libempathy-gtk/empathy-status-presets.c:
+        * libempathy/empathy-avatar.c:
+        * libempathy/empathy-contact-factory.c:
+        * libempathy/empathy-contact-manager.c:
+        * libempathy/empathy-tp-call.c:
+        * libempathy/empathy-tp-chat.c:
+        * libempathy/empathy-tp-chat.h:
+        * libempathy/empathy-tp-contact-list.c:
+        * libempathy/empathy-tp-group.c:
+        * libempathy/empathy-tp-roomlist.c:
+        * libempathy/empathy-utils.c:
+        * libempathy/empathy-utils.h:
+        * python/pyempathy/pyempathy.defs:
+        * src/empathy.c: Do not use deprecated symbols from libtelepathy. We
+        now link on telepathy-glib, make use of tp_strdiff and
+        tp_escape_as_identifier instead of using our own copy of those
+        functions.
+
 2007-12-02  Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/Makefile.am:
index 590d5442d139b30c3385aad70485ad8c77672031..af869c0ee4cf0d4065a73c29eabf9d00c2b5dd2c 100644 (file)
@@ -50,14 +50,16 @@ GTK_REQUIRED=2.12.0
 GCONF_REQUIRED=1.2.0
 LIBGLADE_REQUIRED=2.0.0
 LIBPANELAPPLET_REQUIRED=2.10.0
-TELEPATHY_REQUIRED=0.0.57
+TELEPATHY_REQUIRED=0.3.1
+TELEPATHY_GLIB_REQUIRED=0.7.0
 MISSION_CONTROL_REQUIRED=4.37
 
 IDT_COMPILE_WARNINGS
 
-dnl Uncomment that to build without deprecated GTK and GLib symbols
+dnl Uncomment that to build without deprecated symbols
 dnl AC_DEFINE(GTK_DISABLE_DEPRECATED, 1, [Disable deprecated GTK symbols])
 dnl AC_DEFINE(G_DISABLE_DEPRECATED, 1, [Disable deprecated GLib symbols])
+dnl AC_DEFINE(LIBTELEPATHY_DISABLE_DEPRECATED, 1, [Disable deprecated libtelepathy symbols])
 
 GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
 AC_SUBST(GLIB_GENMARSHAL)
@@ -83,6 +85,7 @@ PKG_CHECK_MODULES(LIBEMPATHY,
    gconf-2.0 >= $GCONF_REQUIRED
    libxml-2.0
    libtelepathy >= $TELEPATHY_REQUIRED
+   telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
 ])
 
@@ -92,9 +95,10 @@ PKG_CHECK_MODULES(EMPATHY,
    gobject-2.0
    gconf-2.0 >= $GCONF_REQUIRED
    libxml-2.0
-   gnome-vfs-2.0
    libtelepathy >= $TELEPATHY_REQUIRED
+   telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
+   gnome-vfs-2.0
    gtk+-2.0 >= $GTK_REQUIRED
    x11
    libglade-2.0 >= $LIBGLADE_REQUIRED
index c9cfbed59c8d9ee6cd3e2aad97cffabc452d0129..8c9674177a67b0a5e7eaac772440a5f4cc3bafc2 100644 (file)
@@ -64,41 +64,41 @@ enum {
        COL_ACCOUNT_COUNT
 };
 
-static void     account_chooser_finalize               (GObject                         *object);
-static void     account_chooser_get_property           (GObject                         *object,
-                                                       guint                            param_id,
-                                                       GValue                          *value,
-                                                       GParamSpec                      *pspec);
-static void     account_chooser_set_property           (GObject                         *object,
-                                                       guint                            param_id,
-                                                       const GValue                    *value,
-                                                       GParamSpec                      *pspec);
-static void     account_chooser_setup                  (EmpathyAccountChooser            *chooser);
-static void     account_chooser_account_created_cb     (McAccountMonitor                *monitor,
-                                                       const gchar                     *unique_name,
-                                                       EmpathyAccountChooser            *chooser);
-static void     account_chooser_account_add_foreach    (McAccount                       *account,
-                                                       EmpathyAccountChooser            *chooser);
-static void     account_chooser_account_deleted_cb     (McAccountMonitor                *monitor,
-                                                       const gchar                     *unique_name,
-                                                       EmpathyAccountChooser            *chooser);
-static void     account_chooser_account_remove_foreach (McAccount                       *account,
-                                                       EmpathyAccountChooser            *chooser);
-static void     account_chooser_update_iter            (EmpathyAccountChooser            *chooser,
-                                                       GtkTreeIter                     *iter);
-static void     account_chooser_status_changed_cb      (MissionControl                  *mc,
-                                                       TelepathyConnectionStatus        status,
-                                                       McPresence                       presence,
-                                                       TelepathyConnectionStatusReason  reason,
-                                                       const gchar                     *unique_name,
-                                                       EmpathyAccountChooser           *chooser);
-static gboolean account_chooser_separator_func         (GtkTreeModel                    *model,
-                                                       GtkTreeIter                     *iter,
-                                                       EmpathyAccountChooser            *chooser);
-static gboolean account_chooser_set_account_foreach    (GtkTreeModel                    *model,
-                                                       GtkTreePath                     *path,
-                                                       GtkTreeIter                     *iter,
-                                                       SetAccountData                  *data);
+static void     account_chooser_finalize               (GObject                  *object);
+static void     account_chooser_get_property           (GObject                  *object,
+                                                       guint                     param_id,
+                                                       GValue                   *value,
+                                                       GParamSpec               *pspec);
+static void     account_chooser_set_property           (GObject                  *object,
+                                                       guint                     param_id,
+                                                       const GValue             *value,
+                                                       GParamSpec               *pspec);
+static void     account_chooser_setup                  (EmpathyAccountChooser    *chooser);
+static void     account_chooser_account_created_cb     (McAccountMonitor         *monitor,
+                                                       const gchar              *unique_name,
+                                                       EmpathyAccountChooser    *chooser);
+static void     account_chooser_account_add_foreach    (McAccount                *account,
+                                                       EmpathyAccountChooser    *chooser);
+static void     account_chooser_account_deleted_cb     (McAccountMonitor         *monitor,
+                                                       const gchar              *unique_name,
+                                                       EmpathyAccountChooser    *chooser);
+static void     account_chooser_account_remove_foreach (McAccount                *account,
+                                                       EmpathyAccountChooser    *chooser);
+static void     account_chooser_update_iter            (EmpathyAccountChooser    *chooser,
+                                                       GtkTreeIter              *iter);
+static void     account_chooser_status_changed_cb      (MissionControl           *mc,
+                                                       TpConnectionStatus        status,
+                                                       McPresence                presence,
+                                                       TpConnectionStatusReason  reason,
+                                                       const gchar              *unique_name,
+                                                       EmpathyAccountChooser    *chooser);
+static gboolean account_chooser_separator_func         (GtkTreeModel             *model,
+                                                       GtkTreeIter              *iter,
+                                                       EmpathyAccountChooser    *chooser);
+static gboolean account_chooser_set_account_foreach    (GtkTreeModel             *model,
+                                                       GtkTreePath              *path,
+                                                       GtkTreeIter              *iter,
+                                                       SetAccountData           *data);
 
 enum {
        PROP_0,
@@ -555,12 +555,12 @@ account_chooser_update_iter (EmpathyAccountChooser *chooser,
 }
 
 static void
-account_chooser_status_changed_cb (MissionControl                  *mc,
-                                  TelepathyConnectionStatus        status,
-                                  McPresence                       presence,
-                                  TelepathyConnectionStatusReason  reason,
-                                  const gchar                     *unique_name,
-                                  EmpathyAccountChooser           *chooser)
+account_chooser_status_changed_cb (MissionControl           *mc,
+                                  TpConnectionStatus        status,
+                                  McPresence                presence,
+                                  TpConnectionStatusReason  reason,
+                                  const gchar              *unique_name,
+                                  EmpathyAccountChooser    *chooser)
 {
        McAccount   *account;
        GtkTreeIter  iter;
@@ -663,8 +663,8 @@ gboolean
 empathy_account_chooser_filter_is_connected (McAccount *account,
                                             gpointer   user_data)
 {
-       MissionControl            *mc;
-       TelepathyConnectionStatus  status;
+       MissionControl     *mc;
+       TpConnectionStatus  status;
 
        g_return_val_if_fail (MC_IS_ACCOUNT (account), FALSE);
 
@@ -672,6 +672,6 @@ empathy_account_chooser_filter_is_connected (McAccount *account,
        status = mission_control_get_connection_status (mc, account, NULL);
        g_object_unref (mc);
 
-       return status == TP_CONN_STATUS_CONNECTED;
+       return status == TP_CONNECTION_STATUS_CONNECTED;
 }
 
index f171664b35f3678fe1160fb2b67917f6b807c1e8..4c0719c212546ae8f3202e640fb438b876873645 100644 (file)
@@ -36,6 +36,7 @@
 #include <libmissioncontrol/mc-profile.h>
 #include <libmissioncontrol/mission-control.h>
 #include <libmissioncontrol/mc-account-monitor.h>
+#include <telepathy-glib/util.h>
 #include <libtelepathy/tp-constants.h>
 
 #include <libempathy/empathy-debug.h>
@@ -96,64 +97,64 @@ enum {
        COL_COUNT
 };
 
-static void       accounts_dialog_setup                     (EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_update_account            (EmpathyAccountsDialog            *dialog,
-                                                            McAccount                       *account);
-static void       accounts_dialog_model_setup               (EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_model_add_columns         (EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_model_select_first        (EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_model_pixbuf_data_func    (GtkTreeViewColumn               *tree_column,
-                                                            GtkCellRenderer                 *cell,
-                                                            GtkTreeModel                    *model,
-                                                            GtkTreeIter                     *iter,
-                                                            EmpathyAccountsDialog            *dialog);
-static McAccount *accounts_dialog_model_get_selected        (EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_model_set_selected        (EmpathyAccountsDialog            *dialog,
-                                                            McAccount                       *account);
-static gboolean   accounts_dialog_model_remove_selected     (EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_model_selection_changed   (GtkTreeSelection                *selection,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_add_account               (EmpathyAccountsDialog            *dialog,
-                                                            McAccount                       *account);
-static void       accounts_dialog_account_added_cb          (McAccountMonitor                *monitor,
-                                                            gchar                           *unique_name,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_account_removed_cb        (McAccountMonitor                *monitor,
-                                                            gchar                           *unique_name,
-                                                            EmpathyAccountsDialog            *dialog);
-static gboolean   accounts_dialog_row_changed_foreach       (GtkTreeModel                    *model,
-                                                            GtkTreePath                     *path,
-                                                            GtkTreeIter                     *iter,
-                                                            gpointer                         user_data);
-static gboolean   accounts_dialog_flash_connecting_cb       (EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_status_changed_cb         (MissionControl                  *mc,
-                                                            TelepathyConnectionStatus        status,
-                                                            McPresence                       presence,
-                                                            TelepathyConnectionStatusReason  reason,
-                                                            const gchar                     *unique_name,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_button_create_clicked_cb  (GtkWidget                       *button,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_button_back_clicked_cb    (GtkWidget                       *button,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_button_connect_clicked_cb (GtkWidget                       *button,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_button_add_clicked_cb     (GtkWidget                       *button,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_remove_response_cb        (GtkWidget                       *dialog,
-                                                            gint                             response,
-                                                            McAccount                       *account);
-static void       accounts_dialog_button_remove_clicked_cb  (GtkWidget                       *button,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_treeview_row_activated_cb (GtkTreeView                     *tree_view,
-                                                            GtkTreePath                     *path,
-                                                            GtkTreeViewColumn               *column,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_response_cb               (GtkWidget                       *widget,
-                                                            gint                             response,
-                                                            EmpathyAccountsDialog            *dialog);
-static void       accounts_dialog_destroy_cb                (GtkWidget                       *widget,
-                                                            EmpathyAccountsDialog            *dialog);
+static void       accounts_dialog_setup                     (EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_update_account            (EmpathyAccountsDialog    *dialog,
+                                                            McAccount                *account);
+static void       accounts_dialog_model_setup               (EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_model_add_columns         (EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_model_select_first        (EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_model_pixbuf_data_func    (GtkTreeViewColumn        *tree_column,
+                                                            GtkCellRenderer          *cell,
+                                                            GtkTreeModel             *model,
+                                                            GtkTreeIter              *iter,
+                                                            EmpathyAccountsDialog    *dialog);
+static McAccount *accounts_dialog_model_get_selected        (EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_model_set_selected        (EmpathyAccountsDialog    *dialog,
+                                                            McAccount                *account);
+static gboolean   accounts_dialog_model_remove_selected     (EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_model_selection_changed   (GtkTreeSelection         *selection,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_add_account               (EmpathyAccountsDialog    *dialog,
+                                                            McAccount                *account);
+static void       accounts_dialog_account_added_cb          (McAccountMonitor         *monitor,
+                                                            gchar                    *unique_name,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_account_removed_cb        (McAccountMonitor         *monitor,
+                                                            gchar                    *unique_name,
+                                                            EmpathyAccountsDialog    *dialog);
+static gboolean   accounts_dialog_row_changed_foreach       (GtkTreeModel             *model,
+                                                            GtkTreePath              *path,
+                                                            GtkTreeIter              *iter,
+                                                            gpointer                  user_data);
+static gboolean   accounts_dialog_flash_connecting_cb       (EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_status_changed_cb         (MissionControl           *mc,
+                                                            TpConnectionStatus        status,
+                                                            McPresence                presence,
+                                                            TpConnectionStatusReason  reason,
+                                                            const gchar              *unique_name,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_button_create_clicked_cb  (GtkWidget                *button,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_button_back_clicked_cb    (GtkWidget                *button,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_button_connect_clicked_cb (GtkWidget                *button,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_button_add_clicked_cb     (GtkWidget                *button,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_remove_response_cb        (GtkWidget                *dialog,
+                                                            gint                      response,
+                                                            McAccount                *account);
+static void       accounts_dialog_button_remove_clicked_cb  (GtkWidget                *button,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_treeview_row_activated_cb (GtkTreeView              *tree_view,
+                                                            GtkTreePath              *path,
+                                                            GtkTreeViewColumn        *column,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_response_cb               (GtkWidget                *widget,
+                                                            gint                      response,
+                                                            EmpathyAccountsDialog    *dialog);
+static void       accounts_dialog_destroy_cb                (GtkWidget                *widget,
+                                                            EmpathyAccountsDialog    *dialog);
 
 static void
 accounts_dialog_setup (EmpathyAccountsDialog *dialog)
@@ -169,9 +170,9 @@ accounts_dialog_setup (EmpathyAccountsDialog *dialog)
        accounts = mc_accounts_list ();
 
        for (l = accounts; l; l = l->next) {
-               McAccount                 *account;
-               const gchar               *name;
-               TelepathyConnectionStatus  status;
+               McAccount          *account;
+               const gchar        *name;
+               TpConnectionStatus  status;
 
                account = l->data;
 
@@ -192,7 +193,7 @@ accounts_dialog_setup (EmpathyAccountsDialog *dialog)
                accounts_dialog_status_changed_cb (dialog->mc,
                                                   status,
                                                   MC_PRESENCE_UNSET,
-                                                  TP_CONN_STATUS_REASON_NONE_SPECIFIED,
+                                                  TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED,
                                                   mc_account_get_unique_name (account),
                                                   dialog);
 
@@ -289,15 +290,15 @@ accounts_dialog_update_account (EmpathyAccountsDialog *dialog,
                config_ui = mc_profile_get_configuration_ui (profile);
                g_object_unref (profile);
 
-               if (!empathy_strdiff (config_ui, "jabber")) {
+               if (!tp_strdiff (config_ui, "jabber")) {
                        dialog->settings_widget = 
                                empathy_account_widget_jabber_new (account);
                } 
-               else if (!empathy_strdiff (config_ui, "msn")) {
+               else if (!tp_strdiff (config_ui, "msn")) {
                        dialog ->settings_widget =
                                empathy_account_widget_msn_new (account);
                }
-               else if (!empathy_strdiff (config_ui, "local-xmpp")) {
+               else if (!tp_strdiff (config_ui, "local-xmpp")) {
                        dialog->settings_widget =
                                empathy_account_widget_salut_new (account);
                }
@@ -452,10 +453,10 @@ accounts_dialog_model_pixbuf_data_func (GtkTreeViewColumn    *tree_column,
                                        GtkTreeIter          *iter,
                                        EmpathyAccountsDialog *dialog)
 {
-       McAccount                 *account;
-       const gchar               *icon_name;
-       GdkPixbuf                 *pixbuf;
-       TelepathyConnectionStatus  status;
+       McAccount          *account;
+       const gchar        *icon_name;
+       GdkPixbuf          *pixbuf;
+       TpConnectionStatus  status;
 
        gtk_tree_model_get (model, iter,
                            COL_STATUS, &status,
@@ -466,8 +467,8 @@ accounts_dialog_model_pixbuf_data_func (GtkTreeViewColumn    *tree_column,
        pixbuf = empathy_pixbuf_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
 
        if (pixbuf) {
-               if (status == TP_CONN_STATUS_DISCONNECTED ||
-                   (status == TP_CONN_STATUS_CONNECTING && 
+               if (status == TP_CONNECTION_STATUS_DISCONNECTED ||
+                   (status == TP_CONNECTION_STATUS_CONNECTING && 
                     !dialog->connecting_show)) {
                        GdkPixbuf *modded_pixbuf;
 
@@ -602,13 +603,13 @@ static void
 accounts_dialog_add_account (EmpathyAccountsDialog *dialog,
                             McAccount            *account)
 {
-       TelepathyConnectionStatus  status;
-       const gchar               *name;
-       GtkTreeView               *view;
-       GtkTreeModel              *model;
-       GtkListStore              *store;
-       GtkTreeIter                iter;
-       gboolean                   ok;
+       TpConnectionStatus  status;
+       const gchar        *name;
+       GtkTreeView        *view;
+       GtkTreeModel       *model;
+       GtkListStore       *store;
+       GtkTreeIter         iter;
+       gboolean            ok;
 
        view = GTK_TREE_VIEW (dialog->treeview);
        model = gtk_tree_view_get_model (view);
@@ -702,12 +703,12 @@ accounts_dialog_flash_connecting_cb (EmpathyAccountsDialog *dialog)
 }
 
 static void
-accounts_dialog_status_changed_cb (MissionControl                  *mc,
-                                  TelepathyConnectionStatus        status,
-                                  McPresence                       presence,
-                                  TelepathyConnectionStatusReason  reason,
-                                  const gchar                     *unique_name,
-                                  EmpathyAccountsDialog           *dialog)
+accounts_dialog_status_changed_cb (MissionControl           *mc,
+                                  TpConnectionStatus        status,
+                                  McPresence                presence,
+                                  TpConnectionStatusReason  reason,
+                                  const gchar              *unique_name,
+                                  EmpathyAccountsDialog    *dialog)
 {
        GtkTreeView      *view;
        GtkTreeSelection *selection;
@@ -760,13 +761,13 @@ accounts_dialog_status_changed_cb (MissionControl                  *mc,
        /* Check if there is still accounts in CONNECTING state */
        accounts = mc_accounts_list ();
        for (l = accounts; l; l = l->next) {
-               McAccount                 *this_account;
-               TelepathyConnectionStatus  status;
+               McAccount          *this_account;
+               TpConnectionStatus  status;
 
                this_account = l->data;
 
                status = mission_control_get_connection_status (mc, this_account, NULL);
-               if (status == TP_CONN_STATUS_CONNECTING) {
+               if (status == TP_CONNECTION_STATUS_CONNECTING) {
                        found = TRUE;
                        break;
                }
index 30ec5d53cc017676287f443190d66b1d9f31dab0..1ea2985ce42b902e9230052d4302765e510bf4d2 100644 (file)
@@ -92,60 +92,60 @@ typedef struct {
        GtkTextIter  end;
 } EmpathyChatSpell;
 
-static void             empathy_chat_class_init           (EmpathyChatClass              *klass);
-static void             empathy_chat_init                 (EmpathyChat                   *chat);
-static void             chat_finalize                     (GObject                       *object);
-static void             chat_destroy_cb                   (EmpathyTpChat                 *tp_chat,
-                                                          EmpathyChat                   *chat);
-static void             chat_send                         (EmpathyChat                   *chat,
-                                                          const gchar                   *msg);
-static void             chat_input_text_view_send         (EmpathyChat                   *chat);
-static void             chat_message_received_cb          (EmpathyTpChat                 *tp_chat,
-                                                          EmpathyMessage                *message,
-                                                          EmpathyChat                   *chat);
-static void             chat_send_error_cb                (EmpathyTpChat                 *tp_chat,
-                                                          EmpathyMessage                *message,
-                                                          TelepathyChannelTextSendError  error_code,
-                                                          EmpathyChat                   *chat);
-void                    chat_sent_message_add             (EmpathyChat                   *chat,
-                                                          const gchar                   *str);
-const gchar *           chat_sent_message_get_next        (EmpathyChat                   *chat);
-const gchar *           chat_sent_message_get_last        (EmpathyChat                   *chat);
-static gboolean         chat_input_key_press_event_cb     (GtkWidget                     *widget,
-                                                          GdkEventKey                   *event,
-                                                          EmpathyChat                   *chat);
-static void             chat_input_text_buffer_changed_cb (GtkTextBuffer                 *buffer,
-                                                          EmpathyChat                   *chat);
-static gboolean         chat_text_view_focus_in_event_cb  (GtkWidget                     *widget,
-                                                          GdkEvent                      *event,
-                                                          EmpathyChat                   *chat);
-static void             chat_text_view_scroll_hide_cb     (GtkWidget                     *widget,
-                                                          EmpathyChat                   *chat);
-static void             chat_text_view_size_allocate_cb   (GtkWidget                     *widget,
-                                                          GtkAllocation                 *allocation,
-                                                          EmpathyChat                   *chat);
-static void             chat_text_view_realize_cb         (GtkWidget                     *widget,
-                                                          EmpathyChat                   *chat);
-static void             chat_text_populate_popup_cb       (GtkTextView                   *view,
-                                                          GtkMenu                       *menu,
-                                                          EmpathyChat                   *chat);
-static void             chat_text_check_word_spelling_cb  (GtkMenuItem                   *menuitem,
-                                                          EmpathyChatSpell              *chat_spell);
-static EmpathyChatSpell *chat_spell_new                   (EmpathyChat                   *chat,
-                                                          const gchar                   *word,
-                                                          GtkTextIter                    start,
-                                                          GtkTextIter                    end);
-static void             chat_spell_free                   (EmpathyChatSpell              *chat_spell);
-static void             chat_composing_start              (EmpathyChat                   *chat);
-static void             chat_composing_stop               (EmpathyChat                   *chat);
-static void             chat_composing_remove_timeout     (EmpathyChat                   *chat);
-static gboolean         chat_composing_stop_timeout_cb    (EmpathyChat                   *chat);
-static void             chat_state_changed_cb             (EmpathyTpChat                 *tp_chat,
-                                                          EmpathyContact                *contact,
-                                                          TelepathyChannelChatState      state,
-                                                          EmpathyChat                   *chat);
-static void             chat_add_logs                     (EmpathyChat                   *chat);
-static gboolean         chat_scroll_down_idle_func        (EmpathyChat                   *chat);
+static void             empathy_chat_class_init           (EmpathyChatClass       *klass);
+static void             empathy_chat_init                 (EmpathyChat            *chat);
+static void             chat_finalize                     (GObject                *object);
+static void             chat_destroy_cb                   (EmpathyTpChat          *tp_chat,
+                                                          EmpathyChat            *chat);
+static void             chat_send                         (EmpathyChat            *chat,
+                                                          const gchar            *msg);
+static void             chat_input_text_view_send         (EmpathyChat            *chat);
+static void             chat_message_received_cb          (EmpathyTpChat          *tp_chat,
+                                                          EmpathyMessage         *message,
+                                                          EmpathyChat            *chat);
+static void             chat_send_error_cb                (EmpathyTpChat          *tp_chat,
+                                                          EmpathyMessage         *message,
+                                                          TpChannelTextSendError  error_code,
+                                                          EmpathyChat            *chat);
+void                    chat_sent_message_add             (EmpathyChat            *chat,
+                                                          const gchar            *str);
+const gchar *           chat_sent_message_get_next        (EmpathyChat            *chat);
+const gchar *           chat_sent_message_get_last        (EmpathyChat            *chat);
+static gboolean         chat_input_key_press_event_cb     (GtkWidget              *widget,
+                                                          GdkEventKey            *event,
+                                                          EmpathyChat            *chat);
+static void             chat_input_text_buffer_changed_cb (GtkTextBuffer          *buffer,
+                                                          EmpathyChat            *chat);
+static gboolean         chat_text_view_focus_in_event_cb  (GtkWidget              *widget,
+                                                          GdkEvent               *event,
+                                                          EmpathyChat            *chat);
+static void             chat_text_view_scroll_hide_cb     (GtkWidget              *widget,
+                                                          EmpathyChat            *chat);
+static void             chat_text_view_size_allocate_cb   (GtkWidget              *widget,
+                                                          GtkAllocation          *allocation,
+                                                          EmpathyChat            *chat);
+static void             chat_text_view_realize_cb         (GtkWidget              *widget,
+                                                          EmpathyChat            *chat);
+static void             chat_text_populate_popup_cb       (GtkTextView            *view,
+                                                          GtkMenu                *menu,
+                                                          EmpathyChat            *chat);
+static void             chat_text_check_word_spelling_cb  (GtkMenuItem            *menuitem,
+                                                          EmpathyChatSpell       *chat_spell);
+static EmpathyChatSpell *chat_spell_new                   (EmpathyChat            *chat,
+                                                          const gchar            *word,
+                                                          GtkTextIter             start,
+                                                          GtkTextIter             end);
+static void             chat_spell_free                   (EmpathyChatSpell       *chat_spell);
+static void             chat_composing_start              (EmpathyChat            *chat);
+static void             chat_composing_stop               (EmpathyChat            *chat);
+static void             chat_composing_remove_timeout     (EmpathyChat            *chat);
+static gboolean         chat_composing_stop_timeout_cb    (EmpathyChat            *chat);
+static void             chat_state_changed_cb             (EmpathyTpChat          *tp_chat,
+                                                          EmpathyContact         *contact,
+                                                          TpChannelChatState      state,
+                                                          EmpathyChat            *chat);
+static void             chat_add_logs                     (EmpathyChat            *chat);
+static gboolean         chat_scroll_down_idle_func        (EmpathyChat            *chat);
 
 enum {
        COMPOSING,
@@ -436,10 +436,10 @@ chat_message_received_cb (EmpathyTpChat  *tp_chat,
 }
 
 static void
-chat_send_error_cb (EmpathyTpChat                 *tp_chat,
-                   EmpathyMessage                *message,
-                   TelepathyChannelTextSendError  error_code,
-                   EmpathyChat                   *chat)
+chat_send_error_cb (EmpathyTpChat          *tp_chat,
+                   EmpathyMessage         *message,
+                   TpChannelTextSendError  error_code,
+                   EmpathyChat            *chat)
 {
        const gchar *error;
        gchar       *str;
@@ -1075,10 +1075,10 @@ chat_composing_stop_timeout_cb (EmpathyChat *chat)
 }
 
 static void
-chat_state_changed_cb (EmpathyTpChat             *tp_chat,
-                      EmpathyContact             *contact,
-                      TelepathyChannelChatState  state,
-                      EmpathyChat                *chat)
+chat_state_changed_cb (EmpathyTpChat      *tp_chat,
+                      EmpathyContact     *contact,
+                      TpChannelChatState  state,
+                      EmpathyChat        *chat)
 {
        EmpathyChatPriv *priv;
        GList          *l;
index 54d62a3d074fec674e66460e47688e6a775f4b2c..68f63f64660a135d0499f507122da246a06f0cf5 100644 (file)
@@ -233,15 +233,15 @@ static gboolean
 can_add_contact_to_account (McAccount *account,
                            gpointer   user_data)
 {
-       MissionControl            *mc;
-       TelepathyConnectionStatus  status;
-       McProfile                 *profile;
-       const gchar               *protocol_name;
+       MissionControl     *mc;
+       TpConnectionStatus  status;
+       McProfile          *profile;
+       const gchar        *protocol_name;
 
        mc = empathy_mission_control_new ();
        status = mission_control_get_connection_status (mc, account, NULL);
        g_object_unref (mc);
-       if (status != TP_CONN_STATUS_CONNECTED) {
+       if (status != TP_CONNECTION_STATUS_CONNECTED) {
                /* Account is disconnected */
                return FALSE;
        }
index 442db950f2075e7bad44de17ef69c305274474a5..948f728e579c16b67670646f6ade537f0cf56f3b 100644 (file)
@@ -33,6 +33,8 @@
 #include <glade/glade.h>
 #include <glib/gi18n.h>
 
+#include <telepathy-glib/util.h>
+
 #include <libempathy/empathy-tp-chat.h>
 #include <libempathy/empathy-tp-chatroom.h>
 #include <libempathy/empathy-contact.h>
@@ -561,7 +563,7 @@ group_chat_subject_notify_cb (EmpathyTpChat   *tp_chat,
        priv = GET_PRIV (chat);
 
        g_object_get (priv->tp_chat, "subject", &str, NULL);
-       if (!empathy_strdiff (priv->topic, str)) {
+       if (!tp_strdiff (priv->topic, str)) {
                g_free (str);
                return;
        }
index cde7dbf673fb1a06ac1e44789a88917b85ca82eb..399d0e5ee2091f8deaa028bd05f28b665d97b365 100644 (file)
@@ -95,80 +95,80 @@ typedef struct {
        GList                  *widgets_disconnected;   /* ... disconnected accounts */
 } EmpathyMainWindow;
 
-static void     main_window_destroy_cb                         (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_favorite_chatroom_menu_setup       (EmpathyMainWindow               *window);
-static void     main_window_favorite_chatroom_menu_added_cb    (EmpathyChatroomManager           *manager,
-                                                               EmpathyChatroom                  *chatroom,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_favorite_chatroom_menu_removed_cb  (EmpathyChatroomManager           *manager,
-                                                               EmpathyChatroom                  *chatroom,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_favorite_chatroom_menu_activate_cb (GtkMenuItem                     *menu_item,
-                                                               EmpathyChatroom                  *chatroom);
-static void     main_window_favorite_chatroom_menu_update      (EmpathyMainWindow               *window);
-static void     main_window_favorite_chatroom_menu_add         (EmpathyMainWindow               *window,
-                                                               EmpathyChatroom                  *chatroom);
-static void     main_window_favorite_chatroom_join             (EmpathyChatroom                  *chatroom);
-static void     main_window_chat_quit_cb                       (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_chat_new_message_cb                (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_chat_history_cb                    (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_room_join_new_cb                   (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_room_join_favorites_cb             (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_room_manage_favorites_cb           (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_chat_add_contact_cb                (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_chat_show_offline_cb               (GtkCheckMenuItem                *item,
-                                                               EmpathyMainWindow               *window);
-static gboolean main_window_edit_button_press_event_cb         (GtkWidget                       *widget,
-                                                               GdkEventButton                  *event,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_edit_accounts_cb                   (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_edit_personal_information_cb       (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_edit_preferences_cb                (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_help_about_cb                      (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_help_contents_cb                   (GtkWidget                       *widget,
-                                                               EmpathyMainWindow               *window);
-static gboolean main_window_throbber_button_press_event_cb     (GtkWidget                       *throbber_ebox,
-                                                               GdkEventButton                  *event,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_status_changed_cb                  (MissionControl                  *mc,
-                                                               TelepathyConnectionStatus        status,
-                                                               McPresence                       presence,
-                                                               TelepathyConnectionStatusReason  reason,
-                                                               const gchar                     *unique_name,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_update_status                      (EmpathyMainWindow               *window);
+static void     main_window_destroy_cb                         (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_favorite_chatroom_menu_setup       (EmpathyMainWindow        *window);
+static void     main_window_favorite_chatroom_menu_added_cb    (EmpathyChatroomManager   *manager,
+                                                               EmpathyChatroom          *chatroom,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_favorite_chatroom_menu_removed_cb  (EmpathyChatroomManager   *manager,
+                                                               EmpathyChatroom          *chatroom,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_favorite_chatroom_menu_activate_cb (GtkMenuItem              *menu_item,
+                                                               EmpathyChatroom          *chatroom);
+static void     main_window_favorite_chatroom_menu_update      (EmpathyMainWindow        *window);
+static void     main_window_favorite_chatroom_menu_add         (EmpathyMainWindow        *window,
+                                                               EmpathyChatroom          *chatroom);
+static void     main_window_favorite_chatroom_join             (EmpathyChatroom          *chatroom);
+static void     main_window_chat_quit_cb                       (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_chat_new_message_cb                (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_chat_history_cb                    (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_room_join_new_cb                   (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_room_join_favorites_cb             (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_room_manage_favorites_cb           (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_chat_add_contact_cb                (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_chat_show_offline_cb               (GtkCheckMenuItem         *item,
+                                                               EmpathyMainWindow        *window);
+static gboolean main_window_edit_button_press_event_cb         (GtkWidget                *widget,
+                                                               GdkEventButton           *event,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_edit_accounts_cb                   (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_edit_personal_information_cb       (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_edit_preferences_cb                (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_help_about_cb                      (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_help_contents_cb                   (GtkWidget                *widget,
+                                                               EmpathyMainWindow        *window);
+static gboolean main_window_throbber_button_press_event_cb     (GtkWidget                *throbber_ebox,
+                                                               GdkEventButton           *event,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_status_changed_cb                  (MissionControl           *mc,
+                                                               TpConnectionStatus        status,
+                                                               McPresence                presence,
+                                                               TpConnectionStatusReason  reason,
+                                                               const gchar              *unique_name,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_update_status                      (EmpathyMainWindow        *window);
 static void     main_window_accels_load                        (void);
 static void     main_window_accels_save                        (void);
-static void     main_window_connection_items_setup             (EmpathyMainWindow               *window,
-                                                               GladeXML                        *glade);
-static gboolean main_window_configure_event_timeout_cb         (EmpathyMainWindow               *window);
-static gboolean main_window_configure_event_cb                 (GtkWidget                       *widget,
-                                                               GdkEventConfigure               *event,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_notify_show_offline_cb             (EmpathyConf                      *conf,
-                                                               const gchar                     *key,
-                                                               gpointer                         check_menu_item);
-static void     main_window_notify_show_avatars_cb             (EmpathyConf                      *conf,
-                                                               const gchar                     *key,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_notify_compact_contact_list_cb     (EmpathyConf                      *conf,
-                                                               const gchar                     *key,
-                                                               EmpathyMainWindow               *window);
-static void     main_window_notify_sort_criterium_cb           (EmpathyConf                      *conf,
-                                                               const gchar                     *key,
-                                                               EmpathyMainWindow               *window);
+static void     main_window_connection_items_setup             (EmpathyMainWindow        *window,
+                                                               GladeXML                 *glade);
+static gboolean main_window_configure_event_timeout_cb         (EmpathyMainWindow        *window);
+static gboolean main_window_configure_event_cb                 (GtkWidget                *widget,
+                                                               GdkEventConfigure        *event,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_notify_show_offline_cb             (EmpathyConf              *conf,
+                                                               const gchar              *key,
+                                                               gpointer                  check_menu_item);
+static void     main_window_notify_show_avatars_cb             (EmpathyConf              *conf,
+                                                               const gchar              *key,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_notify_compact_contact_list_cb     (EmpathyConf              *conf,
+                                                               const gchar              *key,
+                                                               EmpathyMainWindow        *window);
+static void     main_window_notify_sort_criterium_cb           (EmpathyConf              *conf,
+                                                               const gchar              *key,
+                                                               EmpathyMainWindow        *window);
 
 GtkWidget *
 empathy_main_window_show (void)
@@ -874,12 +874,12 @@ main_window_error_display (EmpathyMainWindow *window,
 }
 
 static void
-main_window_status_changed_cb (MissionControl                  *mc,
-                              TelepathyConnectionStatus        status,
-                              McPresence                       presence,
-                              TelepathyConnectionStatusReason  reason,
-                              const gchar                     *unique_name,
-                              EmpathyMainWindow               *window)
+main_window_status_changed_cb (MissionControl           *mc,
+                              TpConnectionStatus        status,
+                              McPresence                presence,
+                              TpConnectionStatusReason  reason,
+                              const gchar              *unique_name,
+                              EmpathyMainWindow        *window)
 {
        McAccount *account;
 
@@ -887,45 +887,45 @@ main_window_status_changed_cb (MissionControl                  *mc,
 
        account = mc_account_lookup (unique_name);
 
-       if (status == TP_CONN_STATUS_DISCONNECTED &&
-           reason > TP_CONN_STATUS_REASON_REQUESTED) {
+       if (status == TP_CONNECTION_STATUS_DISCONNECTED &&
+           reason > TP_CONNECTION_STATUS_REASON_REQUESTED) {
                const gchar *message;
 
                switch (reason) {
-               case TP_CONN_STATUS_REASON_NETWORK_ERROR:
+               case TP_CONNECTION_STATUS_REASON_NETWORK_ERROR:
                        message = _("Network error");
                        break;
-               case TP_CONN_STATUS_REASON_AUTHENTICATION_FAILED:
+               case TP_CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED:
                        message = _("Authentication failed");
                        break;
-               case TP_CONN_STATUS_REASON_ENCRYPTION_ERROR:
+               case TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR:
                        message = _("Encryption error");
                        break;
-               case TP_CONN_STATUS_REASON_NAME_IN_USE:
+               case TP_CONNECTION_STATUS_REASON_NAME_IN_USE:
                        message = _("Name in use");
                        break;
-               case TP_CONN_STATUS_REASON_CERT_NOT_PROVIDED:
+               case TP_CONNECTION_STATUS_REASON_CERT_NOT_PROVIDED:
                        message = _("Certificate not provided");
                        break;
-               case TP_CONN_STATUS_REASON_CERT_UNTRUSTED:
+               case TP_CONNECTION_STATUS_REASON_CERT_UNTRUSTED:
                        message = _("Certificate untrusted");
                        break;
-               case TP_CONN_STATUS_REASON_CERT_EXPIRED:
+               case TP_CONNECTION_STATUS_REASON_CERT_EXPIRED:
                        message = _("Certificate expired");
                        break;
-               case TP_CONN_STATUS_REASON_CERT_NOT_ACTIVATED:
+               case TP_CONNECTION_STATUS_REASON_CERT_NOT_ACTIVATED:
                        message = _("Certificate not activated");
                        break;
-               case TP_CONN_STATUS_REASON_CERT_HOSTNAME_MISMATCH:
+               case TP_CONNECTION_STATUS_REASON_CERT_HOSTNAME_MISMATCH:
                        message = _("Certificate hostname mismatch");
                        break;
-               case TP_CONN_STATUS_REASON_CERT_FINGERPRINT_MISMATCH:
+               case TP_CONNECTION_STATUS_REASON_CERT_FINGERPRINT_MISMATCH:
                        message = _("Certificate fingerprint mismatch");
                        break;
-               case TP_CONN_STATUS_REASON_CERT_SELF_SIGNED:
+               case TP_CONNECTION_STATUS_REASON_CERT_SELF_SIGNED:
                        message = _("Certificate self signed");
                        break;
-               case TP_CONN_STATUS_REASON_CERT_OTHER_ERROR:
+               case TP_CONNECTION_STATUS_REASON_CERT_OTHER_ERROR:
                        message = _("Certificate error");
                        break;
                default:
@@ -936,7 +936,7 @@ main_window_status_changed_cb (MissionControl                  *mc,
                main_window_error_display (window, account, message);
        }
 
-       if (status == TP_CONN_STATUS_CONNECTED) {
+       if (status == TP_CONNECTION_STATUS_CONNECTED) {
                GtkWidget *error_widget;
 
                /* Account connected without error, remove error message if any */
index 468f6296a26a6a4597f835646e146edd6c47e22d..6f34a3985ddfb50fbc362f9665e8729d4b865420 100644 (file)
@@ -31,6 +31,7 @@
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 
+#include <telepathy-glib/util.h>
 #include <libmissioncontrol/mc-enum-types.h>
 
 #include <libempathy/empathy-idle.h>
@@ -823,7 +824,7 @@ presence_chooser_dialog_message_changed_cb (GtkWidget           *widget,
 
        messages = empathy_status_presets_get (presence, -1);
        for (l = messages; l; l = l->next) {
-               if (!empathy_strdiff (text, l->data)) {
+               if (!tp_strdiff (text, l->data)) {
                        found = TRUE;
                        break;
                }
index 5027722288e908d2c328995844b1b59a7a8ceae7..13b71bc751f97ff1270be9dc4f11efd9214371ad 100644 (file)
@@ -32,6 +32,8 @@
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
+#include <telepathy-glib/util.h>
+
 #include <libempathy/empathy-debug.h>
 #include <libempathy/empathy-utils.h>
 
@@ -293,7 +295,7 @@ empathy_status_presets_set_last (McPresence   state,
                preset = l->data;
 
                if (state == preset->state &&
-                   !empathy_strdiff (status, preset->status)) {
+                   !tp_strdiff (status, preset->status)) {
                        return;
                }
        }
@@ -332,7 +334,7 @@ empathy_status_presets_remove (McPresence   state,
                preset = l->data;
 
                if (state == preset->state &&
-                   !empathy_strdiff (status, preset->status)) {
+                   !tp_strdiff (status, preset->status)) {
                        status_preset_free (preset);
                        presets = g_list_delete_link (presets, l);
                        status_presets_file_save ();
index a38dcd6f7e060247b75deeee0da659209d8df0d2..efce645bad477ca882e292fc14188a6b7e999982 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "config.h"
 
+#include <telepathy-glib/util.h>
+
 #include "empathy-avatar.h"
 #include "empathy-utils.h"
 #include "empathy-debug.h"
@@ -56,7 +58,7 @@ avatar_get_filename (const gchar *token)
                                        NULL);
        g_mkdir_with_parents (avatar_path, 0700);
 
-       token_escaped = empathy_escape_as_identifier (token);
+       token_escaped = tp_escape_as_identifier (token);
        avatar_file = g_build_filename (avatar_path, token_escaped, NULL);
 
        g_free (token_escaped);
index 5bd51c9d825f54154022ade73520b3fed025273a..3365f171076e957d45654bb2e66b06bf615d0e49 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <string.h>
 
+#include <telepathy-glib/util.h>
 #include <libtelepathy/tp-conn.h>
 #include <libtelepathy/tp-conn-iface-aliasing-gen.h>
 #include <libtelepathy/tp-conn-iface-presence-gen.h>
@@ -486,7 +487,7 @@ contact_factory_avatar_maybe_update (ContactFactoryAccountData *account_data,
 
        /* Check if the avatar changed */
        avatar = empathy_contact_get_avatar (contact);
-       if (avatar && !empathy_strdiff (avatar->token, token)) {
+       if (avatar && !tp_strdiff (avatar->token, token)) {
                return TRUE;
        }
 
@@ -880,13 +881,13 @@ contact_factory_account_data_update (ContactFactoryAccountData *account_data)
        /* We got a new connection */
        account_data->tp_conn = tp_conn;
        account_data->aliasing_iface = tp_conn_get_interface (tp_conn,
-                                                             TELEPATHY_CONN_IFACE_ALIASING_QUARK);
+                                                             TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING);
        account_data->avatars_iface = tp_conn_get_interface (tp_conn,
-                                                            TELEPATHY_CONN_IFACE_AVATARS_QUARK);
+                                                             TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS);
        account_data->presence_iface = tp_conn_get_interface (tp_conn,
-                                                             TELEPATHY_CONN_IFACE_PRESENCE_QUARK);
+                                                             TP_IFACE_QUARK_CONNECTION_INTERFACE_PRESENCE);
        account_data->capabilities_iface = tp_conn_get_interface (tp_conn,
-                                                                 TELEPATHY_CONN_IFACE_CAPABILITIES_QUARK);
+                                                                 TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES);
 
        /* Connect signals */
        if (account_data->aliasing_iface) {
@@ -971,12 +972,12 @@ contact_factory_account_data_new (EmpathyContactFactory *factory,
 }
 
 static void
-contact_factory_status_changed_cb (MissionControl                  *mc,
-                                  TelepathyConnectionStatus        status,
-                                  McPresence                       presence,
-                                  TelepathyConnectionStatusReason  reason,
-                                  const gchar                     *unique_name,
-                                  EmpathyContactFactory           *factory)
+contact_factory_status_changed_cb (MissionControl           *mc,
+                                  TpConnectionStatus        status,
+                                  McPresence                presence,
+                                  TpConnectionStatusReason  reason,
+                                  const gchar              *unique_name,
+                                  EmpathyContactFactory    *factory)
 {
        EmpathyContactFactoryPriv *priv = GET_PRIV (factory);
        ContactFactoryAccountData *account_data;
index ad25cac0dd3e91b7febd4492d2fe90c3bb45bbae..219cf888607209e8e82c6198109bfaf402c6d65d 100644 (file)
@@ -164,16 +164,16 @@ contact_manager_add_account (EmpathyContactManager *manager,
 }
 
 static void
-contact_manager_status_changed_cb (MissionControl                  *mc,
-                                  TelepathyConnectionStatus        status,
-                                  McPresence                       presence,
-                                  TelepathyConnectionStatusReason  reason,
-                                  const gchar                     *unique_name,
-                                  EmpathyContactManager           *manager)
+contact_manager_status_changed_cb (MissionControl           *mc,
+                                  TpConnectionStatus        status,
+                                  McPresence                presence,
+                                  TpConnectionStatusReason  reason,
+                                  const gchar              *unique_name,
+                                  EmpathyContactManager    *manager)
 {
        McAccount *account;
 
-       if (status != TP_CONN_STATUS_CONNECTED) {
+       if (status != TP_CONNECTION_STATUS_CONNECTED) {
                /* We only care about newly connected accounts */
                return;
        }
index d4298a26c8281feaba47e83dba27e6a16a15d30b..3e84679945ae43e37f4a10288a94f33d4a730095 100644 (file)
@@ -318,7 +318,7 @@ tp_call_constructor (GType                  type,
 
        priv->group = empathy_tp_group_new (priv->account, priv->tp_chan);
        priv->streamed_iface = tp_chan_get_interface (priv->tp_chan,
-                                                     TELEPATHY_CHAN_IFACE_STREAMED_QUARK);
+                                                     TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA);
 
        /* Connect signals */
        dbus_g_proxy_connect_signal (priv->streamed_iface, "StreamAdded",
index b11725f48e1eb23b77754896f45d596f30881ff3..6a871822e8fb19839dedac19fa5d155a275ab32c 100644 (file)
@@ -55,58 +55,58 @@ struct _EmpathyTpChatPriv {
        DBusGProxy            *chat_state_iface;
 };
 
-static void             empathy_tp_chat_class_init    (EmpathyTpChatClass        *klass);
-static void             empathy_tp_chat_init          (EmpathyTpChat             *chat);
-static void             tp_chat_finalize              (GObject                   *object);
-static GObject *        tp_chat_constructor           (GType                      type,
-                                                      guint                      n_props,
-                                                      GObjectConstructParam     *props);
-static void             tp_chat_get_property          (GObject                   *object,
-                                                      guint                      param_id,
-                                                      GValue                    *value,
-                                                      GParamSpec                *pspec);
-static void             tp_chat_set_property          (GObject                   *object,
-                                                      guint                      param_id,
-                                                      const GValue              *value,
-                                                      GParamSpec                *pspec);
-static void             tp_chat_destroy_cb            (TpChan                    *text_chan,
-                                                      EmpathyTpChat             *chat);
-static void             tp_chat_closed_cb             (TpChan                    *text_chan,
-                                                      EmpathyTpChat             *chat);
-static void             tp_chat_received_cb           (DBusGProxy                *text_iface,
-                                                      guint                      message_id,
-                                                      guint                      timestamp,
-                                                      guint                      from_handle,
-                                                      guint                      message_type,
-                                                      guint                      message_flags,
-                                                      gchar                     *message_body,
-                                                      EmpathyTpChat             *chat);
-static void             tp_chat_sent_cb               (DBusGProxy                *text_iface,
-                                                      guint                      timestamp,
-                                                      guint                      message_type,
-                                                      gchar                     *message_body,
-                                                      EmpathyTpChat             *chat);
-static void             tp_chat_send_error_cb         (DBusGProxy                *text_iface,
-                                                      guint                      error_code,
-                                                      guint                      timestamp,
-                                                      guint                      message_type,
-                                                      gchar                     *message_body,
-                                                      EmpathyTpChat             *chat);
-static void             tp_chat_state_changed_cb      (DBusGProxy                *chat_state_iface,
-                                                      guint                      handle,
-                                                      TelepathyChannelChatState  state,
-                                                      EmpathyTpChat             *chat);
-static EmpathyMessage * tp_chat_build_message         (EmpathyTpChat             *chat,
-                                                      guint                      type,
-                                                      guint                      timestamp,
-                                                      guint                      from_handle,
-                                                      const gchar               *message_body);
-static void             tp_chat_properties_ready_cb   (TpPropsIface              *props_iface,
-                                                      EmpathyTpChat             *chat);
-static void             tp_chat_properties_changed_cb (TpPropsIface              *props_iface,
-                                                      guint                      prop_id,
-                                                      TpPropsChanged             flag,
-                                                      EmpathyTpChat             *chat);
+static void             empathy_tp_chat_class_init    (EmpathyTpChatClass    *klass);
+static void             empathy_tp_chat_init          (EmpathyTpChat         *chat);
+static void             tp_chat_finalize              (GObject               *object);
+static GObject *        tp_chat_constructor           (GType                  type,
+                                                      guint                  n_props,
+                                                      GObjectConstructParam *props);
+static void             tp_chat_get_property          (GObject               *object,
+                                                      guint                  param_id,
+                                                      GValue                *value,
+                                                      GParamSpec            *pspec);
+static void             tp_chat_set_property          (GObject               *object,
+                                                      guint                  param_id,
+                                                      const GValue          *value,
+                                                      GParamSpec            *pspec);
+static void             tp_chat_destroy_cb            (TpChan                *text_chan,
+                                                      EmpathyTpChat         *chat);
+static void             tp_chat_closed_cb             (TpChan                *text_chan,
+                                                      EmpathyTpChat         *chat);
+static void             tp_chat_received_cb           (DBusGProxy            *text_iface,
+                                                      guint                  message_id,
+                                                      guint                  timestamp,
+                                                      guint                  from_handle,
+                                                      guint                  message_type,
+                                                      guint                  message_flags,
+                                                      gchar                 *message_body,
+                                                      EmpathyTpChat         *chat);
+static void             tp_chat_sent_cb               (DBusGProxy            *text_iface,
+                                                      guint                  timestamp,
+                                                      guint                  message_type,
+                                                      gchar                 *message_body,
+                                                      EmpathyTpChat         *chat);
+static void             tp_chat_send_error_cb         (DBusGProxy            *text_iface,
+                                                      guint                  error_code,
+                                                      guint                  timestamp,
+                                                      guint                  message_type,
+                                                      gchar                 *message_body,
+                                                      EmpathyTpChat         *chat);
+static void             tp_chat_state_changed_cb      (DBusGProxy            *chat_state_iface,
+                                                      guint                  handle,
+                                                      TpChannelChatState     state,
+                                                      EmpathyTpChat         *chat);
+static EmpathyMessage * tp_chat_build_message         (EmpathyTpChat         *chat,
+                                                      guint                  type,
+                                                      guint                  timestamp,
+                                                      guint                  from_handle,
+                                                      const gchar           *message_body);
+static void             tp_chat_properties_ready_cb   (TpPropsIface          *props_iface,
+                                                      EmpathyTpChat         *chat);
+static void             tp_chat_properties_changed_cb (TpPropsIface          *props_iface,
+                                                      guint                  prop_id,
+                                                      TpPropsChanged         flag,
+                                                      EmpathyTpChat         *chat);
 enum {
        PROP_0,
        PROP_ACCOUNT,
@@ -416,11 +416,11 @@ tp_chat_constructor (GType                  type,
        priv->mc = empathy_mission_control_new ();
 
        priv->text_iface = tp_chan_get_interface (priv->tp_chan,
-                                                 TELEPATHY_CHAN_IFACE_TEXT_QUARK);
+                                                 TP_IFACE_QUARK_CHANNEL_TYPE_TEXT);
        priv->chat_state_iface = tp_chan_get_interface (priv->tp_chan,
-                                                       TELEPATHY_CHAN_IFACE_CHAT_STATE_QUARK);
+                                                       TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE);
        priv->props_iface = tp_chan_get_interface (priv->tp_chan,
-                                                  TELEPATHY_PROPS_IFACE_QUARK);
+                                                  TP_IFACE_QUARK_PROPERTIES_INTERFACE);
 
        g_signal_connect (priv->tp_chan, "destroy",
                          G_CALLBACK (tp_chat_destroy_cb),
@@ -736,8 +736,8 @@ empathy_tp_chat_send (EmpathyTpChat *chat,
 }
 
 void
-empathy_tp_chat_set_state (EmpathyTpChat             *chat,
-                          TelepathyChannelChatState  state)
+empathy_tp_chat_set_state (EmpathyTpChat      *chat,
+                          TpChannelChatState  state)
 {
        EmpathyTpChatPriv *priv;
        GError            *error = NULL;
@@ -891,10 +891,10 @@ tp_chat_send_error_cb (DBusGProxy    *text_iface,
 }
 
 static void
-tp_chat_state_changed_cb (DBusGProxy                *chat_state_iface,
-                         guint                      handle,
-                         TelepathyChannelChatState  state,
-                         EmpathyTpChat             *chat)
+tp_chat_state_changed_cb (DBusGProxy         *chat_state_iface,
+                         guint               handle,
+                         TpChannelChatState  state,
+                         EmpathyTpChat      *chat)
 {
        EmpathyTpChatPriv *priv;
        EmpathyContact     *contact;
index 1c9d450c4d7bfbe2b5bbc92384aad58154bc24b8..cd807c983946a69780da3e1273c50824b48174c8 100644 (file)
@@ -55,19 +55,19 @@ struct _EmpathyTpChatClass {
 };
 
 GType          empathy_tp_chat_get_type             (void) G_GNUC_CONST;
-EmpathyTpChat *empathy_tp_chat_new                  (McAccount                 *account,
-                                                    TpChan                    *tp_chan);
-EmpathyTpChat *empathy_tp_chat_new_with_contact     (EmpathyContact            *contact);
-gboolean       empathy_tp_chat_get_acknowledge      (EmpathyTpChat             *chat);
-void           empathy_tp_chat_set_acknowledge      (EmpathyTpChat             *chat,
-                                                    gboolean                   acknowledge);
-TpChan *       empathy_tp_chat_get_channel          (EmpathyTpChat             *chat);
-GList *        empathy_tp_chat_get_pendings         (EmpathyTpChat             *chat);
-void           empathy_tp_chat_send                 (EmpathyTpChat             *chat,
-                                                    EmpathyMessage            *message);
-void           empathy_tp_chat_set_state            (EmpathyTpChat             *chat,
-                                                    TelepathyChannelChatState  state);
-const gchar *  empathy_tp_chat_get_id               (EmpathyTpChat             *chat);
+EmpathyTpChat *empathy_tp_chat_new                  (McAccount          *account,
+                                                    TpChan             *tp_chan);
+EmpathyTpChat *empathy_tp_chat_new_with_contact     (EmpathyContact     *contact);
+gboolean       empathy_tp_chat_get_acknowledge      (EmpathyTpChat      *chat);
+void           empathy_tp_chat_set_acknowledge      (EmpathyTpChat      *chat,
+                                                    gboolean            acknowledge);
+TpChan *       empathy_tp_chat_get_channel          (EmpathyTpChat      *chat);
+GList *        empathy_tp_chat_get_pendings         (EmpathyTpChat      *chat);
+void           empathy_tp_chat_send                 (EmpathyTpChat      *chat,
+                                                    EmpathyMessage     *message);
+void           empathy_tp_chat_set_state            (EmpathyTpChat      *chat,
+                                                    TpChannelChatState  state);
+const gchar *  empathy_tp_chat_get_id               (EmpathyTpChat      *chat);
 
 G_END_DECLS
 
index 76def9d316845fa8bae7afafa68d609336f37d01..8051501778d01f7169f224daf1c55e82267573ea 100644 (file)
@@ -345,7 +345,7 @@ static void
 tp_contact_list_newchannel_cb (DBusGProxy           *proxy,
                               const gchar          *object_path,
                               const gchar          *channel_type,
-                              TelepathyHandleType   handle_type,
+                              TpHandleType          handle_type,
                               guint                 channel_handle,
                               gboolean              suppress_handler,
                               EmpathyTpContactList *list)
@@ -541,18 +541,18 @@ tp_contact_list_disconnect (EmpathyTpContactList *list)
 }
 
 static void
-tp_contact_list_status_changed_cb (MissionControl                  *mc,
-                                  TelepathyConnectionStatus        status,
-                                  McPresence                       presence,
-                                  TelepathyConnectionStatusReason  reason,
-                                  const gchar                     *unique_name,
-                                  EmpathyTpContactList            *list)
+tp_contact_list_status_changed_cb (MissionControl           *mc,
+                                  TpConnectionStatus        status,
+                                  McPresence                presence,
+                                  TpConnectionStatusReason  reason,
+                                  const gchar              *unique_name,
+                                  EmpathyTpContactList     *list)
 {
        EmpathyTpContactListPriv *priv = GET_PRIV (list);
        McAccount                *account;
 
        account = mc_account_lookup (unique_name);
-       if (status != TP_CONN_STATUS_CONNECTED &&
+       if (status != TP_CONNECTION_STATUS_CONNECTED &&
            empathy_account_equal (account, priv->account)) {
                /* We are disconnected */
                tp_contact_list_disconnect (list);
@@ -662,11 +662,11 @@ tp_contact_list_setup (EmpathyTpContactList *list)
        }
 
        for (i = 0; i < channels->len; i++) {
-               GValueArray         *chan_struct;
-               const gchar         *object_path;
-               const gchar         *chan_iface;
-               TelepathyHandleType  handle_type;
-               guint                handle;
+               GValueArray  *chan_struct;
+               const gchar  *object_path;
+               const gchar  *chan_iface;
+               TpHandleType  handle_type;
+               guint         handle;
 
                chan_struct = g_ptr_array_index (channels, i);
                object_path = g_value_get_boxed (g_value_array_get_nth (chan_struct, 0));
index ff04648a302a43e8a94578a0d40d672390e67720..e648d40ab885fa433c1cc626e340de4bbcc9dcff 100644 (file)
@@ -565,7 +565,7 @@ empathy_tp_group_new (McAccount *account,
        g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
 
        group_iface = tp_chan_get_interface (tp_chan,
-                                            TELEPATHY_CHAN_IFACE_GROUP_QUARK);
+                                            TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP);
        g_return_val_if_fail (group_iface != NULL, NULL);
 
        group = g_object_new (EMPATHY_TYPE_TP_GROUP, NULL);
index a091bf9ff908b862eb4a747fd78025d8af5f64c6..0b161346a5e71e510b596c8b8daaecf541235f12 100644 (file)
@@ -182,7 +182,7 @@ empathy_tp_roomlist_new (McAccount *account)
 
        priv->account = g_object_ref (account);
        priv->roomlist_iface = tp_chan_get_interface (priv->tp_chan,
-                                                     TELEPATHY_CHAN_IFACE_ROOMLIST_QUARK);
+                                                     TP_IFACE_QUARK_CHANNEL_TYPE_ROOM_LIST);
 
        g_signal_connect (priv->tp_chan, "destroy",
                          G_CALLBACK (tp_roomlist_destroy_cb),
index 032b121ea66295039e4d981988caeda4998bf3b8..f322f0288a1f73f8c90f991e4ea81c84105d79f6 100644 (file)
@@ -199,82 +199,6 @@ empathy_strncasecmp (const gchar *s1,
        return ret_val;
 }
 
-/* Stolen from telepathy-glib */
-gboolean
-empathy_strdiff (const gchar *left, const gchar *right)
-{
-  if ((NULL == left) != (NULL == right))
-    return TRUE;
-
-  else if (left == right)
-    return FALSE;
-
-  else
-    return (0 != strcmp (left, right));
-}
-
-/* Stolen from telepathy-glib */
-static inline gboolean
-_esc_ident_bad (gchar c, gboolean is_first)
-{
-  return ((c < 'a' || c > 'z') &&
-          (c < 'A' || c > 'Z') &&
-          (c < '0' || c > '9' || is_first));
-}
-
-/* Stolen from telepathy-glib */
-gchar *
-empathy_escape_as_identifier (const gchar *name)
-{
-  gboolean bad = FALSE;
-  size_t len = 0;
-  GString *op;
-  const gchar *ptr, *first_ok;
-
-  g_return_val_if_fail (name != NULL, NULL);
-
-  for (ptr = name; *ptr; ptr++)
-    {
-      if (_esc_ident_bad (*ptr, ptr == name))
-        {
-          bad = TRUE;
-          len += 3;
-        }
-      else
-        len++;
-    }
-
-  /* fast path if it's clean */
-  if (!bad)
-    return g_strdup (name);
-
-  /* If strictly less than ptr, first_ok is the first uncopied safe character.
-   */
-  first_ok = name;
-  op = g_string_sized_new (len);
-  for (ptr = name; *ptr; ptr++)
-    {
-      if (_esc_ident_bad (*ptr, ptr == name))
-        {
-          /* copy preceding safe characters if any */
-          if (first_ok < ptr)
-            {
-              g_string_append_len (op, first_ok, ptr - first_ok);
-            }
-          /* escape the unsafe character */
-          g_string_append_printf (op, "_%02x", (unsigned char)(*ptr));
-          /* restart after it */
-          first_ok = ptr + 1;
-        }
-    }
-  /* copy trailing safe characters if any */
-  if (first_ok < ptr)
-    {
-      g_string_append_len (op, first_ok, ptr - first_ok);
-    }
-  return g_string_free (op, FALSE);
-}
-
 gboolean
 empathy_xml_validate (xmlDoc      *doc,
                     const gchar *dtd_filename)
index 587adaedce5d78cb545976851b8b23461a1af819..746e8de5b7e794cfc60dc212e60daffe369f80fe 100644 (file)
@@ -66,9 +66,6 @@ gint         empathy_strcasecmp                     (const gchar     *s1,
 gint         empathy_strncasecmp                    (const gchar     *s1,
                                                    const gchar     *s2,
                                                    gsize            n);
-gboolean     empathy_strdiff                        (const gchar     *left,
-                                                    const gchar     *right);
-gchar *      empathy_escape_as_identifier           (const gchar     *name);
 
 /* XML */
 gboolean     empathy_xml_validate                   (xmlDoc          *doc,
index 697fe23df27b865d59b5b0a1fbbcb0aff53b2fb1..f9c032cf0f3889e1900cae206d32159973fd2640 100644 (file)
   )
 )
 
-(define-function empathy_strdiff
-  (c-name "empathy_strdiff")
-  (return-type "gboolean")
-  (parameters
-    '("const-gchar*" "left")
-    '("const-gchar*" "right")
-  )
-)
-
 
index fef01b808ed4512512b22ef1b2d6a9269da8c9fd..cbb81931f997a020f08052a8095b133e5d548f13 100644 (file)
@@ -31,6 +31,7 @@
 #include <libebook/e-book.h>
 #include <libgnomevfs/gnome-vfs.h>
 
+#include <telepathy-glib/util.h>
 #include <libmissioncontrol/mc-account.h>
 #include <libmissioncontrol/mc-account-monitor.h>
 #include <libmissioncontrol/mission-control.h>
@@ -157,7 +158,7 @@ create_salut_account (void)
        email = e_contact_get (contact, E_CONTACT_EMAIL_1);
        jid = e_contact_get (contact, E_CONTACT_IM_JABBER_HOME_1);
        
-       if (G_STR_EMPTY (nickname) || !empathy_strdiff (nickname, "nickname")) {
+       if (G_STR_EMPTY (nickname) || !tp_strdiff (nickname, "nickname")) {
                g_free (nickname);
                nickname = g_strdup (g_get_user_name ());
        }