diff mcabber/src/roster.c @ 1600:c5ee395fbc8c

Updated Entity Capabilities support (XEP-0115)
author franky
date Tue, 23 Sep 2008 10:59:25 +0200
parents dcd5d4c75199
children
line wrap: on
line diff
--- a/mcabber/src/roster.c	Sun Oct 11 15:39:32 2009 +0200
+++ b/mcabber/src/roster.c	Tue Sep 23 10:59:25 2008 +0200
@@ -67,6 +67,7 @@
   enum imaffiliation affil;
   gchar *realjid;       /* for chatrooms, if buddy's real jid is known */
   guint events;
+  char *caps;
 #ifdef JEP0022
   struct jep0022 jep22;
 #endif
@@ -150,6 +151,7 @@
 #ifdef HAVE_GPGME
   g_free(p_res->pgpdata.sign_keyid);
 #endif
+  g_free(p_res->caps);
   g_free(p_res);
 }
 
@@ -1196,6 +1198,26 @@
     p_res->events = events;
 }
 
+char *buddy_resource_getcaps(gpointer rosterdata, const char *resname)
+{
+  roster *roster_usr = rosterdata;
+  res *p_res = get_resource(roster_usr, resname);
+  if (p_res)
+    return p_res->caps;
+  return NULL;
+}
+
+void buddy_resource_setcaps(gpointer rosterdata, const char *resname,
+                            const char *caps)
+{
+  roster *roster_usr = rosterdata;
+  res *p_res = get_resource(roster_usr, resname);
+  if (p_res) {
+    g_free(p_res->caps);
+    p_res->caps = g_strdup(caps);
+  }
+}
+
 struct jep0022 *buddy_resource_jep22(gpointer rosterdata, const char *resname)
 {
 #ifdef JEP0022