Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jabber.h @ 26528:882748e27f9d
propagate from branch 'im.pidgin.pidgin' (head 58b2ba106e563fcd0984b9438aa427f1d61e25e9)
to branch 'im.pidgin.cpw.darkrain42.xmpp.bosh' (head 66b3abfbbc6c37e976677819dd23987db9d3b083)
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 04 Apr 2009 03:15:59 +0000 |
parents | 34eb898478b4 fcee93c74230 |
children | 20743d9bd62d |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.h Sat Apr 04 02:55:39 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.h Sat Apr 04 03:15:59 2009 +0000 @@ -63,12 +63,13 @@ #include "jutil.h" #include "xmlnode.h" #include "buddy.h" +#include "bosh.h" #ifdef HAVE_CYRUS_SASL #include <sasl/sasl.h> #endif -#define CAPS0115_NODE "http://pidgin.im/caps" +#define CAPS0115_NODE "http://pidgin.im/" /* Index into attention_types list */ #define JABBER_BUZZ 0 @@ -209,6 +210,9 @@ gboolean vcard_fetched; + /* Entity Capabilities hash */ + char *caps_hash; + /* does the local server support PEP? */ gboolean pep; @@ -236,10 +240,15 @@ /* A purple timeout tag for the keepalive */ int keepalive_timeout; - + PurpleSrvResponse *srv_rec; guint srv_rec_idx; guint max_srv_rec_idx; + + /* BOSH stuff */ + gboolean use_bosh; + PurpleBOSHConnection *bosh; + /** * This linked list contains PurpleUtilFetchUrlData structs * for when we lookup buddy icons from a url @@ -256,15 +265,22 @@ /* later add stuff to handle TURN relays... */ }; -typedef gboolean (JabberFeatureEnabled)(JabberStream *js, const gchar *shortname, const gchar *namespace); +typedef gboolean (JabberFeatureEnabled)(JabberStream *js, const gchar *namespace); typedef struct _JabberFeature { - gchar *shortname; gchar *namespace; JabberFeatureEnabled *is_enabled; } JabberFeature; +typedef struct _JabberIdentity +{ + gchar *category; + gchar *type; + gchar *name; + gchar *lang; +} JabberIdentity; + typedef struct _JabberBytestreamsStreamhost { char *jid; char *host; @@ -274,7 +290,9 @@ /* what kind of additional features as returned from disco#info are supported? */ extern GList *jabber_features; +extern GList *jabber_identities; +void jabber_stream_features_parse(JabberStream *js, xmlnode *packet); void jabber_process_packet(JabberStream *js, xmlnode **packet); void jabber_send(JabberStream *js, xmlnode *data); void jabber_send_raw(JabberStream *js, const char *data, int len); @@ -295,8 +313,24 @@ */ char *jabber_parse_error(JabberStream *js, xmlnode *packet, PurpleConnectionError *reason); -void jabber_add_feature(const gchar *shortname, const gchar *namespace, JabberFeatureEnabled cb); /* cb may be NULL */ -void jabber_remove_feature(const gchar *shortname); +void jabber_add_feature(const gchar *namespace, JabberFeatureEnabled cb); /* cb may be NULL */ +void jabber_remove_feature(const gchar *namespace); + +/** Adds an identitiy to this jabber library instance. For list of valid values vistit the + * webiste of the XMPP Registrar ( http://www.xmpp.org/registrar/disco-categories.html#client ). + * @param category the category of the identity. + * @param type the type of the identity. + * @param language the language localization of the name. Can be NULL. + * @param name the name of the identity. + */ +void jabber_add_identity(const gchar *category, const gchar *type, const gchar *lang, const gchar *name); + +/** + * Returns true if this connection is over a secure (SSL) stream. Use this + * instead of checking js->gsc because BOSH stores its PurpleSslConnection + * members in its own data structure. + */ +gboolean jabber_stream_is_ssl(JabberStream *js); /** PRPL functions */ const char *jabber_list_icon(PurpleAccount *a, PurpleBuddy *b); @@ -325,6 +359,8 @@ PurpleMediaSessionType type); PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who); void jabber_register_commands(void); + void jabber_init_plugin(PurplePlugin *plugin); +void jabber_uninit_plugin(void); #endif /* _PURPLE_JABBER_H_ */