annotate src/server.h @ 14168:fa4fc7e5d93d

[gaim-migrate @ 16818] Remove a g_main_iteration, replace with an idle handler. Fixes the thread freeze on expanding contacts committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 17 Aug 2006 21:16:50 +0000
parents a9ff4499d9ce
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file server.h Server API
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup core
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7118
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7118
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7118
diff changeset
9 * source distribution.
6787
faa491042c66 [gaim-migrate @ 7326]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
10 *
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * (at your option) any later version.
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * GNU General Public License for more details.
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 */
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #ifndef _GAIM_SERVER_H_
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 #define _GAIM_SERVER_H_
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 #include "account.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 #include "conversation.h"
9718
78022bad9367 [gaim-migrate @ 10579]
Mark Doliner <mark@kingant.net>
parents: 9584
diff changeset
30 #include "prpl.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
32 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
33 extern "C" {
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
34 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
35
13842
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
36 /**
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
37 * Send a typing message to a given user over a given connection.
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
38 *
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
39 * TODO: Could probably move this into the conversation API.
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
40 *
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
41 * @param typing One of GAIM_TYPING, GAIM_TYPED, or GAIM_NOT_TYPING.
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
42 * @return A quiet-period, specified in seconds, where Gaim will not
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
43 * send any additional typing notification messages. Most
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
44 * protocols should return 0, which means that no additional
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
45 * GAIM_TYPING messages need to be sent. If this is 5, for
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
46 * example, then Gaim will wait five seconds, and if the Gaim
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
47 * user is still typing then Gaim will send another GAIM_TYPING
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
48 * message.
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
49 */
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
50 unsigned int serv_send_typing(GaimConnection *gc, const char *name, GaimTypingState state);
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
51
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
52 void serv_move_buddy(GaimBuddy *, GaimGroup *, GaimGroup *);
12216
4d3119205a33 [gaim-migrate @ 14518]
Stu Tomlinson <stu@nosnilmot.com>
parents: 12024
diff changeset
53 int serv_send_im(GaimConnection *, const char *, const char *, GaimMessageFlags flags);
6059
d8cd876e613e [gaim-migrate @ 6509]
Mark Doliner <mark@kingant.net>
parents: 5954
diff changeset
54 void serv_get_info(GaimConnection *, const char *);
5954
fccc33d4b8fa [gaim-migrate @ 6398]
Mark Doliner <mark@kingant.net>
parents: 5944
diff changeset
55 void serv_set_info(GaimConnection *, const char *);
13842
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
56
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 void serv_add_permit(GaimConnection *, const char *);
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 void serv_add_deny(GaimConnection *, const char *);
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 void serv_rem_permit(GaimConnection *, const char *);
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 void serv_rem_deny(GaimConnection *, const char *);
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 void serv_set_permit_deny(GaimConnection *);
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 void serv_join_chat(GaimConnection *, GHashTable *);
8562
e3c059c3d92d [gaim-migrate @ 9306]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
63 void serv_reject_chat(GaimConnection *, GHashTable *);
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 void serv_chat_invite(GaimConnection *, int, const char *, const char *);
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 void serv_chat_leave(GaimConnection *, int);
6059
d8cd876e613e [gaim-migrate @ 6509]
Mark Doliner <mark@kingant.net>
parents: 5954
diff changeset
66 void serv_chat_whisper(GaimConnection *, int, const char *, const char *);
12216
4d3119205a33 [gaim-migrate @ 14518]
Stu Tomlinson <stu@nosnilmot.com>
parents: 12024
diff changeset
67 int serv_chat_send(GaimConnection *, int, const char *, GaimMessageFlags flags);
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6622
diff changeset
68 void serv_alias_buddy(GaimBuddy *);
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 void serv_got_alias(GaimConnection *gc, const char *who, const char *alias);
13842
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
70
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
71 /**
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
72 * Receive a typing message from a remote user. Either GAIM_TYPING
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
73 * or GAIM_TYPED. If the user has stopped typing then use
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
74 * serv_got_typing_stopped instead.
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
75 *
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
76 * TODO: Could probably move this into the conversation API.
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
77 *
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
78 * @param timeout If this is a number greater than 0, then
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
79 * Gaim will wait this number of seconds and then
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
80 * set this buddy to the GAIM_NOT_TYPING state. This
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
81 * is used by protocols that send repeated typing messages
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
82 * while the user is composing the message.
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
83 */
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 void serv_got_typing(GaimConnection *gc, const char *name, int timeout,
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 GaimTypingState state);
13842
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
86
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
87 /**
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
88 * TODO: Could probably move this into the conversation API.
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
89 */
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 void serv_got_typing_stopped(GaimConnection *gc, const char *name);
13842
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
91
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 void serv_got_im(GaimConnection *gc, const char *who, const char *msg,
12216
4d3119205a33 [gaim-migrate @ 14518]
Stu Tomlinson <stu@nosnilmot.com>
parents: 12024
diff changeset
93 GaimMessageFlags flags, time_t mtime);
13842
a9ff4499d9ce [gaim-migrate @ 16295]
Mark Doliner <mark@kingant.net>
parents: 13294
diff changeset
94 void serv_set_buddyicon(GaimConnection *gc, const char *filename);
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 void serv_got_chat_invite(GaimConnection *gc, const char *name,
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 const char *who, const char *message,
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 GHashTable *data);
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 GaimConversation *serv_got_joined_chat(GaimConnection *gc,
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99 int id, const char *name);
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 void serv_got_chat_left(GaimConnection *g, int id);
6059
d8cd876e613e [gaim-migrate @ 6509]
Mark Doliner <mark@kingant.net>
parents: 5954
diff changeset
101 void serv_got_chat_in(GaimConnection *g, int id, const char *who,
12216
4d3119205a33 [gaim-migrate @ 14518]
Stu Tomlinson <stu@nosnilmot.com>
parents: 12024
diff changeset
102 GaimMessageFlags flags, const char *message, time_t mtime);
9466
d27156c9c876 [gaim-migrate @ 10291]
Luke Schierer <lschiere@pidgin.im>
parents: 9285
diff changeset
103 void serv_send_file(GaimConnection *gc, const char *who, const char *file);
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
105 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
106 }
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
107 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
108
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 #endif /* _GAIM_SERVER_H_ */