[empathy: 9/11] no need to pass the reason to empathy_account_get_error_message



commit 1707cb8bb953cb4886a8e3b8ab0eeddf0d6b0567
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Aug 5 14:14:34 2010 +0200

    no need to pass the reason to empathy_account_get_error_message

 libempathy/empathy-utils.c    |    6 ++++--
 libempathy/empathy-utils.h    |    3 +--
 src/empathy-accounts-dialog.c |    4 ++--
 src/empathy-main-window.c     |    2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index b0abaa9..b47987f 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -387,11 +387,11 @@ empathy_dbus_error_name_get_default_message  (const gchar *error)
 }
 
 const gchar *
-empathy_account_get_error_message (TpAccount *account,
-				   TpConnectionStatusReason reason)
+empathy_account_get_error_message (TpAccount *account)
 {
 	const gchar *dbus_error;
 	const gchar *message;
+	TpConnectionStatusReason reason;
 
 	dbus_error = tp_account_get_detailed_error (account, NULL);
 	message = empathy_dbus_error_name_get_default_message (dbus_error);
@@ -401,6 +401,8 @@ empathy_account_get_error_message (TpAccount *account,
 	DEBUG ("Don't understand error '%s'; fallback to the status reason (%u)",
 		dbus_error, reason);
 
+	tp_account_get_connection_status (account, &reason);
+
 	return empathy_status_reason_get_default_message (reason);
 }
 
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index 9930e65..47b9b84 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -76,8 +76,7 @@ gboolean     empathy_check_available_state          (void);
 gint        empathy_uint_compare                    (gconstpointer a,
 						     gconstpointer b);
 
-const gchar * empathy_account_get_error_message (TpAccount *account,
-						 TpConnectionStatusReason reason);
+const gchar * empathy_account_get_error_message (TpAccount *account);
 
 gchar *empathy_protocol_icon_name (const gchar *protocol);
 const gchar *empathy_protocol_name_to_display_name (const gchar *proto_name);
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index a3a771c..e797789 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -310,7 +310,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
                 gchar *message;
 
                 message = g_strdup_printf (_("Offline â?? %s"),
-                    empathy_account_get_error_message (account, reason));
+                    empathy_account_get_error_message (account));
                 gtk_info_bar_set_message_type (GTK_INFO_BAR (priv->infobar),
                     GTK_MESSAGE_WARNING);
 
@@ -322,7 +322,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
                 gchar *message;
 
                 message = g_strdup_printf (_("Disconnected â?? %s"),
-                    empathy_account_get_error_message (account, reason));
+                    empathy_account_get_error_message (account));
                 gtk_info_bar_set_message_type (GTK_INFO_BAR (priv->infobar),
                     GTK_MESSAGE_ERROR);
 
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index afca302..c6519be 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -435,7 +435,7 @@ main_window_error_display (EmpathyMainWindow *window,
 
 	str = g_markup_printf_escaped ("<b>%s</b>\n%s",
 					       tp_account_get_display_name (account),
-					       empathy_account_get_error_message (account, reason));
+					       empathy_account_get_error_message (account));
 
 	info_bar = g_hash_table_lookup (priv->errors, account);
 	if (info_bar) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]