comparison src/protocols/msn/switchboard.h @ 10345:2e01c503aa4f

[gaim-migrate @ 11556] Patch 1078151 from Felipe Contreras to fix some more MSN bugs: "User Dislpay messages, and other less used, did not set an slpcall, so the callback that should not be called, was called (in some very special cases)." ... "Here it goes the real real one, as far as I can tell. Cleaning + organizing + documentation + hard bug fix = big patch." -- Felipe Contreras I also fixed drag-and-drop to conversation window file transfers (which I had broken when I fixed some other dnd thing), made the debug output of the autoreconnect plugin more useful, and stopped the message notification plugin notifying you for messages sent by ignored users. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 11 Dec 2004 20:01:58 +0000
parents ecf3ce2e2ab1
children bbf738a0ce7b
comparison
equal deleted inserted replaced
10344:5976491e07a7 10345:2e01c503aa4f
31 #include "msg.h" 31 #include "msg.h"
32 #include "user.h" 32 #include "user.h"
33 33
34 #include "servconn.h" 34 #include "servconn.h"
35 35
36 #include "slplink.h"
37
38 /*
39 * A switchboard error
40 */
36 typedef enum 41 typedef enum
37 { 42 {
38 MSN_SB_ERROR_NONE, 43 MSN_SB_ERROR_NONE, /**< No error */
39 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) */
40 MSN_SB_ERROR_OFFLINE, /* The account is offline */ 45 MSN_SB_ERROR_OFFLINE, /**< The account is offline */
41 MSN_SB_ERROR_USER_OFFLINE, /* The user to call is offline */ 46 MSN_SB_ERROR_USER_OFFLINE, /**< The user to call is offline */
42 MSN_SB_ERROR_CONNECTION, /* There was a connection error */ 47 MSN_SB_ERROR_CONNECTION, /**< There was a connection error */
43 MSN_SB_ERROR_UNKNOWN 48 MSN_SB_ERROR_UNKNOWN /**< An unknown error occured */
44 49
45 } MsnSBErrorType; 50 } MsnSBErrorType;
46 51
52 /*
53 * A switchboard A place where a bunch of users send messages to the rest
54 * of the users.
55 */
47 struct _MsnSwitchBoard 56 struct _MsnSwitchBoard
48 { 57 {
49 MsnSession *session; 58 MsnSession *session;
50 MsnServConn *servconn; 59 MsnServConn *servconn;
51 char *im_user; 60 char *im_user;
52 61
53 char *auth_key; 62 char *auth_key;
54 char *session_id; 63 char *session_id;
55 64
56 gboolean invited; 65 GaimConversation *conv; /**< The conversation that displays the
57 gboolean destroying; 66 messages of this switchboard, or @c NULL if
58 67 this is a helper switchboard. */
59 GaimConversation *conv; 68
60 69 gboolean empty; /**< A flag that states if the swithcboard has no
61 gboolean ready; /* When it's actually usable */ 70 users in it. */
62 /* gboolean in_use; */ 71 gboolean invited; /**< A flag that states if we were invited to the
72 switchboard. */
73 gboolean destroying; /**< A flag that states if the switchboard is on
74 the process of being destroyed. */
75 gboolean ready; /**< A flag that states if his switchboard is
76 ready to be used. */
63 77
64 int current_users; 78 int current_users;
65 int total_users; 79 int total_users;
66 GList *users; 80 GList *users;
67 81
68 int chat_id; 82 int chat_id;
69 83
70 gboolean hidden;
71
72 gboolean user_joined;
73 GQueue *im_queue; 84 GQueue *im_queue;
74 85
75 int error; 86 MsnSBErrorType error; /**< The error that occured in this switchboard
87 (if applicable). */
88 MsnSlpLink *slplink; /**< The slplink that is using this switchboard. */
76 }; 89 };
77 90
78 /** 91 /**
79 * Initialize the variables for switchboard creation. 92 * Initialize the variables for switchboard creation.
80 */ 93 */
99 * 112 *
100 * @param swboard The switchboard to destroy. 113 * @param swboard The switchboard to destroy.
101 */ 114 */
102 void msn_switchboard_destroy(MsnSwitchBoard *swboard); 115 void msn_switchboard_destroy(MsnSwitchBoard *swboard);
103 116
104 #if 0
105 /**
106 * Sets the user the switchboard is supposed to connect to.
107 *
108 * @param swboard The switchboard.
109 * @param user The user.
110 */
111 void msn_switchboard_set_user(MsnSwitchBoard *swboard, const char *user);
112
113 /**
114 * Returns the user the switchboard is supposed to connect to.
115 *
116 * @param swboard The switchboard.
117 *
118 * @return The user.
119 */
120 const char *msn_switchboard_get_user(MsnSwitchBoard *swboard);
121 #endif
122
123 /** 117 /**
124 * Sets the auth key the switchboard must use when connecting. 118 * Sets the auth key the switchboard must use when connecting.
125 * 119 *
126 * @param swboard The switchboard. 120 * @param swboard The switchboard.
127 * @param key The auth key. 121 * @param key The auth key.
153 * @return The session ID. 147 * @return The session ID.
154 */ 148 */
155 const char *msn_switchboard_get_session_id(MsnSwitchBoard *swboard); 149 const char *msn_switchboard_get_session_id(MsnSwitchBoard *swboard);
156 150
157 /** 151 /**
158 * Sets whether or not the user was invited to this switchboard. 152 * Sets whether or not we were invited to this switchboard.
159 * 153 *
160 * @param swboard The switchboard. 154 * @param swboard The switchboard.
161 * @param invite @c TRUE if invited, @c FALSE otherwise. 155 * @param invite @c TRUE if invited, @c FALSE otherwise.
162 */ 156 */
163 void msn_switchboard_set_invited(MsnSwitchBoard *swboard, gboolean invited); 157 void msn_switchboard_set_invited(MsnSwitchBoard *swboard, gboolean invited);
164 158
165 /** 159 /**
166 * Returns whether or not the user was invited to this switchboard. 160 * Returns whether or not we were invited to this switchboard.
167 * 161 *
168 * @param swboard The switchboard. 162 * @param swboard The switchboard.
169 * 163 *
170 * @return @c TRUE if invited, @c FALSE otherwise. 164 * @return @c TRUE if invited, @c FALSE otherwise.
171 */ 165 */
180 * 174 *
181 * @return @c TRUE if able to connect, or @c FALSE otherwise. 175 * @return @c TRUE if able to connect, or @c FALSE otherwise.
182 */ 176 */
183 gboolean msn_switchboard_connect(MsnSwitchBoard *swboard, 177 gboolean msn_switchboard_connect(MsnSwitchBoard *swboard,
184 const char *host, int port); 178 const char *host, int port);
179
180 /**
181 * Disconnects from a switchboard.
182 *
183 * @param swboard The switchboard to disconnect from.
184 */
185 void msn_switchboard_disconnect(MsnSwitchBoard *swboard); 185 void msn_switchboard_disconnect(MsnSwitchBoard *swboard);
186
186 void msn_switchboard_send_msg(MsnSwitchBoard *swboard, MsnMessage *msg); 187 void msn_switchboard_send_msg(MsnSwitchBoard *swboard, MsnMessage *msg);
188 void msn_switchboard_queue_msg(MsnSwitchBoard *swboard, MsnMessage *msg);
189 void msn_switchboard_process_queue(MsnSwitchBoard *swboard);
187 190
188 gboolean msn_switchboard_chat_leave(MsnSwitchBoard *swboard); 191 gboolean msn_switchboard_chat_leave(MsnSwitchBoard *swboard);
189 gboolean msn_switchboard_chat_invite(MsnSwitchBoard *swboard, const char *who); 192 gboolean msn_switchboard_chat_invite(MsnSwitchBoard *swboard, const char *who);
190 193
191 void msn_switchboard_request(MsnSwitchBoard *swboard); 194 void msn_switchboard_request(MsnSwitchBoard *swboard);
192 void msn_switchboard_request_add_user(MsnSwitchBoard *swboard, const char *user); 195 void msn_switchboard_request_add_user(MsnSwitchBoard *swboard, const char *user);
193 void msn_switchboard_queue_msg(MsnSwitchBoard *swboard, MsnMessage *msg);
194 void msn_switchboard_process_queue(MsnSwitchBoard *swboard);
195 196
196 /** 197 /**
197 * Processes application/x-msnmsgrp2p messages. 198 * Processes application/x-msnmsgrp2p messages.
198 * 199 *
199 * @param cmdproc The command processor. 200 * @param cmdproc The command processor.