comparison libpurple/protocols/jabber/jabber.c @ 17576: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
comparison
equal deleted inserted replaced
17575:5fc8a8a25008 17576:e49b259fc7dd
53 #include "roster.h" 53 #include "roster.h"
54 #include "ping.h" 54 #include "ping.h"
55 #include "si.h" 55 #include "si.h"
56 #include "xdata.h" 56 #include "xdata.h"
57 #include "pep.h" 57 #include "pep.h"
58
59 #include <assert.h>
58 60
59 #define JABBER_CONNECT_STEPS (js->gsc ? 8 : 5) 61 #define JABBER_CONNECT_STEPS (js->gsc ? 8 : 5)
60 62
61 static PurplePlugin *my_protocol = NULL; 63 static PurplePlugin *my_protocol = NULL;
62 GList *jabber_features; 64 GList *jabber_features;
1092 JabberStream *js = gc->proto_data; 1094 JabberStream *js = gc->proto_data;
1093 1095
1094 js->idle = idle ? time(NULL) - idle : idle; 1096 js->idle = idle ? time(NULL) - idle : idle;
1095 } 1097 }
1096 1098
1097 void jabber_add_feature(const char *shortname, const char *namespace) { 1099 void jabber_add_feature(const char *shortname, const char *namespace, JabberFeatureEnabled cb) {
1098 JabberFeature *feat = g_new0(JabberFeature,1); 1100 JabberFeature *feat;
1101
1102 assert(shortname != NULL);
1103 assert(namespace != NULL);
1104
1105 feat = g_new0(JabberFeature,1);
1099 feat->shortname = g_strdup(shortname); 1106 feat->shortname = g_strdup(shortname);
1100 feat->namespace = g_strdup(namespace); 1107 feat->namespace = g_strdup(namespace);
1108 feat->is_enabled = cb;
1101 1109
1102 /* try to remove just in case it already exists in the list */ 1110 /* try to remove just in case it already exists in the list */
1103 jabber_remove_feature(shortname); 1111 jabber_remove_feature(shortname);
1104 1112
1105 jabber_features = g_list_append(jabber_features, feat); 1113 jabber_features = g_list_append(jabber_features, feat);
1459 /* } */ 1467 /* } */
1460 1468
1461 act = purple_plugin_action_new(_("Search for Users..."), 1469 act = purple_plugin_action_new(_("Search for Users..."),
1462 jabber_user_search_begin); 1470 jabber_user_search_begin);
1463 m = g_list_append(m, act); 1471 m = g_list_append(m, act);
1464 1472
1473 purple_debug_info("jabber", "jabber_actions: have pep: %s\n", js->pep?"YES":"NO");
1474
1465 if(js->pep) 1475 if(js->pep)
1466 jabber_pep_init_actions(&m); 1476 jabber_pep_init_actions(&m);
1467 1477
1468 return m; 1478 return m;
1469 } 1479 }