2 * @file buddy.h Buddy handlers
6 * Purple is the legal property of its developers, whose names are too numerous
7 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 #ifndef PURPLE_JABBER_BUDDY_H
26 #define PURPLE_JABBER_BUDDY_H
28 typedef struct _JabberBuddy JabberBuddy
;
38 * A sorted list of resources in priority descending order.
39 * This means that the first resource in the list is the
40 * "most available" (see resource_compare_cb in buddy.c for
41 * details). Don't play with this yourself, let
42 * jabber_buddy_track_resource and jabber_buddy_remove_resource do it.
47 JABBER_INVISIBLE_NONE
= 0,
48 JABBER_INVISIBLE_SERVER
= 1 << 1,
49 JABBER_INVIS_BUDDY
= 1 << 2
53 JABBER_SUB_PENDING
= 1 << 1,
54 JABBER_SUB_TO
= 1 << 2,
55 JABBER_SUB_FROM
= 1 << 3,
56 JABBER_SUB_BOTH
= (JABBER_SUB_TO
| JABBER_SUB_FROM
),
57 JABBER_SUB_REMOVE
= 1 << 4
65 } JabberAdHocCommands
;
71 JabberBuddyState state
;
74 JabberCapabilities capabilities
;
77 JABBER_CHAT_STATES_UNKNOWN
,
78 JABBER_CHAT_STATES_UNSUPPORTED
,
79 JABBER_CHAT_STATES_SUPPORTED
86 /* tz_off == PURPLE_NO_TZ_OFF when unset */
89 JabberCapsClientInfo
*info
;
93 gboolean commands_fetched
;
94 } JabberBuddyResource
;
96 void jabber_buddy_free(JabberBuddy
*jb
);
97 JabberBuddy
*jabber_buddy_find(JabberStream
*js
, const char *name
,
99 JabberBuddyResource
*jabber_buddy_find_resource(JabberBuddy
*jb
,
100 const char *resource
);
101 JabberBuddyResource
*jabber_buddy_track_resource(JabberBuddy
*jb
, const char *resource
,
102 int priority
, JabberBuddyState state
, const char *status
);
103 void jabber_buddy_remove_resource(JabberBuddy
*jb
, const char *resource
);
104 void jabber_buddy_get_info(PurpleConnection
*gc
, const char *who
);
106 GList
*jabber_blist_node_menu(PurpleBlistNode
*node
);
108 void jabber_set_info(PurpleConnection
*gc
, const char *info
);
109 void jabber_setup_set_info(PurpleProtocolAction
*action
);
110 void jabber_set_buddy_icon(PurpleConnection
*gc
, PurpleImage
*img
);
112 void jabber_user_search(JabberStream
*js
, const char *directory
);
113 void jabber_user_search_begin(PurpleProtocolAction
*);
115 void jabber_buddy_remove_all_pending_buddy_info_requests(JabberStream
*js
);
117 void jabber_vcard_fetch_mine(JabberStream
*js
);
119 gboolean
jabber_resource_know_capabilities(const JabberBuddyResource
*jbr
);
120 gboolean
jabber_resource_has_capability(const JabberBuddyResource
*jbr
,
122 gboolean
jabber_buddy_has_capability(const JabberBuddy
*jb
, const gchar
*cap
);
125 jabber_resource_get_identity_category_type(const JabberBuddyResource
*jbr
,
126 const gchar
*category
);
128 #endif /* PURPLE_JABBER_BUDDY_H */