annotate src/protocols/jabber/buddy.h @ 11708:69602de55fe9

[gaim-migrate @ 13999] Fix bogus "'conv' might be used uninitialized" warning committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 22 Oct 2005 01:03:18 +0000
parents 828802f2251b
children 41cf9be29754
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
1 /**
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
2 * @file buddy.h Buddy handlers
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
3 *
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
4 * gaim
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 *
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
6 * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
7 *
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * (at your option) any later version.
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 *
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 * GNU General Public License for more details.
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 *
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 */
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
22 #ifndef _GAIM_JABBER_BUDDY_H_
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
23 #define _GAIM_JABBER_BUDDY_H_
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
24
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
25 #include "jabber.h"
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
26
9954
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
27 typedef enum {
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
28 JABBER_BUDDY_STATE_UNKNOWN = -2,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
29 JABBER_BUDDY_STATE_ERROR = -1,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
30 JABBER_BUDDY_STATE_UNAVAILABLE = 0,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
31 JABBER_BUDDY_STATE_ONLINE,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
32 JABBER_BUDDY_STATE_CHAT,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
33 JABBER_BUDDY_STATE_AWAY,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
34 JABBER_BUDDY_STATE_XA,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
35 JABBER_BUDDY_STATE_DND
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
36 } JabberBuddyState;
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
37
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
38 typedef struct _JabberBuddy {
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
39 GList *resources;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
40 char *error_msg;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
41 enum {
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
42 JABBER_INVISIBLE_NONE = 0,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
43 JABBER_INVISIBLE_SERVER = 1 << 1,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
44 JABBER_INVIS_BUDDY = 1 << 2
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
45 } invisible;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
46 enum {
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
47 JABBER_SUB_NONE = 0,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
48 JABBER_SUB_PENDING = 1 << 1,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
49 JABBER_SUB_TO = 1 << 2,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
50 JABBER_SUB_FROM = 1 << 3,
8194
22b3974dc1af [gaim-migrate @ 8916]
Nathan Walp <nwalp@pidgin.im>
parents: 7395
diff changeset
51 JABBER_SUB_BOTH = (JABBER_SUB_TO | JABBER_SUB_FROM),
22b3974dc1af [gaim-migrate @ 8916]
Nathan Walp <nwalp@pidgin.im>
parents: 7395
diff changeset
52 JABBER_SUB_REMOVE = 1 << 4
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
53 } subscription;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
54 } JabberBuddy;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
55
7116
6c8706109f92 [gaim-migrate @ 7683]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
56 typedef struct _JabberBuddyResource {
6c8706109f92 [gaim-migrate @ 7683]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
57 JabberBuddy *jb;
6c8706109f92 [gaim-migrate @ 7683]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
58 char *name;
6c8706109f92 [gaim-migrate @ 7683]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
59 int priority;
9954
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
60 JabberBuddyState state;
7116
6c8706109f92 [gaim-migrate @ 7683]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
61 char *status;
8312
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8194
diff changeset
62 JabberCapabilities capabilities;
8400
0383e55cd658 [gaim-migrate @ 9129]
Nathan Walp <nwalp@pidgin.im>
parents: 8312
diff changeset
63 char *thread_id;
7116
6c8706109f92 [gaim-migrate @ 7683]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
64 } JabberBuddyResource;
6c8706109f92 [gaim-migrate @ 7683]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
65
6c8706109f92 [gaim-migrate @ 7683]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
66 void jabber_buddy_free(JabberBuddy *jb);
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
67 JabberBuddy *jabber_buddy_find(JabberStream *js, const char *name,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
68 gboolean create);
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
69 JabberBuddyResource *jabber_buddy_find_resource(JabberBuddy *jb,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
70 const char *resource);
9954
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
71 JabberBuddyResource *jabber_buddy_track_resource(JabberBuddy *jb, const char *resource,
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
72 int priority, JabberBuddyState state, const char *status);
7116
6c8706109f92 [gaim-migrate @ 7683]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
73 void jabber_buddy_resource_free(JabberBuddyResource *jbr);
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
74 void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource);
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
75 const char *jabber_buddy_get_status_msg(JabberBuddy *jb);
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
76 void jabber_buddy_get_info(GaimConnection *gc, const char *who);
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
77 void jabber_buddy_get_info_chat(GaimConnection *gc, int id,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
78 const char *resource);
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
79
9030
7ab20f829190 [gaim-migrate @ 9806]
Mark Doliner <mark@kingant.net>
parents: 9015
diff changeset
80 GList *jabber_blist_node_menu(GaimBlistNode *node);
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
81
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
82 void jabber_set_info(GaimConnection *gc, const char *info);
9015
67421e0dc497 [gaim-migrate @ 9791]
Luke Schierer <lschiere@pidgin.im>
parents: 8400
diff changeset
83 void jabber_setup_set_info(GaimPluginAction *action);
10189
4e7249591251 [gaim-migrate @ 11304]
Nathan Walp <nwalp@pidgin.im>
parents: 9954
diff changeset
84 void jabber_set_buddy_icon(GaimConnection *gc, const char *iconfile);
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
85
9954
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
86 const char *jabber_buddy_state_get_name(JabberBuddyState state);
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
87 const char *jabber_buddy_state_get_status_id(JabberBuddyState state);
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
88 JabberBuddyState jabber_buddy_status_id_get_state(const char *id);
a9fb4493ae22 [gaim-migrate @ 10851]
Nathan Walp <nwalp@pidgin.im>
parents: 9030
diff changeset
89
11675
828802f2251b [gaim-migrate @ 13961]
Nathan Walp <nwalp@pidgin.im>
parents: 10189
diff changeset
90 void jabber_user_search_begin(GaimPluginAction *);
828802f2251b [gaim-migrate @ 13961]
Nathan Walp <nwalp@pidgin.im>
parents: 10189
diff changeset
91
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
92 #endif /* _GAIM_JABBER_BUDDY_H_ */