Mon, 09 Feb 2009 21:21:18 +0000
Set a value "type" in the ui_info hash table
Set client type in resonse to an XMPP XEP-0115 request (client type).
Makes Pidgin report itself as "pc", Finch as "console"
Display emblems on XMPP buddies corresponding to their client type
(if available). Currently there is no emblem for "console"
| 7014 | 1 | /** |
| 2 | * @file buddy.h Buddy handlers | |
| 3 | * | |
| 15884 | 4 | * purple |
| 7014 | 5 | * |
| 6 | * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com> | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18235
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7014 | 21 | */ |
| 15884 | 22 | #ifndef _PURPLE_JABBER_BUDDY_H_ |
| 23 | #define _PURPLE_JABBER_BUDDY_H_ | |
| 7014 | 24 | |
| 9954 | 25 | typedef enum { |
| 26 | JABBER_BUDDY_STATE_UNKNOWN = -2, | |
| 27 | JABBER_BUDDY_STATE_ERROR = -1, | |
| 28 | JABBER_BUDDY_STATE_UNAVAILABLE = 0, | |
| 29 | JABBER_BUDDY_STATE_ONLINE, | |
| 30 | JABBER_BUDDY_STATE_CHAT, | |
| 31 | JABBER_BUDDY_STATE_AWAY, | |
| 32 | JABBER_BUDDY_STATE_XA, | |
| 33 | JABBER_BUDDY_STATE_DND | |
| 34 | } JabberBuddyState; | |
| 35 | ||
|
17800
39a0f9ed0e26
Replaced a clean and simple API with a very weird hack due to vivid request on #pidgin by multiple devs. This avoids the change in PurplePluginProtocolInfo, but requires complicated change tracking in every prpl. The others prpl should add this change tracking, too (since otherwise the status gets changed even though nothing they care about changed), but that's not up to me.
Andreas Monitzer <am@adiumx.com>
parents:
17795
diff
changeset
|
36 | #include "jabber.h" |
|
17816
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
37 | #include "caps.h" |
|
17800
39a0f9ed0e26
Replaced a clean and simple API with a very weird hack due to vivid request on #pidgin by multiple devs. This avoids the change in PurplePluginProtocolInfo, but requires complicated change tracking in every prpl. The others prpl should add this change tracking, too (since otherwise the status gets changed even though nothing they care about changed), but that's not up to me.
Andreas Monitzer <am@adiumx.com>
parents:
17795
diff
changeset
|
38 | |
|
39a0f9ed0e26
Replaced a clean and simple API with a very weird hack due to vivid request on #pidgin by multiple devs. This avoids the change in PurplePluginProtocolInfo, but requires complicated change tracking in every prpl. The others prpl should add this change tracking, too (since otherwise the status gets changed even though nothing they care about changed), but that's not up to me.
Andreas Monitzer <am@adiumx.com>
parents:
17795
diff
changeset
|
39 | #define AVATARNAMESPACEDATA "http://www.xmpp.org/extensions/xep-0084.html#ns-data" |
|
39a0f9ed0e26
Replaced a clean and simple API with a very weird hack due to vivid request on #pidgin by multiple devs. This avoids the change in PurplePluginProtocolInfo, but requires complicated change tracking in every prpl. The others prpl should add this change tracking, too (since otherwise the status gets changed even though nothing they care about changed), but that's not up to me.
Andreas Monitzer <am@adiumx.com>
parents:
17795
diff
changeset
|
40 | #define AVATARNAMESPACEMETA "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata" |
|
39a0f9ed0e26
Replaced a clean and simple API with a very weird hack due to vivid request on #pidgin by multiple devs. This avoids the change in PurplePluginProtocolInfo, but requires complicated change tracking in every prpl. The others prpl should add this change tracking, too (since otherwise the status gets changed even though nothing they care about changed), but that's not up to me.
Andreas Monitzer <am@adiumx.com>
parents:
17795
diff
changeset
|
41 | |
| 7014 | 42 | typedef struct _JabberBuddy { |
| 43 | GList *resources; | |
| 44 | char *error_msg; | |
| 45 | enum { | |
| 46 | JABBER_INVISIBLE_NONE = 0, | |
| 47 | JABBER_INVISIBLE_SERVER = 1 << 1, | |
| 48 | JABBER_INVIS_BUDDY = 1 << 2 | |
| 49 | } invisible; | |
| 50 | enum { | |
| 51 | JABBER_SUB_NONE = 0, | |
| 52 | JABBER_SUB_PENDING = 1 << 1, | |
| 53 | JABBER_SUB_TO = 1 << 2, | |
| 54 | JABBER_SUB_FROM = 1 << 3, | |
| 8194 | 55 | JABBER_SUB_BOTH = (JABBER_SUB_TO | JABBER_SUB_FROM), |
| 56 | JABBER_SUB_REMOVE = 1 << 4 | |
| 7014 | 57 | } subscription; |
| 58 | } JabberBuddy; | |
| 59 | ||
|
17816
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
60 | typedef struct _JabberAdHocCommands { |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
61 | char *jid; |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
62 | char *node; |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
63 | char *name; |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
64 | } JabberAdHocCommands; |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
65 | |
| 7116 | 66 | typedef struct _JabberBuddyResource { |
| 67 | JabberBuddy *jb; | |
| 68 | char *name; | |
| 69 | int priority; | |
| 9954 | 70 | JabberBuddyState state; |
| 7116 | 71 | char *status; |
| 8312 | 72 | JabberCapabilities capabilities; |
| 8400 | 73 | char *thread_id; |
| 13708 | 74 | enum { |
| 75 | JABBER_CHAT_STATES_UNKNOWN, | |
| 76 | JABBER_CHAT_STATES_UNSUPPORTED, | |
| 77 | JABBER_CHAT_STATES_SUPPORTED | |
| 78 | } chat_states; | |
| 79 | struct { | |
| 80 | char *version; | |
| 81 | char *name; | |
| 82 | char *os; | |
| 83 | } client; | |
|
17816
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
84 | JabberCapsClientInfo *caps; |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
85 | GList *commands; |
| 7116 | 86 | } JabberBuddyResource; |
| 87 | ||
| 88 | void jabber_buddy_free(JabberBuddy *jb); | |
| 7014 | 89 | JabberBuddy *jabber_buddy_find(JabberStream *js, const char *name, |
| 90 | gboolean create); | |
| 91 | JabberBuddyResource *jabber_buddy_find_resource(JabberBuddy *jb, | |
| 92 | const char *resource); | |
| 9954 | 93 | JabberBuddyResource *jabber_buddy_track_resource(JabberBuddy *jb, const char *resource, |
| 94 | int priority, JabberBuddyState state, const char *status); | |
| 7116 | 95 | void jabber_buddy_resource_free(JabberBuddyResource *jbr); |
| 7014 | 96 | void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource); |
| 97 | const char *jabber_buddy_get_status_msg(JabberBuddy *jb); | |
| 15884 | 98 | void jabber_buddy_get_info(PurpleConnection *gc, const char *who); |
| 7014 | 99 | |
| 15884 | 100 | GList *jabber_blist_node_menu(PurpleBlistNode *node); |
| 7014 | 101 | |
| 15884 | 102 | void jabber_set_info(PurpleConnection *gc, const char *info); |
| 103 | void jabber_setup_set_info(PurplePluginAction *action); | |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
104 | void jabber_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img); |
|
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:
17775
diff
changeset
|
105 | void jabber_buddy_avatar_update_metadata(JabberStream *js, const char *from, xmlnode *items); |
| 7014 | 106 | |
| 9954 | 107 | const char *jabber_buddy_state_get_name(JabberBuddyState state); |
| 108 | const char *jabber_buddy_state_get_status_id(JabberBuddyState state); | |
| 12683 | 109 | const char *jabber_buddy_state_get_show(JabberBuddyState state); |
| 9954 | 110 | JabberBuddyState jabber_buddy_status_id_get_state(const char *id); |
| 12683 | 111 | JabberBuddyState jabber_buddy_show_get_state(const char *id); |
| 9954 | 112 | |
|
17807
d98844d33c37
Exposed the user search function, so that directory searches can be performed directly when the jid is known.
Andreas Monitzer <am@adiumx.com>
parents:
17800
diff
changeset
|
113 | void jabber_user_search(JabberStream *js, const char *directory); |
| 15884 | 114 | void jabber_user_search_begin(PurplePluginAction *); |
| 11675 | 115 | |
|
15363
f6b9d1e3d0cb
[gaim-migrate @ 18092]
Evan Schoenberg <evands@pidgin.im>
parents:
14254
diff
changeset
|
116 | void jabber_buddy_remove_all_pending_buddy_info_requests(JabberStream *js); |
|
f6b9d1e3d0cb
[gaim-migrate @ 18092]
Evan Schoenberg <evands@pidgin.im>
parents:
14254
diff
changeset
|
117 | |
|
18235
60a9bd99f035
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
16538
diff
changeset
|
118 | void jabber_vcard_fetch_mine(JabberStream *js); |
|
60a9bd99f035
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
16538
diff
changeset
|
119 | |
|
23626
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
19897
diff
changeset
|
120 | gboolean jabber_resource_has_capability(const JabberBuddyResource *jbr, |
|
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
19897
diff
changeset
|
121 | const gchar *cap); |
|
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
19897
diff
changeset
|
122 | gboolean jabber_buddy_has_capability(const JabberBuddy *jb, const gchar *cap); |
|
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
19897
diff
changeset
|
123 | |
|
25577
ca0b40451bbc
Set a value "type" in the ui_info hash table
Marcus Lundblad <malu@pidgin.im>
parents:
24251
diff
changeset
|
124 | const gchar * |
|
ca0b40451bbc
Set a value "type" in the ui_info hash table
Marcus Lundblad <malu@pidgin.im>
parents:
24251
diff
changeset
|
125 | jabber_resource_get_identity_category_type(const JabberBuddyResource *jbr, |
|
ca0b40451bbc
Set a value "type" in the ui_info hash table
Marcus Lundblad <malu@pidgin.im>
parents:
24251
diff
changeset
|
126 | const gchar *category); |
|
ca0b40451bbc
Set a value "type" in the ui_info hash table
Marcus Lundblad <malu@pidgin.im>
parents:
24251
diff
changeset
|
127 | |
| 15884 | 128 | #endif /* _PURPLE_JABBER_BUDDY_H_ */ |