diff options
author | Felix Kaser <f.kaser@gmx.net> | 2009-12-09 02:41:57 +0800 |
---|---|---|
committer | Felix Kaser <f.kaser@gmx.net> | 2009-12-15 20:52:45 +0800 |
commit | 0a39af61f6bab052ead17918ab372e0cbb8eab3c (patch) | |
tree | e50fc40b24b58e367e4821b60d48cda633212ff6 /libempathy | |
parent | 78eed901305de30ff164012604045bacf5cc38b6 (diff) | |
download | gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.gz gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.bz2 gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.lz gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.xz gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.zst gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.zip |
refactor friendly status reason messages
the friendly status reason can be asked from empathy-utils
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-utils.c | 37 | ||||
-rw-r--r-- | libempathy/empathy-utils.h | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index 3acd4707d..6fdd6d257 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -278,6 +278,43 @@ empathy_presence_from_str (const gchar *str) return TP_CONNECTION_PRESENCE_TYPE_UNSET; } +const gchar * +empathy_status_reason_get_default_message (TpConnectionStatusReason reason) +{ + switch (reason) { + case TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED: + return _("No reason specified"); + case TP_CONNECTION_STATUS_REASON_REQUESTED: + return _("User requested disconnect"); + case TP_CONNECTION_STATUS_REASON_NETWORK_ERROR: + return _("Network error"); + case TP_CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED: + return _("Authentication failed"); + case TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR: + return _("Encryption error"); + case TP_CONNECTION_STATUS_REASON_NAME_IN_USE: + return _("Name in use"); + case TP_CONNECTION_STATUS_REASON_CERT_NOT_PROVIDED: + return _("Certificate not provided"); + case TP_CONNECTION_STATUS_REASON_CERT_UNTRUSTED: + return _("Certificate untrusted"); + case TP_CONNECTION_STATUS_REASON_CERT_EXPIRED: + return _("Certificate expired"); + case TP_CONNECTION_STATUS_REASON_CERT_NOT_ACTIVATED: + return _("Certificate not activated"); + case TP_CONNECTION_STATUS_REASON_CERT_HOSTNAME_MISMATCH: + return _("Certificate hostname mismatch"); + case TP_CONNECTION_STATUS_REASON_CERT_FINGERPRINT_MISMATCH: + return _("Certificate fingerprint mismatch"); + case TP_CONNECTION_STATUS_REASON_CERT_SELF_SIGNED: + return _("Certificate self-signed"); + case TP_CONNECTION_STATUS_REASON_CERT_OTHER_ERROR: + return _("Certificate error"); + default: + return _("Unknown reason"); + } +} + gchar * empathy_file_lookup (const gchar *filename, const gchar *subdir) { diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 97e5e85b7..0fc6fc2a9 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -73,6 +73,7 @@ guint empathy_proxy_hash (gconstpointer key); gboolean empathy_check_available_state (void); gint empathy_uint_compare (gconstpointer a, gconstpointer b); +const gchar * empathy_status_reason_get_default_message (TpConnectionStatusReason reason); gchar *empathy_protocol_icon_name (const gchar *protocol); const gchar *empathy_protocol_name_to_display_name (const gchar *proto_name); |