comparison mcabber/mcabber/xmpp_helper.c @ 1857:189c2a5a4e66

Fix coding style in xmpp_helper
author Myhailo Danylenko <isbear@ukrpost.net>
date Fri, 02 Apr 2010 02:36:34 +0300
parents e6d355e50d7a
children c5ab9cf3819a
comparison
equal deleted inserted replaced
1852:057b514b1f12 1857:189c2a5a4e66
75 75
76 #ifdef MODULES_ENABLE 76 #ifdef MODULES_ENABLE
77 static GSList *xmpp_additional_features = NULL; 77 static GSList *xmpp_additional_features = NULL;
78 static char *ver, *ver_notavail; 78 static char *ver, *ver_notavail;
79 79
80 void xmpp_add_feature (const char *xmlns) 80 void xmpp_add_feature(const char *xmlns)
81 { 81 {
82 if (xmlns) { 82 if (xmlns) {
83 ver = NULL; 83 ver = NULL;
84 ver_notavail = NULL; 84 ver_notavail = NULL;
85 xmpp_additional_features = g_slist_append(xmpp_additional_features, 85 xmpp_additional_features = g_slist_append(xmpp_additional_features,
86 g_strdup (xmlns)); 86 g_strdup(xmlns));
87 } 87 }
88 } 88 }
89 89
90 void xmpp_del_feature (const char *xmlns) 90 void xmpp_del_feature(const char *xmlns)
91 { 91 {
92 GSList *feature = xmpp_additional_features; 92 GSList *feature = xmpp_additional_features;
93 while (feature) { 93 while (feature) {
94 if (!strcmp(feature->data, xmlns)) { 94 if (!strcmp(feature->data, xmlns)) {
95 ver = NULL; 95 ver = NULL;
96 ver_notavail = NULL; 96 ver_notavail = NULL;
97 g_free (feature->data); 97 g_free(feature->data);
98 xmpp_additional_features = g_slist_delete_link(xmpp_additional_features, 98 xmpp_additional_features = g_slist_delete_link(xmpp_additional_features,
99 feature); 99 feature);
100 return; 100 return;
101 } 101 }
102 feature = g_slist_next (feature); 102 feature = g_slist_next(feature);
103 } 103 }
104 } 104 }
105 #endif 105 #endif
106 106
107 const gchar* lm_message_node_get_child_value(LmMessageNode *node, 107 const gchar* lm_message_node_get_child_value(LmMessageNode *node,
223 caps_set_identity("", "client", PACKAGE_STRING, "pc"); 223 caps_set_identity("", "client", PACKAGE_STRING, "pc");
224 caps_add_feature("", NS_DISCO_INFO); 224 caps_add_feature("", NS_DISCO_INFO);
225 caps_add_feature("", NS_MUC); 225 caps_add_feature("", NS_MUC);
226 // advertise ChatStates only if they aren't disabled 226 // advertise ChatStates only if they aren't disabled
227 if (!settings_opt_get_int("disable_chatstates")) 227 if (!settings_opt_get_int("disable_chatstates"))
228 caps_add_feature("", NS_CHATSTATES); 228 caps_add_feature("", NS_CHATSTATES);
229 caps_add_feature("", NS_TIME); 229 caps_add_feature("", NS_TIME);
230 caps_add_feature("", NS_XMPP_TIME); 230 caps_add_feature("", NS_XMPP_TIME);
231 caps_add_feature("", NS_VERSION); 231 caps_add_feature("", NS_VERSION);
232 caps_add_feature("", NS_PING); 232 caps_add_feature("", NS_PING);
233 caps_add_feature("", NS_COMMANDS); 233 caps_add_feature("", NS_COMMANDS);
234 caps_add_feature("", NS_RECEIPTS); 234 caps_add_feature("", NS_RECEIPTS);
235 if (!settings_opt_get_int("iq_last_disable") && 235 if (!settings_opt_get_int("iq_last_disable") &&
236 (!settings_opt_get_int("iq_last_disable_when_notavail") || 236 (!settings_opt_get_int("iq_last_disable_when_notavail") ||
237 status != notavail)) 237 status != notavail))
238 caps_add_feature("", NS_LAST); 238 caps_add_feature("", NS_LAST);
239 #ifdef MODULES_ENABLE 239 #ifdef MODULES_ENABLE
240 { 240 {
241 GSList *el = xmpp_additional_features; 241 GSList *el = xmpp_additional_features;
242 while (el) { 242 while (el) {
243 caps_add_feature("", el->data); 243 caps_add_feature("", el->data);
244 el = g_slist_next (el); 244 el = g_slist_next(el);
245 } 245 }
246 } 246 }
247 #endif 247 #endif
248 248
249 if (status == notavail) { 249 if (status == notavail) {