2 * @file buddy.h Buddy handlers
6 * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
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.
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.
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
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef PURPLE_JABBER_BUDDY_H_
23 #define PURPLE_JABBER_BUDDY_H_
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
36 typedef struct _JabberBuddy JabberBuddy;
45 JABBER_INVISIBLE_NONE = 0,
46 JABBER_INVISIBLE_SERVER = 1 << 1,
47 JABBER_INVIS_BUDDY = 1 << 2
51 JABBER_SUB_PENDING = 1 << 1,
52 JABBER_SUB_TO = 1 << 2,
53 JABBER_SUB_FROM = 1 << 3,
54 JABBER_SUB_BOTH = (JABBER_SUB_TO | JABBER_SUB_FROM),
55 JABBER_SUB_REMOVE = 1 << 4
59 typedef struct _JabberAdHocCommands {
63 } JabberAdHocCommands;
65 typedef struct _JabberBuddyResource {
69 JabberBuddyState state;
72 JabberCapabilities capabilities;
75 JABBER_CHAT_STATES_UNKNOWN,
76 JABBER_CHAT_STATES_UNSUPPORTED,
77 JABBER_CHAT_STATES_SUPPORTED
84 /* tz_off == PURPLE_NO_TZ_OFF when unset */
87 JabberCapsClientInfo *info;
91 gboolean commands_fetched;
92 } JabberBuddyResource;
94 void jabber_buddy_free(JabberBuddy *jb);
95 JabberBuddy *jabber_buddy_find(JabberStream *js, const char *name,
97 JabberBuddyResource *jabber_buddy_find_resource(JabberBuddy *jb,
98 const char *resource);
99 JabberBuddyResource *jabber_buddy_track_resource(JabberBuddy *jb, const char *resource,
100 int priority, JabberBuddyState state, const char *status);
101 void jabber_buddy_resource_free(JabberBuddyResource *jbr);
102 void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource);
103 void jabber_buddy_get_info(PurpleConnection *gc, const char *who);
105 GList *jabber_blist_node_menu(PurpleBlistNode *node);
107 void jabber_set_info(PurpleConnection *gc, const char *info);
108 void jabber_setup_set_info(PurplePluginAction *action);
109 void jabber_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img);
111 const char *jabber_buddy_state_get_name(JabberBuddyState state);
112 const char *jabber_buddy_state_get_status_id(JabberBuddyState state);
113 const char *jabber_buddy_state_get_show(JabberBuddyState state);
114 JabberBuddyState jabber_buddy_status_id_get_state(const char *id);
115 JabberBuddyState jabber_buddy_show_get_state(const char *id);
117 void jabber_user_search(JabberStream *js, const char *directory);
118 void jabber_user_search_begin(PurplePluginAction *);
120 void jabber_buddy_remove_all_pending_buddy_info_requests(JabberStream *js);
122 void jabber_vcard_fetch_mine(JabberStream *js);
124 gboolean jabber_resource_has_capability(const JabberBuddyResource *jbr,
126 gboolean jabber_buddy_has_capability(const JabberBuddy *jb, const gchar *cap);
129 jabber_resource_get_identity_category_type(const JabberBuddyResource *jbr,
130 const gchar *category);
132 #endif /* PURPLE_JABBER_BUDDY_H_ */