diff mcabber/src/roster.c @ 863:4f1a93faffea

Add roster_getnickname()
author Mikael Berthe <mikael@lilotux.net>
date Tue, 23 May 2006 21:38:27 +0200
parents a8fadbd97858
children afdd81c2c44d
line wrap: on
line diff
--- a/mcabber/src/roster.c	Sun May 21 09:49:43 2006 +0200
+++ b/mcabber/src/roster.c	Tue May 23 21:38:27 2006 +0200
@@ -600,6 +600,20 @@
   return roster_usr->name;
 }
 
+const char *roster_getnickname(const char *jid)
+{
+  GSList *sl_user;
+  roster *roster_usr;
+
+  sl_user = roster_find(jid, jidsearch,
+                        ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT);
+  if (sl_user == NULL)
+    return NULL; // Not in the roster...
+
+  roster_usr = (roster*)sl_user->data;
+  return roster_usr->nickname;
+}
+
 void roster_settype(const char *jid, guint type)
 {
   GSList *sl_user;