aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-utils.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-17 21:35:07 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-29 18:54:37 +0800
commitfc4059e17da2a94a3864f396b5de12d93865090d (patch)
treeb7e51c0ece0074708d6762786c88730c8cf20e6f /libempathy/empathy-utils.c
parent3a6aca03ec70cb11d23cfd68e72a51a4a49220a2 (diff)
downloadgsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.gz
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.bz2
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.lz
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.xz
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.zst
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.zip
Add empathy_service_name_to_display_name()
Also makes empathy_protocol_name_to_display_name() fallbacks to the protocol name so caller doesn't have to.
Diffstat (limited to 'libempathy/empathy-utils.c')
-rw-r--r--libempathy/empathy-utils.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 85953f8f9..e2e1f8a28 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -539,7 +539,6 @@ empathy_protocol_name_to_display_name (const gchar *proto_name)
gboolean translated;
} names[] = {
{ "jabber", "Jabber", FALSE },
- { "gtalk", "Google Talk", FALSE },
{ "msn", "MSN", FALSE, },
{ "local-xmpp", N_("People Nearby"), TRUE },
{ "irc", "IRC", FALSE },
@@ -547,7 +546,6 @@ empathy_protocol_name_to_display_name (const gchar *proto_name)
{ "aim", "AIM", FALSE },
{ "yahoo", "Yahoo!", FALSE },
{ "yahoojp", N_("Yahoo! Japan"), TRUE },
- { "facebook", N_("Facebook Chat"), TRUE },
{ "groupwise", "GroupWise", FALSE },
{ "sip", "SIP", FALSE },
{ NULL, NULL }
@@ -564,7 +562,35 @@ empathy_protocol_name_to_display_name (const gchar *proto_name)
}
}
- return NULL;
+ return proto_name;
+}
+
+const char *
+empathy_service_name_to_display_name (const gchar *service_name)
+{
+ int i;
+ static struct {
+ const gchar *service;
+ const gchar *display;
+ gboolean translated;
+ } names[] = {
+ { "google-talk", "Google Talk", FALSE },
+ { "facebook", N_("Facebook Chat"), TRUE },
+ { NULL, NULL }
+ };
+
+ for (i = 0; names[i].service != NULL; i++)
+ {
+ if (!tp_strdiff (service_name, names[i].service))
+ {
+ if (names[i].translated)
+ return _(names[i].display);
+ else
+ return names[i].display;
+ }
+ }
+
+ return service_name;
}
/* Note: this function depends on the account manager having its core feature