Sun, 19 Sep 2004 03:02:28 +0000
[gaim-migrate @ 11003]
this is the msn buddy list sync code from the 1.0.0 tree, also from shx. in
this patch, i changed one instance of "b" to "buddy" to make it compile.
this introduces code to ask the user about discrepances between the local
and server lists on msn.
committer: Luke Schierer <lschiere@pidgin.im>
| 5309 | 1 | /** |
| 2 | * @file session.h MSN session functions | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
|
9198
e8eb6d5eb9eb
[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 |
|
e8eb6d5eb9eb
[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 |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
8 | * source distribution. |
|
6701
7e2db9273748
[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
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
29 | #include "sslconn.h" |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
30 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
31 | #include "notification.h" |
| 5309 | 32 | #include "switchboard.h" |
| 33 | #include "user.h" | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
34 | #include "group.h" |
|
8171
c3c43a25caec
[gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7631
diff
changeset
|
35 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
36 | #include "cmdproc.h" |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
37 | #include "nexus.h" |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
38 | |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
39 | #include "userlist.h" |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
40 | #include "sync.h" |
| 5309 | 41 | |
| 42 | struct _MsnSession | |
| 43 | { | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
44 | GaimAccount *account; |
|
5363
b6e28be0c9bd
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
45 | MsnUser *user; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
46 | int state; |
| 5309 | 47 | |
| 7631 | 48 | guint protocol_ver; |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
49 | |
|
9158
f8dab42adeaf
[gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8808
diff
changeset
|
50 | char *dispatch_host; |
| 5309 | 51 | int dispatch_port; |
| 52 | ||
| 53 | gboolean connected; | |
|
9363
605961038476
[gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9198
diff
changeset
|
54 | gboolean logged_in; /* temporal flag to ignore local blist adds */ |
| 5309 | 55 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
56 | MsnNotification *notification; |
|
8171
c3c43a25caec
[gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7631
diff
changeset
|
57 | MsnNexus *nexus; |
|
c3c43a25caec
[gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7631
diff
changeset
|
58 | |
|
7288
486e8b44a14b
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
59 | gboolean http_method; |
|
8298
eb6f1096ffa6
[gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents:
8171
diff
changeset
|
60 | gint http_poll_timer; |
|
7288
486e8b44a14b
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
61 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
62 | MsnUserList *userlist; |
|
10044
884c09b189e6
[gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9363
diff
changeset
|
63 | MsnUserList *sync_userlist; |
| 5309 | 64 | |
|
8808
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8583
diff
changeset
|
65 | int servconns_count; |
| 5309 | 66 | GList *switches; |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
67 | GList *directconns; |
| 5309 | 68 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
69 | int conv_seq; |
| 5309 | 70 | |
| 71 | struct | |
| 72 | { | |
| 73 | char *kv; | |
| 74 | char *sid; | |
| 75 | char *mspauth; | |
| 76 | unsigned long sl; | |
| 77 | char *file; | |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
78 | char *client_ip; |
|
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
79 | int client_port; |
| 5309 | 80 | |
| 81 | } passport_info; | |
| 82 | ||
|
5322
782746a9bfdd
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
83 | /* You have no idea how much I hate all that is below. */ |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
84 | /* shx: What? ;) */ |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
85 | |
| 5309 | 86 | GaimPlugin *prpl; |
|
5322
782746a9bfdd
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
87 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
88 | MsnSync *sync; |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
89 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
90 | GList *slplinks; |
| 5309 | 91 | }; |
| 92 | ||
| 93 | /** | |
| 94 | * Creates an MSN session. | |
| 95 | * | |
| 96 | * @param account The account. | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
97 | * @param host The dispatch server host. |
|
9158
f8dab42adeaf
[gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8808
diff
changeset
|
98 | * @param port The dispatch server port. |
| 5309 | 99 | * |
| 100 | * @return The new MSN session. | |
| 101 | */ | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
102 | MsnSession *msn_session_new(GaimAccount *account, |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
103 | const char *host, int port, |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
104 | gboolean http_method); |
| 5309 | 105 | |
| 106 | /** | |
| 107 | * Destroys an MSN session. | |
| 108 | * | |
| 109 | * @param session The MSN session to destroy. | |
| 110 | */ | |
| 111 | void msn_session_destroy(MsnSession *session); | |
| 112 | ||
| 113 | /** | |
| 114 | * Connects to and initiates an MSN session. | |
| 115 | * | |
| 116 | * @param session The MSN session. | |
| 117 | * | |
| 118 | * @return @c TRUE on success, @c FALSE on failure. | |
| 119 | */ | |
| 120 | gboolean msn_session_connect(MsnSession *session); | |
| 121 | ||
| 122 | /** | |
| 123 | * Disconnects from an MSN session. | |
| 124 | * | |
| 125 | * @param session The MSN session. | |
| 126 | */ | |
| 127 | void msn_session_disconnect(MsnSession *session); | |
| 128 | ||
| 129 | /** | |
| 130 | * Finds a switchboard with the given chat ID. | |
| 131 | * | |
| 132 | * @param session The MSN session. | |
| 133 | * @param chat_id The chat ID to search for. | |
| 134 | * | |
| 135 | * @return The switchboard, if found. | |
| 136 | */ | |
| 137 | MsnSwitchBoard *msn_session_find_switch_with_id(const MsnSession *session, | |
| 138 | int chat_id); | |
| 139 | ||
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
140 | MsnSwitchBoard *msn_session_find_swboard(MsnSession *session, |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
141 | const char *username); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
142 | MsnSwitchBoard *msn_session_get_swboard(MsnSession *session, |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
143 | const char *username); |
| 5309 | 144 | |
|
10044
884c09b189e6
[gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9363
diff
changeset
|
145 | void msn_session_finish_login(MsnSession *session); |
|
884c09b189e6
[gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9363
diff
changeset
|
146 | |
| 5309 | 147 | #endif /* _MSN_SESSION_H_ */ |