Mercurial > pidgin.yaz
comparison src/protocols/msn/switchboard.h @ 10481:bcfea6c3d5c9
[gaim-migrate @ 11769]
Patch 1093958 from Felipe Contreras. It fixes stuff.
I also made some tweaks to make valgrind a bit happier.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Fri, 07 Jan 2005 02:48:33 +0000 |
parents | 9bed28273ec7 |
children | f52ab405f1ab |
comparison
equal
deleted
inserted
replaced
10480:8e0a91d11362 | 10481:bcfea6c3d5c9 |
---|---|
33 | 33 |
34 #include "servconn.h" | 34 #include "servconn.h" |
35 | 35 |
36 #include "slplink.h" | 36 #include "slplink.h" |
37 | 37 |
38 /* | 38 /** |
39 * A switchboard error | 39 * A switchboard error. |
40 */ | 40 */ |
41 typedef enum | 41 typedef enum |
42 { | 42 { |
43 MSN_SB_ERROR_NONE, /**< No error. */ | 43 MSN_SB_ERROR_NONE, /**< No error. */ |
44 MSN_SB_ERROR_CAL, /**< The user could not join (answer the call). */ | 44 MSN_SB_ERROR_CAL, /**< The user could not join (answer the call). */ |
47 MSN_SB_ERROR_CONNECTION, /**< There was a connection error. */ | 47 MSN_SB_ERROR_CONNECTION, /**< There was a connection error. */ |
48 MSN_SB_ERROR_UNKNOWN /**< An unknown error occurred. */ | 48 MSN_SB_ERROR_UNKNOWN /**< An unknown error occurred. */ |
49 | 49 |
50 } MsnSBErrorType; | 50 } MsnSBErrorType; |
51 | 51 |
52 /* | 52 /** |
53 * A switchboard A place where a bunch of users send messages to the rest | 53 * A switchboard. |
54 * of the users. | 54 * |
55 * A place where a bunch of users send messages to the rest of the users. | |
55 */ | 56 */ |
56 struct _MsnSwitchBoard | 57 struct _MsnSwitchBoard |
57 { | 58 { |
58 MsnSession *session; | 59 MsnSession *session; |
59 MsnServConn *servconn; | 60 MsnServConn *servconn; |
69 | 70 |
70 gboolean empty; /**< A flag that states if the swithcboard has no | 71 gboolean empty; /**< A flag that states if the swithcboard has no |
71 users in it. */ | 72 users in it. */ |
72 gboolean invited; /**< A flag that states if we were invited to the | 73 gboolean invited; /**< A flag that states if we were invited to the |
73 switchboard. */ | 74 switchboard. */ |
74 gboolean destroying; /**< A flag that states if the switchboard is on | |
75 the process of being destroyed. */ | |
76 gboolean ready; /**< A flag that states if this switchboard is | 75 gboolean ready; /**< A flag that states if this switchboard is |
77 ready to be used. */ | 76 ready to be used. */ |
78 gboolean closed; /**< A flag that states if the switchboard has | 77 gboolean closed; /**< A flag that states if the switchboard has |
79 been closed by the user. */ | 78 been closed by the user. */ |
80 | 79 |
82 int total_users; | 81 int total_users; |
83 GList *users; | 82 GList *users; |
84 | 83 |
85 int chat_id; | 84 int chat_id; |
86 | 85 |
87 GQueue *im_queue; /**< Queue of messages to send. */ | 86 GQueue *msg_queue; /**< Queue of messages to send. */ |
88 GList *ack_list; /**< List of messages waiting for an ack. */ | 87 GList *ack_list; /**< List of messages waiting for an ack. */ |
89 | 88 |
90 MsnSBErrorType error; /**< The error that occurred in this switchboard | 89 MsnSBErrorType error; /**< The error that occurred in this switchboard |
91 (if applicable). */ | 90 (if applicable). */ |
92 MsnSlpLink *slplink; /**< The slplink that is using this switchboard. */ | 91 MsnSlpLink *slplink; /**< The slplink that is using this switchboard. */ |
195 * | 194 * |
196 * @param swboard The switchboard to close. | 195 * @param swboard The switchboard to close. |
197 */ | 196 */ |
198 void msn_switchboard_close(MsnSwitchBoard *swboard); | 197 void msn_switchboard_close(MsnSwitchBoard *swboard); |
199 | 198 |
200 void msn_switchboard_send_msg(MsnSwitchBoard *swboard, MsnMessage *msg); | 199 /** |
201 void msn_switchboard_queue_msg(MsnSwitchBoard *swboard, MsnMessage *msg); | 200 * Returns whether or not we currently can send a message through this |
202 void msn_switchboard_process_queue(MsnSwitchBoard *swboard); | 201 * switchboard. |
202 * | |
203 * @param swboard The switchboard. | |
204 * | |
205 * @return @c TRUE if a message can be sent, @c FALSE otherwise. | |
206 */ | |
207 gboolean msn_switchboard_can_send(MsnSwitchBoard *swboard); | |
208 | |
209 /** | |
210 * Sends a message through this switchboard. | |
211 * | |
212 * @param swboard The switchboard. | |
213 * @param msg The message. | |
214 * @param queue A flag that states if we want this message to be queued (in | |
215 * the case it cannot currently be sent). | |
216 * | |
217 * @return @c TRUE if a message can be sent, @c FALSE otherwise. | |
218 */ | |
219 void msn_switchboard_send_msg(MsnSwitchBoard *swboard, MsnMessage *msg, | |
220 gboolean queue); | |
203 | 221 |
204 gboolean msn_switchboard_chat_leave(MsnSwitchBoard *swboard); | 222 gboolean msn_switchboard_chat_leave(MsnSwitchBoard *swboard); |
205 gboolean msn_switchboard_chat_invite(MsnSwitchBoard *swboard, const char *who); | 223 gboolean msn_switchboard_chat_invite(MsnSwitchBoard *swboard, const char *who); |
206 | 224 |
207 void msn_switchboard_request(MsnSwitchBoard *swboard); | 225 void msn_switchboard_request(MsnSwitchBoard *swboard); |
208 void msn_switchboard_request_add_user(MsnSwitchBoard *swboard, const char *user); | 226 void msn_switchboard_request_add_user(MsnSwitchBoard *swboard, const char *user); |
209 | 227 |
210 /** | 228 /** |
211 * Processes application/x-msnmsgrp2p messages. | 229 * Processes peer to peer messages. |
212 * | 230 * |
213 * @param cmdproc The command processor. | 231 * @param cmdproc The command processor. |
214 * @param msg The message. | 232 * @param msg The message. |
215 */ | 233 */ |
216 void msn_p2p_msg(MsnCmdProc *cmdproc, MsnMessage *msg); | 234 void msn_p2p_msg(MsnCmdProc *cmdproc, MsnMessage *msg); |
235 | |
236 /** | |
237 * Processes emoticon messages. | |
238 * | |
239 * @param cmdproc The command processor. | |
240 * @param msg The message. | |
241 */ | |
217 void msn_emoticon_msg(MsnCmdProc *cmdproc, MsnMessage *msg); | 242 void msn_emoticon_msg(MsnCmdProc *cmdproc, MsnMessage *msg); |
243 | |
244 /** | |
245 * Processes INVITE messages. | |
246 * | |
247 * @param cmdproc The command processor. | |
248 * @param msg The message. | |
249 */ | |
218 void msn_invite_msg(MsnCmdProc *cmdproc, MsnMessage *msg); | 250 void msn_invite_msg(MsnCmdProc *cmdproc, MsnMessage *msg); |
219 | 251 |
220 #endif /* _MSN_SWITCHBOARD_H_ */ | 252 #endif /* _MSN_SWITCHBOARD_H_ */ |