Mercurial > pidgin
comparison libpurple/protocols/jabber/jabber.c @ 26933:f500336f9881
Fix building on Windows and better integrate the new signals with the pre-existing ones.
committer: Paul Aurich <paul@darkrain42.org>
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Fri, 22 May 2009 04:08:38 +0000 |
parents | a8537bbcfb79 |
children | 10c91922bc1e c2cd559e034f bc2aa262a567 33b81994d74c |
comparison
equal
deleted
inserted
replaced
26932:a8537bbcfb79 | 26933:f500336f9881 |
---|---|
65 #include "jingle/jingle.h" | 65 #include "jingle/jingle.h" |
66 #include "jingle/rtp.h" | 66 #include "jingle/rtp.h" |
67 | 67 |
68 #define JABBER_CONNECT_STEPS (js->gsc ? 9 : 5) | 68 #define JABBER_CONNECT_STEPS (js->gsc ? 9 : 5) |
69 | 69 |
70 static PurplePlugin *my_protocol = NULL; | 70 PurplePlugin *jabber_plugin = NULL; |
71 GList *jabber_features = NULL; | 71 GList *jabber_features = NULL; |
72 GList *jabber_identities = NULL; | 72 GList *jabber_identities = NULL; |
73 GSList *jabber_cmds = NULL; | 73 GSList *jabber_cmds = NULL; |
74 | 74 |
75 static void jabber_unregister_account_cb(JabberStream *js); | 75 static void jabber_unregister_account_cb(JabberStream *js); |
250 | 250 |
251 void jabber_process_packet(JabberStream *js, xmlnode **packet) | 251 void jabber_process_packet(JabberStream *js, xmlnode **packet) |
252 { | 252 { |
253 const char *xmlns; | 253 const char *xmlns; |
254 | 254 |
255 purple_signal_emit(my_protocol, "jabber-receiving-xmlnode", js->gc, packet); | 255 purple_signal_emit(jabber_plugin, "jabber-receiving-xmlnode", js->gc, packet); |
256 | 256 |
257 /* if the signal leaves us with a null packet, we're done */ | 257 /* if the signal leaves us with a null packet, we're done */ |
258 if(NULL == *packet) | 258 if(NULL == *packet) |
259 return; | 259 return; |
260 | 260 |
404 } | 404 } |
405 | 405 |
406 /* If we've got a security layer, we need to encode the data, | 406 /* If we've got a security layer, we need to encode the data, |
407 * splitting it on the maximum buffer length negotiated */ | 407 * splitting it on the maximum buffer length negotiated */ |
408 | 408 |
409 purple_signal_emit(my_protocol, "jabber-sending-text", js->gc, &data); | 409 purple_signal_emit(jabber_plugin, "jabber-sending-text", js->gc, &data); |
410 if (data == NULL) | 410 if (data == NULL) |
411 return; | 411 return; |
412 | 412 |
413 #ifdef HAVE_CYRUS_SASL | 413 #ifdef HAVE_CYRUS_SASL |
414 if (js->sasl_maxbuf>0) { | 414 if (js->sasl_maxbuf>0) { |
456 void jabber_send(JabberStream *js, xmlnode *packet) | 456 void jabber_send(JabberStream *js, xmlnode *packet) |
457 { | 457 { |
458 char *txt; | 458 char *txt; |
459 int len; | 459 int len; |
460 | 460 |
461 purple_signal_emit(my_protocol, "jabber-sending-xmlnode", js->gc, &packet); | 461 purple_signal_emit(jabber_plugin, "jabber-sending-xmlnode", js->gc, &packet); |
462 | 462 |
463 /* if we get NULL back, we're done processing */ | 463 /* if we get NULL back, we're done processing */ |
464 if(NULL == packet) | 464 if(NULL == packet) |
465 return; | 465 return; |
466 | 466 |
3329 } | 3329 } |
3330 | 3330 |
3331 void | 3331 void |
3332 jabber_init_plugin(PurplePlugin *plugin) | 3332 jabber_init_plugin(PurplePlugin *plugin) |
3333 { | 3333 { |
3334 my_protocol = plugin; | 3334 jabber_plugin = plugin; |
3335 | 3335 |
3336 jabber_add_identity("client", "pc", NULL, PACKAGE); | 3336 jabber_add_identity("client", "pc", NULL, PACKAGE); |
3337 | 3337 |
3338 /* initialize jabber_features list */ | 3338 /* initialize jabber_features list */ |
3339 jabber_add_feature("jabber:iq:last", 0); | 3339 jabber_add_feature("jabber:iq:last", 0); |