aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-08-25 17:50:26 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-25 18:55:39 +0800
commit073dc5b0186057f6f30818c3fc50d2070b1743a1 (patch)
treecdc27291f39b5a10dce4fa5044969f06250fcf97 /libempathy
parent13d33b5782508968119610517af99d8312a39f45 (diff)
downloadgsoc2013-empathy-073dc5b0186057f6f30818c3fc50d2070b1743a1.tar
gsoc2013-empathy-073dc5b0186057f6f30818c3fc50d2070b1743a1.tar.gz
gsoc2013-empathy-073dc5b0186057f6f30818c3fc50d2070b1743a1.tar.bz2
gsoc2013-empathy-073dc5b0186057f6f30818c3fc50d2070b1743a1.tar.lz
gsoc2013-empathy-073dc5b0186057f6f30818c3fc50d2070b1743a1.tar.xz
gsoc2013-empathy-073dc5b0186057f6f30818c3fc50d2070b1743a1.tar.zst
gsoc2013-empathy-073dc5b0186057f6f30818c3fc50d2070b1743a1.zip
Make empathy_protocol_name_to_display_name public
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-utils.c30
-rw-r--r--libempathy/empathy-utils.h1
2 files changed, 31 insertions, 0 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index db35e94dd..028a24dd1 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -364,3 +364,33 @@ empathy_type_dbus_ao (void)
return t;
}
+
+const char *
+empathy_protocol_name_to_display_name (const gchar *proto_name)
+{
+ int i;
+ static struct {
+ const gchar *proto;
+ const gchar *display;
+ } names[] = {
+ { "jabber", "Jabber" },
+ { "msn", "MSN" },
+ { "local-xmpp", N_("People Nearby") },
+ { "irc", "IRC" },
+ { "icq", "ICQ" },
+ { "aim", "AIM" },
+ { "yahoo", "Yahoo!" },
+ { "groupwise", "GroupWise" },
+ { "sip", "SIP" },
+ { NULL, NULL }
+ };
+
+ for (i = 0; names[i].proto != NULL; i++)
+ {
+ if (!tp_strdiff (proto_name, names[i].proto))
+ return names[i].display;
+ }
+
+ return NULL;
+}
+
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index c6aebb4f2..9015b3889 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -75,6 +75,7 @@ gint empathy_uint_compare (gconstpointer a,
gconstpointer b);
gchar *empathy_protocol_icon_name (const gchar *protocol);
+const gchar *empathy_protocol_name_to_display_name (const gchar *proto_name);
#define EMPATHY_ARRAY_TYPE_OBJECT (empathy_type_dbus_ao ())
GType empathy_type_dbus_ao (void);