Mercurial > pidgin
annotate src/protocols/msn/session.h @ 7326:00a9ab26d607
[gaim-migrate @ 7912]
Added an option to remove the formatting toolbar, both globally and on a
per-window basis. Patch by Nathan Fredrickson.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sat, 25 Oct 2003 00:03:13 +0000 |
| parents | ff9127038a5a |
| children | 3a48ade4f510 |
| rev | line source |
|---|---|
| 5309 | 1 /** |
| 2 * @file session.h MSN session functions | |
| 3 * | |
| 4 * gaim | |
| 5 * | |
| 6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> | |
|
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
7 * |
| 5309 | 8 * This program is free software; you can redistribute it and/or modify |
| 9 * it under the terms of the GNU General Public License as published by | |
| 10 * the Free Software Foundation; either version 2 of the License, or | |
| 11 * (at your option) any later version. | |
| 12 * | |
| 13 * This program is distributed in the hope that it will be useful, | |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 * GNU General Public License for more details. | |
| 17 * | |
| 18 * You should have received a copy of the GNU General Public License | |
| 19 * along with this program; if not, write to the Free Software | |
| 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 */ | |
| 22 #ifndef _MSN_SESSION_H_ | |
| 23 #define _MSN_SESSION_H_ | |
| 24 | |
| 25 typedef struct _MsnSession MsnSession; | |
| 26 | |
|
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
27 #include "sslconn.h" |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
28 |
| 5309 | 29 #include "servconn.h" |
| 30 #include "switchboard.h" | |
| 31 #include "user.h" | |
|
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
32 #include "group.h" |
| 5309 | 33 |
| 34 struct _MsnSession | |
| 35 { | |
|
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
36 GaimAccount *account; |
|
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
37 MsnUser *user; |
| 5309 | 38 |
|
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
39 int protocol_ver; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
40 |
| 5309 | 41 char *dispatch_server; |
| 42 int dispatch_port; | |
| 43 | |
| 44 gboolean connected; | |
| 45 | |
| 46 MsnServConn *dispatch_conn; | |
| 47 MsnServConn *notification_conn; | |
| 48 | |
| 49 unsigned int trId; | |
| 50 | |
|
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
51 gboolean http_method; |
|
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
52 |
|
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
53 char *ssl_url; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
54 char *ssl_login_host; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
55 char *ssl_login_path; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
56 char *ssl_login_params; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
57 GHashTable *ssl_challenge_data; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
58 GaimSslConnection *ssl_conn; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
59 |
| 5309 | 60 MsnUsers *users; |
|
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
61 MsnGroups *groups; |
| 5309 | 62 |
|
5898
5baeb89ee2d4
[gaim-migrate @ 6330]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
63 GList *servconns; |
| 5309 | 64 GList *switches; |
| 65 | |
| 66 struct | |
| 67 { | |
| 68 GSList *forward; | |
| 69 GSList *reverse; | |
| 70 GSList *allow; | |
| 71 GSList *block; | |
| 72 | |
| 73 } lists; | |
| 74 | |
| 75 struct | |
| 76 { | |
| 77 char *kv; | |
| 78 char *sid; | |
| 79 char *mspauth; | |
| 80 unsigned long sl; | |
| 81 char *file; | |
|
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
82 char *client_ip; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
83 int client_port; |
| 5309 | 84 |
| 85 } passport_info; | |
| 86 | |
|
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
87 /* You have no idea how much I hate all that is below. */ |
| 5309 | 88 GaimPlugin *prpl; |
|
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
89 |
|
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
90 /* For MSNP8 and MSNP9. */ |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
91 int num_users; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
92 int total_users; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
93 int num_groups; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
94 int total_groups; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
95 MsnUser *last_user_added; |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
96 |
|
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
97 /* For MSNP7 and lower. */ |
|
5456
40e976d42028
[gaim-migrate @ 5844]
Christian Hammond <chipx86@chipx86.com>
parents:
5406
diff
changeset
|
98 gboolean syncing_lists; |
|
5406
9acf4832c0dc
[gaim-migrate @ 5782]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
99 gboolean lists_synced; |
|
9acf4832c0dc
[gaim-migrate @ 5782]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
100 |
|
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
101 /* For moving buddies from one group to another. Ugh. */ |
|
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
102 gboolean moving_buddy; |
|
5327
b716ffc25d2d
[gaim-migrate @ 5700]
Christian Hammond <chipx86@chipx86.com>
parents:
5322
diff
changeset
|
103 char *dest_group_name; |
|
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
104 MsnUser *moving_user; |
|
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
105 MsnGroup *old_group; |
| 5309 | 106 }; |
| 107 | |
| 108 /** | |
| 109 * Creates an MSN session. | |
| 110 * | |
| 111 * @param account The account. | |
| 112 * @param server The dispatch server. | |
| 113 * @param port The dispatch port. | |
| 114 * | |
| 115 * @return The new MSN session. | |
| 116 */ | |
|
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
117 MsnSession *msn_session_new(GaimAccount *account, |
| 5309 | 118 const char *server, int port); |
| 119 | |
| 120 /** | |
| 121 * Destroys an MSN session. | |
| 122 * | |
| 123 * @param session The MSN session to destroy. | |
| 124 */ | |
| 125 void msn_session_destroy(MsnSession *session); | |
| 126 | |
| 127 /** | |
| 128 * Connects to and initiates an MSN session. | |
| 129 * | |
| 130 * @param session The MSN session. | |
| 131 * | |
| 132 * @return @c TRUE on success, @c FALSE on failure. | |
| 133 */ | |
| 134 gboolean msn_session_connect(MsnSession *session); | |
| 135 | |
| 136 /** | |
| 137 * Disconnects from an MSN session. | |
| 138 * | |
| 139 * @param session The MSN session. | |
| 140 */ | |
| 141 void msn_session_disconnect(MsnSession *session); | |
| 142 | |
| 143 /** | |
| 144 * Opens a new switchboard connection. | |
| 145 * | |
| 146 * @param session The MSN session. | |
| 147 * | |
| 148 * @return The new switchboard connection. | |
| 149 */ | |
| 150 MsnSwitchBoard *msn_session_open_switchboard(MsnSession *session); | |
| 151 | |
| 152 /** | |
| 153 * Finds a switch with the given passport. | |
| 154 * | |
| 155 * @param session The MSN session. | |
| 156 * @param passport The passport to search for. | |
| 157 * | |
| 158 * @return The switchboard, if found. | |
| 159 */ | |
| 160 MsnSwitchBoard *msn_session_find_switch_with_passport( | |
| 161 const MsnSession *session, const char *passport); | |
| 162 | |
| 163 /** | |
| 164 * Finds a switchboard with the given chat ID. | |
| 165 * | |
| 166 * @param session The MSN session. | |
| 167 * @param chat_id The chat ID to search for. | |
| 168 * | |
| 169 * @return The switchboard, if found. | |
| 170 */ | |
| 171 MsnSwitchBoard *msn_session_find_switch_with_id(const MsnSession *session, | |
| 172 int chat_id); | |
| 173 | |
| 174 /** | |
| 175 * Finds the first unused switchboard. | |
| 176 * | |
| 177 * @param session The MSN session. | |
| 178 * | |
| 179 * @return The first unused, writable switchboard, if found. | |
| 180 */ | |
| 181 MsnSwitchBoard *msn_session_find_unused_switch(const MsnSession *session); | |
| 182 | |
| 183 #endif /* _MSN_SESSION_H_ */ |
