diff libpurple/protocols/jabber/jabber.c @ 17849:e49b259fc7dd

PEP publishing features are now only announced in disco#info when PEP is supported by the server.
author Andreas Monitzer <pidgin@monitzer.com>
date Fri, 15 Jun 2007 07:13:41 +0000
parents 5fc8a8a25008
children 7754d39d70c5
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Wed Jun 13 16:03:11 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Fri Jun 15 07:13:41 2007 +0000
@@ -56,6 +56,8 @@
 #include "xdata.h"
 #include "pep.h"
 
+#include <assert.h>
+
 #define JABBER_CONNECT_STEPS (js->gsc ? 8 : 5)
 
 static PurplePlugin *my_protocol = NULL;
@@ -1094,10 +1096,16 @@
 	js->idle = idle ? time(NULL) - idle : idle;
 }
 
-void jabber_add_feature(const char *shortname, const char *namespace) {
-	JabberFeature *feat = g_new0(JabberFeature,1);
+void jabber_add_feature(const char *shortname, const char *namespace, JabberFeatureEnabled cb) {
+	JabberFeature *feat;
+	
+	assert(shortname != NULL);
+	assert(namespace != NULL);
+	
+	feat = g_new0(JabberFeature,1);
 	feat->shortname = g_strdup(shortname);
 	feat->namespace = g_strdup(namespace);
+	feat->is_enabled = cb;
 	
 	/* try to remove just in case it already exists in the list */
 	jabber_remove_feature(shortname);
@@ -1461,7 +1469,9 @@
 	act = purple_plugin_action_new(_("Search for Users..."),
 								 jabber_user_search_begin);
 	m = g_list_append(m, act);
-	
+
+	purple_debug_info("jabber", "jabber_actions: have pep: %s\n", js->pep?"YES":"NO");
+
 	if(js->pep)
 		jabber_pep_init_actions(&m);