summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-05-06 15:06:30 +0100
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-05-06 15:06:30 +0100
commit9f18e04764d684e2527b052e8ab946d2f9062104 (patch)
treec326f442f96e1503d7c172fe7e9702745addd803
parent6e62e4311204176dbea2ea15cf3f76805bad3796 (diff)
parent376bd27843d83ee42e3d731f9856fff9d522aa3c (diff)
downloadempathy-9f18e04764d684e2527b052e8ab946d2f9062104.tar.gz
Merge branch 'empathy-skype' into debian
-rw-r--r--libempathy-gtk/empathy-account-widget-skype.c22
-rw-r--r--libempathy/empathy-tp-chat.c22
-rw-r--r--libempathy/empathy-tp-chat.h1
-rw-r--r--src/empathy-chat-manager.c11
-rw-r--r--src/empathy-chat-window.c62
-rw-r--r--src/empathy-chat-window.h4
6 files changed, 47 insertions, 75 deletions
diff --git a/libempathy-gtk/empathy-account-widget-skype.c b/libempathy-gtk/empathy-account-widget-skype.c
index 288fc039a..fb56ac561 100644
--- a/libempathy-gtk/empathy-account-widget-skype.c
+++ b/libempathy-gtk/empathy-account-widget-skype.c
@@ -461,16 +461,22 @@ account_widget_skype_additional_apply_async (EmpathyAccountWidget *self,
remember = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (remember_password));
+ DEBUG ("Setting password and remember-password (%u) on auth observer",
+ remember);
g_object_set_data_full (auth_observer, "password",
g_strdup (password), g_free);
g_object_set_data (auth_observer, "remember-password",
GUINT_TO_POINTER (remember));
- /* we have to forget the password, else psyke won't query for the new one */
- emp_cli_account_interface_external_password_storage_call_forget_password (
- TP_PROXY (account), -1,
- account_widget_skype_additional_apply_forget_passwd_cb,
- NULL, NULL, G_OBJECT (simple));
+ if (priv->contains_pending_changes)
+ {
+ /* forget the password, else psyke won't query for the new one */
+ DEBUG ("Forget the password so that Psyke queries for a new one");
+ emp_cli_account_interface_external_password_storage_call_forget_password (
+ TP_PROXY (account), -1,
+ account_widget_skype_additional_apply_forget_passwd_cb,
+ NULL, NULL, G_OBJECT (simple));
+ }
}
static gboolean
@@ -494,8 +500,6 @@ account_widget_build_skype_password_entry_focus (GtkWidget *password_entry,
{
DEBUG ("Highlighting Apply/Cancel button");
- self->ui_details->additional_apply_async =
- account_widget_skype_additional_apply_async;
empathy_account_widget_changed (self);
}
@@ -799,6 +803,10 @@ empathy_account_widget_build_skype (EmpathyAccountWidget *self,
TpAccount *account = empathy_account_settings_get_account (priv->settings);
GtkWidget *password_entry, *remember_password;
+ /* additional apply function */
+ self->ui_details->additional_apply_async =
+ account_widget_skype_additional_apply_async;
+
if (priv->simple || priv->creating_account)
{
GtkWidget *skype_info;
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 29f886416..665e87549 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -102,13 +102,14 @@ tp_chat_set_delivery_status (EmpathyTpChat *self,
EmpathyDeliveryStatus delivery_status)
{
EmpathyTpChatPriv *priv = GET_PRIV (self);
+ TpDeliveryReportingSupportFlags flags =
+ tp_text_channel_get_delivery_reporting_support (
+ TP_TEXT_CHANNEL (priv->channel));
/* channel must support receiving failures and successes */
if (!tp_str_empty (token) &&
- tp_text_channel_get_delivery_reporting_support (
- TP_TEXT_CHANNEL (priv->channel)) &
- (TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES |
- TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_SUCCESSES)) {
+ flags & TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES &&
+ flags & TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_SUCCESSES) {
DEBUG ("Delivery status (%s) = %u", token, delivery_status);
@@ -2067,19 +2068,6 @@ empathy_tp_chat_is_invited (EmpathyTpChat *self,
return tp_channel_group_get_local_pending_info (priv->channel, self_handle,
inviter, NULL, NULL);
}
-
-const char *
-empathy_tp_chat_get_channel_path (EmpathyTpChat *self)
-{
- EmpathyTpChatPriv *priv;
-
- g_return_val_if_fail (EMPATHY_IS_TP_CHAT (self), NULL);
-
- priv = GET_PRIV (self);
-
- return tp_proxy_get_object_path (priv->channel);
-}
-
gboolean
empathy_tp_chat_is_sms_channel (EmpathyTpChat *self)
{
diff --git a/libempathy/empathy-tp-chat.h b/libempathy/empathy-tp-chat.h
index 34651d13c..d34bc418e 100644
--- a/libempathy/empathy-tp-chat.h
+++ b/libempathy/empathy-tp-chat.h
@@ -113,7 +113,6 @@ void empathy_tp_chat_join (EmpathyTpChat *chat);
gboolean empathy_tp_chat_is_invited (EmpathyTpChat *chat,
TpHandle *inviter);
-const char * empathy_tp_chat_get_channel_path (EmpathyTpChat *chat);
gboolean empathy_tp_chat_is_sms_channel (EmpathyTpChat *chat);
G_END_DECLS
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c
index 8455001f5..b31684069 100644
--- a/src/empathy-chat-manager.c
+++ b/src/empathy-chat-manager.c
@@ -119,16 +119,19 @@ process_tp_chat (EmpathyTpChat *tp_chat,
gint64 user_action_time)
{
EmpathyChat *chat = NULL;
- const char *channel_path;
+ const gchar *id;
tell_chatroom_manager_if_needed (account, tp_chat);
- channel_path = empathy_tp_chat_get_channel_path (tp_chat);
- chat = empathy_chat_window_find_chat_by_channel (channel_path);
+ id = empathy_tp_chat_get_id (tp_chat);
+ if (!tp_str_empty (id))
+ {
+ chat = empathy_chat_window_find_chat (account, id,
+ empathy_tp_chat_is_sms_channel (tp_chat));
+ }
if (chat != NULL)
{
- DEBUG ("found chat %p for path %s", chat, channel_path);
empathy_chat_set_tp_chat (chat, tp_chat);
}
else
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index d498d8fec..7dcc996ac 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -146,8 +146,6 @@ static const GtkTargetEntry drag_types_dest_file[] = {
static void chat_window_update (EmpathyChatWindow *window,
gboolean update_contact_menu);
-static EmpathyChat *empathy_chat_window_find_chat (TpAccount *account,
- const gchar *id);
G_DEFINE_TYPE (EmpathyChatWindow, empathy_chat_window, G_TYPE_OBJECT);
@@ -737,12 +735,17 @@ chat_window_update_chat_tab_full (EmpathyChat *chat,
tp_account_get_display_name (account));
if (nb_sending > 0) {
- append_markup_printf (tooltip, "\n");
- append_markup_printf (tooltip,
- ngettext ("Sending %d message",
- "Sending %d messages",
- nb_sending),
- nb_sending);
+ char *tmp = g_strdup_printf (
+ ngettext ("Sending %d message",
+ "Sending %d messages",
+ nb_sending),
+ nb_sending);
+
+ g_string_append (tooltip, "\n");
+ g_string_append (tooltip, tmp);
+
+ gtk_widget_set_tooltip_text (sending_spinner, tmp);
+ g_free (tmp);
}
if (!EMP_STR_EMPTY (status)) {
@@ -1814,7 +1817,7 @@ chat_window_drag_data_received (GtkWidget *widget,
account =
tp_account_manager_ensure_account (account_manager, account_id);
if (account != NULL)
- chat = empathy_chat_window_find_chat (account, contact_id);
+ chat = empathy_chat_window_find_chat (account, contact_id, FALSE);
}
if (account == NULL) {
@@ -2390,9 +2393,10 @@ empathy_chat_window_has_focus (EmpathyChatWindow *window)
return has_focus;
}
-static EmpathyChat *
+EmpathyChat *
empathy_chat_window_find_chat (TpAccount *account,
- const gchar *id)
+ const gchar *id,
+ gboolean sms_channel)
{
GList *l;
@@ -2412,40 +2416,8 @@ empathy_chat_window_find_chat (TpAccount *account,
chat = ll->data;
if (account == empathy_chat_get_account (chat) &&
- !tp_strdiff (id, empathy_chat_get_id (chat))) {
- return chat;
- }
- }
- }
-
- return NULL;
-}
-
-EmpathyChat *
-empathy_chat_window_find_chat_by_channel (const char *channel_path)
-{
- GList *l;
-
- g_return_val_if_fail (!EMP_STR_EMPTY (channel_path), NULL);
-
- for (l = chat_windows; l; l = l->next) {
- EmpathyChatWindowPriv *priv;
- EmpathyChatWindow *window;
- GList *ll;
-
- window = l->data;
- priv = GET_PRIV (window);
-
- for (ll = priv->chats; ll; ll = ll->next) {
- EmpathyChat *chat;
- EmpathyTpChat *tp_chat;
- const char *path;
-
- chat = ll->data;
- tp_chat = empathy_chat_get_tp_chat (chat);
- path = empathy_tp_chat_get_channel_path (tp_chat);
-
- if (!tp_strdiff (channel_path, path)) {
+ !tp_strdiff (id, empathy_chat_get_id (chat)) &&
+ sms_channel == empathy_chat_is_sms_channel (chat)) {
return chat;
}
}
diff --git a/src/empathy-chat-window.h b/src/empathy-chat-window.h
index 33caec70c..f8425e172 100644
--- a/src/empathy-chat-window.h
+++ b/src/empathy-chat-window.h
@@ -70,7 +70,9 @@ void empathy_chat_window_move_chat (EmpathyChatWindow *old_wi
void empathy_chat_window_switch_to_chat (EmpathyChatWindow *window,
EmpathyChat *chat);
gboolean empathy_chat_window_has_focus (EmpathyChatWindow *window);
-EmpathyChat * empathy_chat_window_find_chat_by_channel (const char *path);
+EmpathyChat * empathy_chat_window_find_chat (TpAccount *account,
+ const gchar *id,
+ gboolean sms_channel);
void empathy_chat_window_present_chat (EmpathyChat *chat,
gint64 timestamp);