From: Xavier Claessens Date: Sun, 2 Dec 2007 22:38:02 +0000 (+0000) Subject: Conflicts: X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=7bf5562a19ecac3c59dc23ebe507112e2745b635 Conflicts: ChangeLog svn path=/trunk/; revision=455 --- diff --git a/ChangeLog b/ChangeLog index 5b4dd7f1..36fdbd33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2007-12-02 Xavier Claessens + + * 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 * libempathy-gtk/Makefile.am: diff --git a/configure.ac b/configure.ac index 590d5442..af869c0e 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c index c9cfbed5..8c967417 100644 --- a/libempathy-gtk/empathy-account-chooser.c +++ b/libempathy-gtk/empathy-account-chooser.c @@ -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; } diff --git a/libempathy-gtk/empathy-accounts-dialog.c b/libempathy-gtk/empathy-accounts-dialog.c index f171664b..4c0719c2 100644 --- a/libempathy-gtk/empathy-accounts-dialog.c +++ b/libempathy-gtk/empathy-accounts-dialog.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -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; } diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 30ec5d53..1ea2985c 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -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; diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c index 54d62a3d..68f63f64 100644 --- a/libempathy-gtk/empathy-contact-dialogs.c +++ b/libempathy-gtk/empathy-contact-dialogs.c @@ -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; } diff --git a/libempathy-gtk/empathy-group-chat.c b/libempathy-gtk/empathy-group-chat.c index 442db950..948f728e 100644 --- a/libempathy-gtk/empathy-group-chat.c +++ b/libempathy-gtk/empathy-group-chat.c @@ -33,6 +33,8 @@ #include #include +#include + #include #include #include @@ -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; } diff --git a/libempathy-gtk/empathy-main-window.c b/libempathy-gtk/empathy-main-window.c index cde7dbf6..399d0e5e 100644 --- a/libempathy-gtk/empathy-main-window.c +++ b/libempathy-gtk/empathy-main-window.c @@ -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 */ diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c index 468f6296..6f34a398 100644 --- a/libempathy-gtk/empathy-presence-chooser.c +++ b/libempathy-gtk/empathy-presence-chooser.c @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -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; } diff --git a/libempathy-gtk/empathy-status-presets.c b/libempathy-gtk/empathy-status-presets.c index 50277222..13b71bc7 100644 --- a/libempathy-gtk/empathy-status-presets.c +++ b/libempathy-gtk/empathy-status-presets.c @@ -32,6 +32,8 @@ #include #include +#include + #include #include @@ -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 (); diff --git a/libempathy/empathy-avatar.c b/libempathy/empathy-avatar.c index a38dcd6f..efce645b 100644 --- a/libempathy/empathy-avatar.c +++ b/libempathy/empathy-avatar.c @@ -22,6 +22,8 @@ #include "config.h" +#include + #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); diff --git a/libempathy/empathy-contact-factory.c b/libempathy/empathy-contact-factory.c index 5bd51c9d..3365f171 100644 --- a/libempathy/empathy-contact-factory.c +++ b/libempathy/empathy-contact-factory.c @@ -23,6 +23,7 @@ #include +#include #include #include #include @@ -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; diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c index ad25cac0..219cf888 100644 --- a/libempathy/empathy-contact-manager.c +++ b/libempathy/empathy-contact-manager.c @@ -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; } diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-call.c index d4298a26..3e846799 100644 --- a/libempathy/empathy-tp-call.c +++ b/libempathy/empathy-tp-call.c @@ -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", diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index b11725f4..6a871822 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -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; diff --git a/libempathy/empathy-tp-chat.h b/libempathy/empathy-tp-chat.h index 1c9d450c..cd807c98 100644 --- a/libempathy/empathy-tp-chat.h +++ b/libempathy/empathy-tp-chat.h @@ -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 diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index 76def9d3..80515017 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -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)); diff --git a/libempathy/empathy-tp-group.c b/libempathy/empathy-tp-group.c index ff04648a..e648d40a 100644 --- a/libempathy/empathy-tp-group.c +++ b/libempathy/empathy-tp-group.c @@ -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); diff --git a/libempathy/empathy-tp-roomlist.c b/libempathy/empathy-tp-roomlist.c index a091bf9f..0b161346 100644 --- a/libempathy/empathy-tp-roomlist.c +++ b/libempathy/empathy-tp-roomlist.c @@ -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), diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index 032b121e..f322f028 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -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) diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 587adaed..746e8de5 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -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, diff --git a/python/pyempathy/pyempathy.defs b/python/pyempathy/pyempathy.defs index 697fe23d..f9c032cf 100644 --- a/python/pyempathy/pyempathy.defs +++ b/python/pyempathy/pyempathy.defs @@ -1751,13 +1751,4 @@ ) ) -(define-function empathy_strdiff - (c-name "empathy_strdiff") - (return-type "gboolean") - (parameters - '("const-gchar*" "left") - '("const-gchar*" "right") - ) -) - diff --git a/src/empathy.c b/src/empathy.c index fef01b80..cbb81931 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -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 ()); }