libpurple/protocols/jabber/pep.h

Wed, 13 May 2009 20:29:03 +0000

author
Marcus Lundblad <malu@pidgin.im>
date
Wed, 13 May 2009 20:29:03 +0000
changeset 27110
05ca719b901b
parent 26958
a955bd42f529
child 28321
c8d617c408ab
permissions
-rw-r--r--

Support custom smileys in MUCs (when all participants support BoB and a maximum
of 10 participants are in the chat).
Always announce support for BoB, since disable custom smileys will still turn
off fetching them, and BoB can be used for other purposes further on.

17768
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
1 /*
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
2 * purple - Jabber Protocol Plugin
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
3 *
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
4 * Copyright (C) 2007, Andreas Monitzer <andy@monitzer.com>
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
5 *
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
9 * (at your option) any later version.
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
10 *
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17779
773326802e26 Fixed whitespace to match the coding convention used in libpurple
Andreas Monitzer <am@adiumx.com>
parents: 17775
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17768
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
14 * GNU General Public License for more details.
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
15 *
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
17779
773326802e26 Fixed whitespace to match the coding convention used in libpurple
Andreas Monitzer <am@adiumx.com>
parents: 17775
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17768
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
19 *
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
20 */
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
21
26703
17f9a4bef2a3 Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents: 23517
diff changeset
22 #ifndef PURPLE_JABBER_PEP_H_
17f9a4bef2a3 Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents: 23517
diff changeset
23 #define PURPLE_JABBER_PEP_H_
17768
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
24
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
25 #include "jabber.h"
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
26 #include "message.h"
17775
1df27cab581c implemented user mood, still missing the front end interface
Andreas Monitzer <am@adiumx.com>
parents: 17773
diff changeset
27 #include "buddy.h"
17768
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
28
17773
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
29 void jabber_pep_init(void);
24737
b8a96a07e7ac Add more jabber plugin unloading functions to clean up more data structures
Paul Aurich <darkrain42@pidgin.im>
parents: 23954
diff changeset
30 void jabber_pep_uninit(void);
17773
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
31
17782
83af68644d0a Implemented a mood menu action (non-functional right now for some reason)
Andreas Monitzer <am@adiumx.com>
parents: 17779
diff changeset
32 void jabber_pep_init_actions(GList **m);
83af68644d0a Implemented a mood menu action (non-functional right now for some reason)
Andreas Monitzer <am@adiumx.com>
parents: 17779
diff changeset
33
17773
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
34 /*
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
35 * Callback for receiving PEP events.
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
36 *
17779
773326802e26 Fixed whitespace to match the coding convention used in libpurple
Andreas Monitzer <am@adiumx.com>
parents: 17775
diff changeset
37 * @parameter js The JabberStream this item was received on
773326802e26 Fixed whitespace to match the coding convention used in libpurple
Andreas Monitzer <am@adiumx.com>
parents: 17775
diff changeset
38 * @parameter items The &lt;items/>-tag with the &lt;item/>-children
17773
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
39 */
17775
1df27cab581c implemented user mood, still missing the front end interface
Andreas Monitzer <am@adiumx.com>
parents: 17773
diff changeset
40 typedef void (JabberPEPHandler)(JabberStream *js, const char *from, xmlnode *items);
17773
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
41
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
42 /*
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
43 * Registers a callback for PEP events. Also automatically announces this receiving capability via disco#info.
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
44 * Don't forget to use jabber_add_feature when supporting the sending of PEP events of this type.
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
45 *
23586
e495a4623f76 Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents: 17789
diff changeset
46 * @parameter xmlns The namespace for this event
17779
773326802e26 Fixed whitespace to match the coding convention used in libpurple
Andreas Monitzer <am@adiumx.com>
parents: 17775
diff changeset
47 * @parameter handlerfunc The callback to be used when receiving an event with this namespace
17773
6956b763b3d1 Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
Andreas Monitzer <am@adiumx.com>
parents: 17772
diff changeset
48 */
23586
e495a4623f76 Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents: 17789
diff changeset
49 void jabber_pep_register_handler(const char *xmlns, JabberPEPHandler handlerfunc);
17768
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
50
17787
439329d20337 Added support for setting the avatar via XEP-0084. Receiving other people's avatar is up next.
Andreas Monitzer <am@adiumx.com>
parents: 17782
diff changeset
51 /*
17788
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
52 * Request a specific item from another PEP node.
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
53 *
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
54 * @parameter js The JabberStream that should be used
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
55 * @parameter to The target PEP node
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
56 * @parameter node The node name of the item that is requested
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
57 * @parameter id The item id of the requested item (may be NULL)
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
58 * @parameter cb The callback to be used when this item is received
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
59 *
23517
db3d6a500678 Fix occurred to be spelled correctly. Thanks to bruce89 for noticing. Fixes #6096.
Daniel Atallah <datallah@pidgin.im>
parents: 17789
diff changeset
60 * The items element passed to the callback will be NULL if any error occurred (like a permission error, node doesn't exist etc.)
17788
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
61 */
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
62 void jabber_pep_request_item(JabberStream *js, const char *to, const char *node, const char *id, JabberPEPHandler cb);
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
63
e6e381b0c7d6 Implemented receiving other people's avatars via XEP-0084. Note that this code now includes a workaround for a non-spec incompatibility for the current ejabberd PEP implementation, and doesn't use the correct namespace due to Psi using the wrong one (outdated?). Works fine though, and the vcard-based approach is retained.
Andreas Monitzer <am@adiumx.com>
parents: 17787
diff changeset
64 /*
17787
439329d20337 Added support for setting the avatar via XEP-0084. Receiving other people's avatar is up next.
Andreas Monitzer <am@adiumx.com>
parents: 17782
diff changeset
65 * Default callback that can be used for namespaces which should only be enabled when PEP is supported
439329d20337 Added support for setting the avatar via XEP-0084. Receiving other people's avatar is up next.
Andreas Monitzer <am@adiumx.com>
parents: 17782
diff changeset
66 *
23586
e495a4623f76 Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents: 17789
diff changeset
67 * @parameter js The JabberStream struct for this connection
17787
439329d20337 Added support for setting the avatar via XEP-0084. Receiving other people's avatar is up next.
Andreas Monitzer <am@adiumx.com>
parents: 17782
diff changeset
68 * @parameter namespace The namespace that's queried, ignored.
439329d20337 Added support for setting the avatar via XEP-0084. Receiving other people's avatar is up next.
Andreas Monitzer <am@adiumx.com>
parents: 17782
diff changeset
69 *
439329d20337 Added support for setting the avatar via XEP-0084. Receiving other people's avatar is up next.
Andreas Monitzer <am@adiumx.com>
parents: 17782
diff changeset
70 * @returns TRUE when PEP is enabled, FALSE otherwise
439329d20337 Added support for setting the avatar via XEP-0084. Receiving other people's avatar is up next.
Andreas Monitzer <am@adiumx.com>
parents: 17782
diff changeset
71 */
23586
e495a4623f76 Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents: 17789
diff changeset
72 gboolean jabber_pep_namespace_only_when_pep_enabled_cb(JabberStream *js, const gchar *namespace);
17787
439329d20337 Added support for setting the avatar via XEP-0084. Receiving other people's avatar is up next.
Andreas Monitzer <am@adiumx.com>
parents: 17782
diff changeset
73
17768
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
74 void jabber_handle_event(JabberMessage *jm);
7be011945a1b added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
diff changeset
75
26950
842628304397 Publish only 'new' xmlns of avatars and delete old.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
76 /**
842628304397 Publish only 'new' xmlns of avatars and delete old.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
77 * Delete the specified PEP node.
842628304397 Publish only 'new' xmlns of avatars and delete old.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
78 */
842628304397 Publish only 'new' xmlns of avatars and delete old.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
79 void jabber_pep_delete_node(JabberStream *js, const gchar *node);
842628304397 Publish only 'new' xmlns of avatars and delete old.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
80
17772
918f65155a08 Implemented publishing events
Andreas Monitzer <am@adiumx.com>
parents: 17768
diff changeset
81 /*
918f65155a08 Implemented publishing events
Andreas Monitzer <am@adiumx.com>
parents: 17768
diff changeset
82 * Publishes PEP item(s)
918f65155a08 Implemented publishing events
Andreas Monitzer <am@adiumx.com>
parents: 17768
diff changeset
83 *
17779
773326802e26 Fixed whitespace to match the coding convention used in libpurple
Andreas Monitzer <am@adiumx.com>
parents: 17775
diff changeset
84 * @parameter js The JabberStream associated with the connection this event should be published
773326802e26 Fixed whitespace to match the coding convention used in libpurple
Andreas Monitzer <am@adiumx.com>
parents: 17775
diff changeset
85 * @parameter publish The publish node. This could be for example &lt;publish node='http://jabber.org/protocol/tune'/> with an &lt;item/> as subnode
17772
918f65155a08 Implemented publishing events
Andreas Monitzer <am@adiumx.com>
parents: 17768
diff changeset
86 */
918f65155a08 Implemented publishing events
Andreas Monitzer <am@adiumx.com>
parents: 17768
diff changeset
87 void jabber_pep_publish(JabberStream *js, xmlnode *publish);
918f65155a08 Implemented publishing events
Andreas Monitzer <am@adiumx.com>
parents: 17768
diff changeset
88
26703
17f9a4bef2a3 Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents: 23517
diff changeset
89 #endif /* PURPLE_JABBER_PEP_H_ */

mercurial