Mercurial > pidgin
annotate src/protocols/msn/session.h @ 10487:659edfcac14e
[gaim-migrate @ 11777]
Removed protocol preferences.
MSN will display closed conversation messages but not timeouts.
Jabber will not display your OS.
I left the preferences for OSCAR, but removed them from the UI. OSCAR is
complicated because it stores prefs on the server. I'll let Mark figure
out a smarter way to handle that.
As with all slashed prefs, feel free to voice objections.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 08 Jan 2005 20:30:41 +0000 |
parents | bcfea6c3d5c9 |
children | 8f1316d77315 |
rev | line source |
---|---|
5309 | 1 /** |
2 * @file session.h MSN session functions | |
3 * | |
4 * gaim | |
5 * | |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
6 * Gaim is the legal property of its developers, whose names are too numerous |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
8 * source distribution. |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
9 * |
5309 | 10 * This program is free software; you can redistribute it and/or modify |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program; if not, write to the Free Software | |
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 */ | |
24 #ifndef _MSN_SESSION_H_ | |
25 #define _MSN_SESSION_H_ | |
26 | |
27 typedef struct _MsnSession MsnSession; | |
28 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
29 #include "sslconn.h" |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
30 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
31 #include "notification.h" |
5309 | 32 #include "switchboard.h" |
33 #include "user.h" | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
34 #include "group.h" |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
7631
diff
changeset
|
35 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
36 #include "cmdproc.h" |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
37 #include "nexus.h" |
10463 | 38 #include "httpconn.h" |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
39 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
40 #include "userlist.h" |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
41 #include "sync.h" |
5309 | 42 |
10481 | 43 /** |
44 * Types of errors. | |
45 */ | |
46 typedef enum | |
47 { | |
48 MSN_ERROR_SERVCONN, | |
49 MSN_ERROR_UNSUPORTED_PROTOCOL, | |
50 MSN_ERROR_HTTP_MALFORMED, | |
51 MSN_ERROR_AUTH, | |
52 MSN_ERROR_BAD_BLIST, | |
53 MSN_ERROR_SIGN_OTHER, | |
54 MSN_ERROR_SERV_DOWN | |
55 | |
56 } MsnErrorType; | |
57 | |
58 /** | |
59 * Login steps. | |
60 */ | |
61 typedef enum | |
62 { | |
63 MSN_LOGIN_STEP_START, | |
64 MSN_LOGIN_STEP_HANDSHAKE, | |
65 MSN_LOGIN_STEP_TRANSFER, | |
66 MSN_LOGIN_STEP_AUTH_START, | |
67 MSN_LOGIN_STEP_AUTH, | |
68 MSN_LOGIN_STEP_GET_COOKIE, | |
69 MSN_LOGIN_STEP_AUTH_END, | |
70 MSN_LOGIN_STEP_SYN, | |
71 MSN_LOGIN_STEP_END | |
72 | |
73 } MsnLoginStep; | |
74 | |
75 #define MSN_LOGIN_STEPS MSN_LOGIN_STEP_END | |
76 | |
5309 | 77 struct _MsnSession |
78 { | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
79 GaimAccount *account; |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
80 MsnUser *user; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
81 int state; |
5309 | 82 |
7631 | 83 guint protocol_ver; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
84 |
10481 | 85 MsnLoginStep login_step; /**< The current step in the login process. */ |
5309 | 86 |
87 gboolean connected; | |
10296 | 88 gboolean logged_in; /**< A temporal flag to ignore local buddy list adds. */ |
89 gboolean destroying; /**< A flag that states if the session is being destroyed. */ | |
10481 | 90 gboolean http_method; |
5309 | 91 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
92 MsnNotification *notification; |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
7631
diff
changeset
|
93 MsnNexus *nexus; |
10481 | 94 MsnSync *sync; |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
95 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
96 MsnUserList *userlist; |
10044 | 97 MsnUserList *sync_userlist; |
5309 | 98 |
10403 | 99 int servconns_count; /**< The count of server connections. */ |
100 GList *switches; /**< The list of all the switchboards. */ | |
101 GList *directconns; /**< The list of all the directconnections. */ | |
10481 | 102 GList *slplinks; /**< The list of all the slplinks. */ |
5309 | 103 |
10481 | 104 int conv_seq; /**< The current conversation sequence number. */ |
5309 | 105 |
106 struct | |
107 { | |
108 char *kv; | |
109 char *sid; | |
110 char *mspauth; | |
111 unsigned long sl; | |
112 char *file; | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
113 char *client_ip; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
114 int client_port; |
5309 | 115 |
116 } passport_info; | |
117 }; | |
118 | |
119 /** | |
120 * Creates an MSN session. | |
121 * | |
122 * @param account The account. | |
123 * | |
124 * @return The new MSN session. | |
125 */ | |
10481 | 126 MsnSession *msn_session_new(GaimAccount *account); |
5309 | 127 |
128 /** | |
129 * Destroys an MSN session. | |
130 * | |
131 * @param session The MSN session to destroy. | |
132 */ | |
133 void msn_session_destroy(MsnSession *session); | |
134 | |
135 /** | |
136 * Connects to and initiates an MSN session. | |
137 * | |
10481 | 138 * @param session The MSN session. |
139 * @param host The dispatch server host. | |
140 * @param port The dispatch server port. | |
141 * @param http_method Whether to use or not http_method. | |
5309 | 142 * |
143 * @return @c TRUE on success, @c FALSE on failure. | |
144 */ | |
10481 | 145 gboolean msn_session_connect(MsnSession *session, |
146 const char *host, int port, | |
147 gboolean http_method); | |
5309 | 148 |
149 /** | |
150 * Disconnects from an MSN session. | |
151 * | |
152 * @param session The MSN session. | |
153 */ | |
154 void msn_session_disconnect(MsnSession *session); | |
155 | |
156 /** | |
157 * Finds a switchboard with the given chat ID. | |
158 * | |
159 * @param session The MSN session. | |
160 * @param chat_id The chat ID to search for. | |
161 * | |
162 * @return The switchboard, if found. | |
163 */ | |
164 MsnSwitchBoard *msn_session_find_switch_with_id(const MsnSession *session, | |
165 int chat_id); | |
166 | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
167 MsnSwitchBoard *msn_session_find_swboard(MsnSession *session, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
168 const char *username); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
169 MsnSwitchBoard *msn_session_get_swboard(MsnSession *session, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
170 const char *username); |
5309 | 171 |
10481 | 172 /** |
173 * Sets an error for the MSN session. | |
174 * | |
175 * @param session The MSN session. | |
176 * @param error The error. | |
177 * @param info Extra information. | |
178 */ | |
179 void msn_session_set_error(MsnSession *session, MsnErrorType error, | |
180 const char *info); | |
181 | |
182 /** | |
183 * Sets the current step in the login proccess. | |
184 * | |
185 * @param session The MSN session. | |
186 * @param step The current step. | |
187 */ | |
188 void msn_session_set_login_step(MsnSession *session, MsnLoginStep step); | |
189 | |
190 /** | |
191 * Finish the login proccess. | |
192 * | |
193 * @param session The MSN session. | |
194 */ | |
10044 | 195 void msn_session_finish_login(MsnSession *session); |
196 | |
5309 | 197 #endif /* _MSN_SESSION_H_ */ |