Mercurial > pidgin
annotate src/protocols/msn/notification.c @ 8718:6ab61697426e
[gaim-migrate @ 9473]
simguy wants this
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Tue, 20 Apr 2004 04:04:41 +0000 |
parents | 06dd136238ab |
children | bbd8cdaf0ad5 |
rev | line source |
---|---|
5309 | 1 /** |
2 * @file notification.c Notification server functions | |
3 * | |
4 * gaim | |
5 * | |
8475
06f57183e29f
[gaim-migrate @ 9208]
Christian Hammond <chipx86@chipx86.com>
parents:
8255
diff
changeset
|
6 * Copyright (C) 2003-2004 Christian Hammond <chipx86@gnupdate.org> |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
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 #include "msn.h" | |
23 #include "notification.h" | |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
24 #include "state.h" |
5309 | 25 #include "error.h" |
26 #include "utils.h" | |
27 | |
28 typedef struct | |
29 { | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
30 GaimConnection *gc; |
5309 | 31 MsnUser *user; |
32 | |
33 } MsnPermitAdd; | |
34 | |
35 static GHashTable *notification_commands = NULL; | |
36 static GHashTable *notification_msg_types = NULL; | |
37 | |
38 /************************************************************************** | |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
39 * Utility functions |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
40 **************************************************************************/ |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
41 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
42 add_buddy(MsnServConn *servconn, MsnUser *user) |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
43 { |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
44 MsnSession *session = servconn->session; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
45 GaimAccount *account = session->account; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
46 GaimConnection *gc = gaim_account_get_connection(account); |
6695 | 47 GaimBuddy *b; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
48 MsnGroup *group = NULL; |
6695 | 49 GaimGroup *g = NULL; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
50 GList *l, *l2; |
6767
926d539938ca
[gaim-migrate @ 7304]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
51 GSList *sl; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
52 GSList *buddies; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
53 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
54 buddies = gaim_find_buddies(account, msn_user_get_passport(user)); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
55 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
56 for (l = msn_user_get_group_ids(user); l != NULL; l = l->next) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
57 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
58 int group_id = GPOINTER_TO_INT(l->data); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
59 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
60 if (group_id > -1) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
61 group = msn_groups_find_with_id(session->groups, group_id); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
62 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
63 if (group == NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
64 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
65 gaim_debug(GAIM_DEBUG_WARNING, "msn", |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
66 "Group ID %d for user %s was not defined.\n", |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
67 group_id, msn_user_get_passport(user)); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
68 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
69 /* Find a group that we can stick this guy into. Lamer. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
70 l2 = msn_groups_get_list(session->groups); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
71 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
72 if (l2 != NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
73 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
74 group = l2->data; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
75 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
76 msn_user_add_group_id(user, msn_group_get_id(group)); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
77 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
78 } |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
79 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
80 if (group == NULL || |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
81 (g = gaim_find_group(msn_group_get_name(group))) == NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
82 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
83 gaim_debug(GAIM_DEBUG_ERROR, "msn", |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
84 "Group '%s' appears in server-side " |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
85 "buddy list, but not here!", |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
86 msn_group_get_name(group)); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
87 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
88 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
89 if (group != NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
90 msn_group_add_user(group, user); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
91 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
92 b = NULL; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
93 |
6767
926d539938ca
[gaim-migrate @ 7304]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
94 for (sl = buddies; sl != NULL; sl = sl->next) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
95 { |
6767
926d539938ca
[gaim-migrate @ 7304]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
96 b = (GaimBuddy *)sl->data; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
97 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
98 if (gaim_find_buddys_group(b) == g) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
99 break; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
100 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
101 b = NULL; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
102 } |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
103 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
104 if (b == NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
105 { |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
106 const char *passport, *friendly; |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
107 |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
108 passport = msn_user_get_passport(user); |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
109 |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
110 b = gaim_buddy_new(account, passport, NULL); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
111 |
6773
addc5c8c0df1
[gaim-migrate @ 7310]
Christian Hammond <chipx86@chipx86.com>
parents:
6772
diff
changeset
|
112 b->proto_data = user; |
addc5c8c0df1
[gaim-migrate @ 7310]
Christian Hammond <chipx86@chipx86.com>
parents:
6772
diff
changeset
|
113 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
114 gaim_blist_add_buddy(b, NULL, g, NULL); |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
115 |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
116 if ((friendly = msn_user_get_name(user)) != NULL) |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
117 serv_got_alias(gc, passport, friendly); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
118 } |
6773
addc5c8c0df1
[gaim-migrate @ 7310]
Christian Hammond <chipx86@chipx86.com>
parents:
6772
diff
changeset
|
119 else |
addc5c8c0df1
[gaim-migrate @ 7310]
Christian Hammond <chipx86@chipx86.com>
parents:
6772
diff
changeset
|
120 b->proto_data = user; |
6767
926d539938ca
[gaim-migrate @ 7304]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
121 } |
926d539938ca
[gaim-migrate @ 7304]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
122 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
123 g_slist_free(buddies); |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
124 |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
125 serv_got_alias(gc, (char *)msn_user_get_passport(user), |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
126 (char *)msn_user_get_name(user)); |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
127 |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
128 return TRUE; |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
129 } |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
130 |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
131 /************************************************************************** |
5309 | 132 * Callbacks |
133 **************************************************************************/ | |
134 static void | |
135 msn_accept_add_cb(MsnPermitAdd *pa) | |
136 { | |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5566
diff
changeset
|
137 if (g_list_find(gaim_connections_get_all(), pa->gc) != NULL) { |
5309 | 138 MsnSession *session = pa->gc->proto_data; |
139 char outparams[MSN_BUF_LEN]; | |
140 | |
141 g_snprintf(outparams, sizeof(outparams), "AL %s %s", | |
142 msn_user_get_passport(pa->user), | |
7134 | 143 gaim_url_encode(msn_user_get_name(pa->user))); |
5309 | 144 |
145 if (msn_servconn_send_command(session->notification_conn, | |
146 "ADD", outparams) <= 0) { | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
147 gaim_connection_error(pa->gc, _("Write error")); |
5309 | 148 return; |
149 } | |
150 | |
151 gaim_privacy_permit_add(pa->gc->account, | |
6380
0f0b34c72e69
[gaim-migrate @ 6885]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
152 msn_user_get_passport(pa->user), TRUE); |
7015
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6980
diff
changeset
|
153 gaim_account_notify_added(pa->gc->account, NULL, |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6980
diff
changeset
|
154 msn_user_get_passport(pa->user), |
dece74f05509
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6980
diff
changeset
|
155 msn_user_get_name(pa->user), NULL); |
5309 | 156 } |
157 | |
158 msn_user_destroy(pa->user); | |
159 g_free(pa); | |
160 } | |
161 | |
162 static void | |
163 msn_cancel_add_cb(MsnPermitAdd *pa) | |
164 { | |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5566
diff
changeset
|
165 if (g_list_find(gaim_connections_get_all(), pa->gc) != NULL) { |
5309 | 166 MsnSession *session = pa->gc->proto_data; |
167 char outparams[MSN_BUF_LEN]; | |
168 | |
169 g_snprintf(outparams, sizeof(outparams), "BL %s %s", | |
170 msn_user_get_passport(pa->user), | |
7134 | 171 gaim_url_encode(msn_user_get_name(pa->user))); |
5309 | 172 |
173 if (msn_servconn_send_command(session->notification_conn, | |
174 "ADD", outparams) <= 0) { | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
175 gaim_connection_error(pa->gc, _("Write error")); |
5309 | 176 return; |
177 } | |
178 | |
179 gaim_privacy_deny_add(pa->gc->account, | |
6380
0f0b34c72e69
[gaim-migrate @ 6885]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
180 msn_user_get_passport(pa->user), TRUE); |
5309 | 181 } |
182 | |
183 msn_user_destroy(pa->user); | |
184 g_free(pa); | |
185 } | |
186 | |
187 /************************************************************************** | |
188 * Catch-all commands | |
189 **************************************************************************/ | |
190 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
191 blank_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
192 size_t param_count) |
5309 | 193 { |
194 return TRUE; | |
195 } | |
196 | |
197 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
198 unknown_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
199 size_t param_count) |
5309 | 200 { |
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
201 int errnum = 0; |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
202 |
5334
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
203 if (isdigit(*command)) { |
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
204 errnum = atoi(command); |
5334
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
205 |
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
206 if (errnum == 225) { |
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
207 /* |
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
208 * Ignore this. It happens as a result of moving a buddy from |
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
209 * one group that isn't on the server to another that is. |
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
210 * The user doesn't care if the old group was there or not. |
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
211 */ |
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
212 return TRUE; |
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
213 } |
bbf2141d30d0
[gaim-migrate @ 5709]
Christian Hammond <chipx86@chipx86.com>
parents:
5333
diff
changeset
|
214 } |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
215 |
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
216 msn_error_handle(servconn->session, errnum); |
5309 | 217 |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
218 return TRUE; |
5309 | 219 } |
220 | |
221 | |
222 /************************************************************************** | |
223 * Login | |
224 **************************************************************************/ | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
225 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
226 |
5309 | 227 static gboolean |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
228 cvr_cmd(MsnServConn *servconn, const char *command, const char **params, |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
229 size_t param_count) |
5309 | 230 { |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
231 GaimAccount *account = servconn->session->account; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
232 GaimConnection *gc = gaim_account_get_connection(account); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
233 char outparams[MSN_BUF_LEN]; |
5309 | 234 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
235 g_snprintf(outparams, sizeof(outparams), |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
236 "TWN I %s", gaim_account_get_username(account)); |
5309 | 237 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
238 if (!msn_servconn_send_command(servconn, "USR", outparams)) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
239 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
240 gaim_connection_error(gc, _("Unable to request USR\n")); |
5309 | 241 |
242 return FALSE; | |
243 } | |
244 | |
245 return TRUE; | |
246 } | |
247 | |
248 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
249 inf_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
250 size_t param_count) |
5309 | 251 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
252 GaimAccount *account = servconn->session->account; |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
253 GaimConnection *gc = gaim_account_get_connection(account); |
5309 | 254 char outparams[MSN_BUF_LEN]; |
255 | |
256 if (strcmp(params[1], "MD5")) { | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
257 gaim_connection_error(gc, _("Unable to login using MD5")); |
5309 | 258 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
259 return FALSE; |
5309 | 260 } |
261 | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
262 g_snprintf(outparams, sizeof(outparams), "MD5 I %s", |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
263 gaim_account_get_username(account)); |
5309 | 264 |
265 if (!msn_servconn_send_command(servconn, "USR", outparams)) { | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
266 gaim_connection_error(gc, _("Unable to send USR")); |
5309 | 267 |
268 return FALSE; | |
269 } | |
270 | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
271 gaim_connection_update_progress(gc, _("Requesting to send password"), |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
272 5, MSN_CONNECT_STEPS); |
5309 | 273 |
274 return TRUE; | |
275 } | |
276 | |
277 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
278 usr_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
279 size_t param_count) |
5309 | 280 { |
5326
9737d5ce9dcd
[gaim-migrate @ 5699]
Christian Hammond <chipx86@chipx86.com>
parents:
5323
diff
changeset
|
281 MsnSession *session = servconn->session; |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
282 GaimAccount *account = session->account; |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
283 GaimConnection *gc = gaim_account_get_connection(account); |
5309 | 284 char outparams[MSN_BUF_LEN]; |
285 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
286 /* |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
287 * We're either getting the passport connect info (if we're on |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
288 * MSNP8 or higher), or a challenge request (MSNP7 and lower). |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
289 * |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
290 * Let's find out. |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
291 */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
292 if (!g_ascii_strcasecmp(params[1], "OK")) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
293 { |
7134 | 294 const char *friendly = gaim_url_decode(params[3]); |
5508
2a57266df5f6
[gaim-migrate @ 5907]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
295 |
5309 | 296 /* OK */ |
297 | |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
298 gaim_connection_set_display_name(gc, friendly); |
5508
2a57266df5f6
[gaim-migrate @ 5907]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
299 |
5456
40e976d42028
[gaim-migrate @ 5844]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
300 session->syncing_lists = TRUE; |
40e976d42028
[gaim-migrate @ 5844]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
301 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
302 if (!msn_servconn_send_command(servconn, "SYN", "0")) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
303 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
304 gaim_connection_error(gc, _("Unable to write")); |
5309 | 305 |
306 return FALSE; | |
307 } | |
5326
9737d5ce9dcd
[gaim-migrate @ 5699]
Christian Hammond <chipx86@chipx86.com>
parents:
5323
diff
changeset
|
308 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
309 gaim_connection_update_progress(gc, _("Retrieving buddy list"), |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
310 7, MSN_CONNECT_STEPS); |
5309 | 311 } |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
312 else if (!g_ascii_strcasecmp(params[1], "TWN")) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
313 { |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
314 char **elems, **cur, **tokens; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
315 |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
316 /* Passport authentication */ |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
317 session->nexus = msn_nexus_new(session); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
318 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
319 /* Parse the challenge data. */ |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
320 elems = g_strsplit(params[3], ",", 0); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
321 |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
322 for (cur = elems; *cur != NULL; cur++) |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
323 { |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
324 tokens = g_strsplit(*cur, "=", 2); |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
325 g_hash_table_insert(session->nexus->challenge_data, tokens[0], tokens[1]); |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
326 /* Don't free each of the tokens, only the array. */ |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
327 g_free(tokens); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
328 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
329 |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
330 g_strfreev(elems); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
331 |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
332 msn_nexus_connect(session->nexus); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
333 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
334 gaim_connection_update_progress(gc, _("Password sent"), |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
335 6, MSN_CONNECT_STEPS); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
336 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
337 else if (!g_ascii_strcasecmp(params[1], "MD5")) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
338 { |
5309 | 339 /* Challenge */ |
340 const char *challenge = params[3]; | |
341 char buf[MSN_BUF_LEN]; | |
342 md5_state_t st; | |
343 md5_byte_t di[16]; | |
344 int i; | |
345 | |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
346 g_snprintf(buf, sizeof(buf), "%s%s", challenge, |
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
347 gaim_account_get_password(account)); |
5309 | 348 |
349 md5_init(&st); | |
350 md5_append(&st, (const md5_byte_t *)buf, strlen(buf)); | |
351 md5_finish(&st, di); | |
352 | |
353 g_snprintf(outparams, sizeof(outparams), "MD5 S "); | |
354 | |
355 for (i = 0; i < 16; i++) { | |
356 g_snprintf(buf, sizeof(buf), "%02x", di[i]); | |
357 strcat(outparams, buf); | |
358 } | |
359 | |
360 if (!msn_servconn_send_command(servconn, "USR", outparams)) { | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
361 gaim_connection_error(gc, _("Unable to send password")); |
5309 | 362 |
363 return FALSE; | |
364 } | |
365 | |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
366 gaim_connection_update_progress(gc, _("Password sent"), |
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
367 6, MSN_CONNECT_STEPS); |
5309 | 368 } |
369 | |
370 return TRUE; | |
371 } | |
372 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
373 static gboolean |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
374 ver_cmd(MsnServConn *servconn, const char *command, const char **params, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
375 size_t param_count) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
376 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
377 MsnSession *session = servconn->session; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
378 GaimAccount *account = session->account; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
379 GaimConnection *gc = gaim_account_get_connection(account); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
380 gboolean protocol_supported = FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
381 char outparams[MSN_BUF_LEN]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
382 char proto_str[8]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
383 size_t i; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
384 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
385 g_snprintf(proto_str, sizeof(proto_str), "MSNP%d", session->protocol_ver); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
386 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
387 for (i = 1; i < param_count; i++) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
388 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
389 if (!strcmp(params[i], proto_str)) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
390 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
391 protocol_supported = TRUE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
392 break; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
393 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
394 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
395 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
396 if (!protocol_supported) { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
397 gaim_connection_error(gc, _("Protocol not supported")); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
398 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
399 return FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
400 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
401 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
402 if (session->protocol_ver >= 8) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
403 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
404 g_snprintf(outparams, sizeof(outparams), |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
405 "0x0409 winnt 5.1 i386 MSNMSGR 6.0.0602 MSMSGS %s", |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
406 gaim_account_get_username(account)); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
407 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
408 if (!msn_servconn_send_command(servconn, "CVR", outparams)) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
409 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
410 gaim_connection_error(gc, _("Unable to request CVR\n")); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
411 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
412 return FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
413 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
414 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
415 else |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
416 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
417 if (!msn_servconn_send_command(servconn, "INF", NULL)) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
418 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
419 gaim_connection_error(gc, _("Unable to request INF\n")); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
420 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
421 return FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
422 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
423 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
424 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
425 return TRUE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
426 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
427 |
5309 | 428 /************************************************************************** |
429 * Log out | |
430 **************************************************************************/ | |
431 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
432 out_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
433 size_t param_count) |
5309 | 434 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
435 GaimConnection *gc = servconn->session->account->gc; |
5309 | 436 |
437 if (!g_ascii_strcasecmp(params[0], "OTH")) { | |
8669 | 438 gc->wants_to_die = TRUE; |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
439 gaim_connection_error(gc, |
5309 | 440 _("You have been disconnected. You have " |
441 "signed on from another location.")); | |
442 } | |
443 else if (!g_ascii_strcasecmp(params[0], "SSD")) { | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
444 gaim_connection_error(gc, |
5309 | 445 _("You have been disconnected. The MSN servers " |
446 "are going down temporarily.")); | |
447 } | |
448 | |
449 return FALSE; | |
450 } | |
451 | |
452 /************************************************************************** | |
453 * Messages | |
454 **************************************************************************/ | |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
455 static void |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
456 msg_cmd_post(MsnServConn *servconn, char *payload, size_t len) |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
457 { |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
458 MsnMessage *msg = msn_message_new(); |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
459 |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
460 msg->passport = servconn->msg_passport; |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
461 |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
462 msn_message_parse_payload(msg, payload, len); |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
463 |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
464 msn_servconn_process_message(servconn, msg); |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
465 |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
466 msn_message_destroy(msg); |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
467 } |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
468 |
5309 | 469 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
470 msg_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
471 size_t param_count) |
5309 | 472 { |
473 gaim_debug(GAIM_DEBUG_INFO, "msn", "Found message. Parsing.\n"); | |
474 | |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
475 servconn->payload_cb = msg_cmd_post; |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
476 servconn->payload_len = atoi(params[2]); |
5962
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5961
diff
changeset
|
477 |
5309 | 478 servconn->msg_passport = g_strdup(params[0]); |
479 | |
480 return TRUE; | |
481 } | |
482 | |
483 /************************************************************************** | |
484 * Challenges | |
485 **************************************************************************/ | |
486 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
487 chl_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
488 size_t param_count) |
5309 | 489 { |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
490 MsnSession *session = servconn->session; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
491 GaimConnection *gc = session->account->gc; |
5309 | 492 char buf[MSN_BUF_LEN]; |
493 char buf2[3]; | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
494 const char *challenge_resp; |
5309 | 495 md5_state_t st; |
496 md5_byte_t di[16]; | |
497 int i; | |
498 | |
499 md5_init(&st); | |
500 md5_append(&st, (const md5_byte_t *)params[1], strlen(params[1])); | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
501 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
502 if (session->protocol_ver >= 8) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
503 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
504 challenge_resp = "VT6PX?UQTM4WM%YR"; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
505 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
506 else |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
507 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
508 challenge_resp = "Q1P7W2E4J9R8U3S5"; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
509 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
510 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
511 md5_append(&st, (const md5_byte_t *)challenge_resp, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
512 strlen(challenge_resp)); |
5309 | 513 md5_finish(&st, di); |
514 | |
515 g_snprintf(buf, sizeof(buf), | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
516 "QRY %u %s 32\r\n", |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
517 servconn->session->trId++, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
518 (session->protocol_ver >= 8 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
519 ? "PROD0038W!61ZTF9" |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
520 : "msmsgs@msnmsgr.com")); |
5309 | 521 |
522 for (i = 0; i < 16; i++) { | |
523 g_snprintf(buf2, sizeof(buf2), "%02x", di[i]); | |
524 strcat(buf, buf2); | |
525 } | |
526 | |
527 if (msn_servconn_write(servconn, buf, strlen(buf)) <= 0) { | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
528 gaim_connection_error(gc, _("Unable to write to server")); |
5309 | 529 } |
530 | |
531 return TRUE; | |
532 } | |
533 | |
534 /************************************************************************** | |
535 * Buddy Lists | |
536 **************************************************************************/ | |
537 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
538 add_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
539 size_t param_count) |
5309 | 540 { |
541 MsnSession *session = servconn->session; | |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
542 MsnUser *user; |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
543 GaimAccount *account = session->account; |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
544 GaimConnection *gc = gaim_account_get_connection(account); |
5309 | 545 MsnPermitAdd *pa; |
546 GSList *sl; | |
5890
1a2fcda8a5e7
[gaim-migrate @ 6322]
Christian Hammond <chipx86@chipx86.com>
parents:
5887
diff
changeset
|
547 const char *list, *passport, *group_id = NULL; |
7162 | 548 const char *friend; |
5309 | 549 char msg[MSN_BUF_LEN]; |
550 | |
5918
7134be4a319f
[gaim-migrate @ 6358]
Christian Hammond <chipx86@chipx86.com>
parents:
5890
diff
changeset
|
551 list = params[1]; |
7134be4a319f
[gaim-migrate @ 6358]
Christian Hammond <chipx86@chipx86.com>
parents:
5890
diff
changeset
|
552 passport = params[3]; |
7134 | 553 friend = gaim_url_decode(params[4]); |
5309 | 554 |
5918
7134be4a319f
[gaim-migrate @ 6358]
Christian Hammond <chipx86@chipx86.com>
parents:
5890
diff
changeset
|
555 if (param_count >= 6) |
7134be4a319f
[gaim-migrate @ 6358]
Christian Hammond <chipx86@chipx86.com>
parents:
5890
diff
changeset
|
556 group_id = params[5]; |
5309 | 557 |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
558 if (!g_ascii_strcasecmp(list, "FL")) { |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
559 user = msn_user_new(session, passport, NULL); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
560 |
5933
44eb6d75a5c6
[gaim-migrate @ 6373]
Christian Hammond <chipx86@chipx86.com>
parents:
5918
diff
changeset
|
561 if (group_id != NULL) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
562 msn_user_add_group_id(user, atoi(group_id)); |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
563 |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
564 add_buddy(servconn, user); |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
565 |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
566 return TRUE; |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
567 } |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
568 else if (g_ascii_strcasecmp(list, "RL")) |
5309 | 569 return TRUE; |
570 | |
571 for (sl = gc->account->permit; sl != NULL; sl = sl->next) { | |
572 if (!gaim_utf8_strcasecmp(sl->data, passport)) | |
573 return TRUE; | |
574 } | |
575 | |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
576 user = msn_user_new(session, passport, friend); |
7941
14b8dc2f5408
[gaim-migrate @ 8612]
Christian Hammond <chipx86@chipx86.com>
parents:
7934
diff
changeset
|
577 msn_user_set_name(user, friend); |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
578 |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
579 pa = g_new0(MsnPermitAdd, 1); |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
580 pa->user = user; |
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
581 pa->gc = gc; |
5309 | 582 |
583 g_snprintf(msg, sizeof(msg), | |
584 _("The user %s (%s) wants to add %s to his or her buddy list."), | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
585 passport, friend, gaim_account_get_username(account)); |
5309 | 586 |
5498
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5479
diff
changeset
|
587 gaim_request_action(gc, NULL, msg, NULL, 0, pa, 2, |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5479
diff
changeset
|
588 _("Authorize"), G_CALLBACK(msn_accept_add_cb), |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5479
diff
changeset
|
589 _("Deny"), G_CALLBACK(msn_cancel_add_cb)); |
5309 | 590 |
591 return TRUE; | |
592 } | |
593 | |
594 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
595 adg_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
596 size_t param_count) |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
597 { |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
598 MsnGroup *group; |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
599 MsnSession *session = servconn->session; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
600 gint group_id; |
7162 | 601 const char *group_name; |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
602 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
603 group_id = atoi(params[3]); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
604 |
7134 | 605 group_name = gaim_url_decode(params[2]); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
606 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
607 group = msn_group_new(session, group_id, group_name); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
608 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
609 msn_groups_add(session->groups, group); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
610 |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
611 return TRUE; |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
612 } |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
613 |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
614 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
615 blp_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
616 size_t param_count) |
5309 | 617 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
618 GaimConnection *gc = servconn->session->account->gc; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
619 const char *list_name; |
5309 | 620 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
621 if (servconn->session->protocol_ver >= 8) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
622 list_name = params[0]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
623 else |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
624 list_name = params[2]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
625 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
626 if (!g_ascii_strcasecmp(list_name, "AL")) { |
5309 | 627 /* |
628 * If the current setting is AL, messages from users who | |
629 * are not in BL will be delivered. | |
630 * | |
631 * In other words, deny some. | |
632 */ | |
8175 | 633 gc->account->perm_deny = GAIM_PRIVACY_DENY_USERS; |
5309 | 634 } |
635 else { | |
636 /* If the current setting is BL, only messages from people | |
637 * who are in the AL will be delivered. | |
638 * | |
639 * In other words, permit some. | |
640 */ | |
8175 | 641 gc->account->perm_deny = GAIM_PRIVACY_ALLOW_USERS; |
5309 | 642 } |
643 | |
644 return TRUE; | |
645 } | |
646 | |
647 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
648 bpr_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
649 size_t param_count) |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
650 { |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
651 MsnSession *session = servconn->session; |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
652 GaimConnection *gc = session->account->gc; |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
653 const char *passport, *type, *value; |
6695 | 654 GaimBuddy *b; |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
655 MsnUser *user; |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
656 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
657 if (param_count == 4) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
658 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
659 passport = params[1]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
660 type = params[2]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
661 value = params[3]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
662 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
663 else if (param_count == 2) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
664 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
665 passport = msn_user_get_passport(session->last_user_added); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
666 type = params[0]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
667 value = params[1]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
668 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
669 else |
5963
eb336b2c451f
[gaim-migrate @ 6410]
Christian Hammond <chipx86@chipx86.com>
parents:
5962
diff
changeset
|
670 return TRUE; |
eb336b2c451f
[gaim-migrate @ 6410]
Christian Hammond <chipx86@chipx86.com>
parents:
5962
diff
changeset
|
671 |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
672 user = msn_users_find_with_passport(session->users, passport); |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
673 |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
674 if (value != NULL) { |
5375
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
675 if (!strcmp(type, "MOB")) { |
8255
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
8175
diff
changeset
|
676 if (!strcmp(value, "Y") || !strcmp(value, "N")) { |
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
8175
diff
changeset
|
677 user->mobile = (!strcmp(value, "Y") ? TRUE : FALSE); |
5375
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
678 |
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
679 if ((b = gaim_find_buddy(gc->account, passport)) != NULL) { |
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
680 if (GAIM_BUDDY_IS_ONLINE(b)) { |
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
681 serv_got_update(gc, (char *)passport, |
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
682 1, 0, 0, 0, b->uc); |
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
683 } |
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
684 } |
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
685 } |
d8ebee2f749c
[gaim-migrate @ 5751]
Christian Hammond <chipx86@chipx86.com>
parents:
5373
diff
changeset
|
686 } |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
687 else if (!strcmp(type, "PHH")) |
7134 | 688 msn_user_set_home_phone(user, gaim_url_decode(value)); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
689 else if (!strcmp(type, "PHW")) |
7134 | 690 msn_user_set_work_phone(user, gaim_url_decode(value)); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
691 else if (!strcmp(type, "PHM")) |
7134 | 692 msn_user_set_mobile_phone(user, gaim_url_decode(value)); |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
693 } |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
694 |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
695 return TRUE; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
696 } |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
697 |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
698 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
699 fln_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
700 size_t param_count) |
5309 | 701 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
702 GaimConnection *gc = servconn->session->account->gc; |
5309 | 703 |
704 serv_got_update(gc, (char *)params[0], 0, 0, 0, 0, 0); | |
705 | |
706 return TRUE; | |
707 } | |
708 | |
709 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
710 iln_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
711 size_t param_count) |
5309 | 712 { |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
713 MsnSession *session = servconn->session; |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
714 GaimConnection *gc = session->account->gc; |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
715 MsnUser *user; |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
716 MsnObject *msnobj; |
5309 | 717 int status = 0; |
718 const char *state, *passport, *friend; | |
6695 | 719 GaimBuddy *b; |
5309 | 720 |
721 state = params[1]; | |
722 passport = params[2]; | |
7134 | 723 friend = gaim_url_decode(params[3]); |
5309 | 724 |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
725 user = msn_users_find_with_passport(session->users, passport); |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
726 |
6833
ccfbd7c552ba
[gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents:
6830
diff
changeset
|
727 serv_got_alias(gc, (char *)passport, (char *)friend); |
ccfbd7c552ba
[gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents:
6830
diff
changeset
|
728 |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
729 msn_user_set_name(user, friend); |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
730 |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
731 if (session->protocol_ver >= 9 && param_count == 6) |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
732 { |
7134 | 733 msnobj = msn_object_new_from_string(gaim_url_decode(params[5])); |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
734 msn_user_set_object(user, msnobj); |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
735 } |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
736 |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
737 if ((b = gaim_find_buddy(gc->account, passport)) != NULL) |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
738 status |= ((((b->uc) >> 1) & 0xF0) << 1); |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
739 |
5309 | 740 if (!g_ascii_strcasecmp(state, "BSY")) |
741 status |= UC_UNAVAILABLE | (MSN_BUSY << 1); | |
742 else if (!g_ascii_strcasecmp(state, "IDL")) | |
743 status |= UC_UNAVAILABLE | (MSN_IDLE << 1); | |
744 else if (!g_ascii_strcasecmp(state, "BRB")) | |
745 status |= UC_UNAVAILABLE | (MSN_BRB << 1); | |
746 else if (!g_ascii_strcasecmp(state, "AWY")) | |
747 status |= UC_UNAVAILABLE | (MSN_AWAY << 1); | |
748 else if (!g_ascii_strcasecmp(state, "PHN")) | |
749 status |= UC_UNAVAILABLE | (MSN_PHONE << 1); | |
750 else if (!g_ascii_strcasecmp(state, "LUN")) | |
751 status |= UC_UNAVAILABLE | (MSN_LUNCH << 1); | |
752 | |
753 serv_got_update(gc, (char *)passport, 1, 0, 0, 0, status); | |
754 | |
755 return TRUE; | |
756 } | |
757 | |
758 static gboolean | |
5960
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
759 ipg_cmd(MsnServConn *servconn, const char *command, const char **params, |
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
760 size_t param_count) |
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
761 { |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
762 servconn->payload_cb = NULL; |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
763 servconn->payload_len = atoi(params[2]); |
5960
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
764 |
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
765 return TRUE; |
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
766 } |
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
767 |
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
768 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
769 lsg_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
770 size_t param_count) |
5309 | 771 { |
772 MsnSession *session = servconn->session; | |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
773 MsnGroup *group; |
6695 | 774 GaimGroup *g; |
5309 | 775 const char *name; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
776 int num_groups, group_id; |
5309 | 777 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
778 if (session->protocol_ver >= 8) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
779 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
780 group_id = atoi(params[0]); |
7134 | 781 name = gaim_url_decode(params[1]); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
782 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
783 else |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
784 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
785 num_groups = atoi(params[3]); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
786 group_id = atoi(params[4]); |
7134 | 787 name = gaim_url_decode(params[5]); |
5309 | 788 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
789 if (num_groups == 0) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
790 return TRUE; |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
791 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
792 if (!strcmp(name, "~")) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
793 name = _("Buddies"); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
794 } |
5323
29754a7d94e5
[gaim-migrate @ 5695]
Christian Hammond <chipx86@chipx86.com>
parents:
5322
diff
changeset
|
795 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
796 group = msn_group_new(session, group_id, name); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
797 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
798 msn_groups_add(session->groups, group); |
5309 | 799 |
800 if ((g = gaim_find_group(name)) == NULL) { | |
801 g = gaim_group_new(name); | |
802 gaim_blist_add_group(g, NULL); | |
803 } | |
804 | |
805 return TRUE; | |
806 } | |
807 | |
808 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
809 lst_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
810 size_t param_count) |
5309 | 811 { |
812 MsnSession *session = servconn->session; | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
813 GaimAccount *account = session->account; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
814 GaimConnection *gc = gaim_account_get_connection(account); |
5768 | 815 const char *passport = NULL; |
816 const char *friend = NULL; | |
5309 | 817 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
818 if (session->protocol_ver >= 8) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
819 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
820 const char *group_nums; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
821 int list_op; |
5309 | 822 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
823 passport = params[0]; |
7134 | 824 friend = gaim_url_decode(params[1]); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
825 list_op = atoi(params[2]); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
826 group_nums = params[3]; |
5309 | 827 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
828 if (list_op & MSN_LIST_FL_OP) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
829 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
830 MsnUser *user; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
831 char **c; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
832 char **tokens; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
833 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
834 user = msn_user_new(session, passport, friend); |
5406
9acf4832c0dc
[gaim-migrate @ 5782]
Christian Hammond <chipx86@chipx86.com>
parents:
5385
diff
changeset
|
835 |
7934
28609aa6c865
[gaim-migrate @ 8605]
Christian Hammond <chipx86@chipx86.com>
parents:
7820
diff
changeset
|
836 /* Ensure we have a friendly name set. */ |
28609aa6c865
[gaim-migrate @ 8605]
Christian Hammond <chipx86@chipx86.com>
parents:
7820
diff
changeset
|
837 msn_user_set_name(user, friend); |
28609aa6c865
[gaim-migrate @ 8605]
Christian Hammond <chipx86@chipx86.com>
parents:
7820
diff
changeset
|
838 |
8029 | 839 tokens = g_strsplit((group_nums ? group_nums : ""), ",", -1); |
5309 | 840 |
6767
926d539938ca
[gaim-migrate @ 7304]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
841 gaim_debug_misc("msn", "Fetching group IDs from '%s'\n", |
926d539938ca
[gaim-migrate @ 7304]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
842 group_nums); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
843 for (c = tokens; *c != NULL; c++) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
844 { |
6767
926d539938ca
[gaim-migrate @ 7304]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
845 gaim_debug_misc("msn", "Appending group ID %d\n", atoi(*c)); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
846 msn_user_add_group_id(user, atoi(*c)); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
847 } |
5309 | 848 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
849 g_strfreev(tokens); |
5309 | 850 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
851 session->lists.forward = |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
852 g_slist_append(session->lists.forward, user); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
853 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
854 session->last_user_added = user; |
5309 | 855 } |
856 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
857 if (list_op & MSN_LIST_AL_OP) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
858 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
859 /* These are users who are allowed to see our status. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
860 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
861 if (g_slist_find_custom(account->deny, passport, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
862 (GCompareFunc)strcmp)) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
863 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
864 gaim_privacy_deny_remove(gc->account, passport, TRUE); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
865 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
866 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
867 gaim_privacy_permit_add(account, passport, TRUE); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
868 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
869 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
870 if (list_op & MSN_LIST_BL_OP) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
871 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
872 /* These are users who are not allowed to see our status. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
873 gaim_privacy_deny_add(account, passport, TRUE); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
874 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
875 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
876 if (list_op & MSN_LIST_RL_OP) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
877 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
878 /* These are users who have us on their contact list. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
879 |
5309 | 880 gboolean new_entry = TRUE; |
881 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
882 if (g_slist_find_custom(account->permit, passport, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
883 (GCompareFunc)g_ascii_strcasecmp) || |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
884 g_slist_find_custom(account->deny, passport, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
885 (GCompareFunc)g_ascii_strcasecmp)) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
886 { |
5309 | 887 new_entry = FALSE; |
888 } | |
889 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
890 if (new_entry) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
891 { |
5309 | 892 MsnPermitAdd *pa; |
893 char msg[MSN_BUF_LEN]; | |
894 | |
895 pa = g_new0(MsnPermitAdd, 1); | |
896 pa->user = msn_user_new(session, passport, friend); | |
897 pa->gc = gc; | |
898 | |
7934
28609aa6c865
[gaim-migrate @ 8605]
Christian Hammond <chipx86@chipx86.com>
parents:
7820
diff
changeset
|
899 /* Ensure we have a friendly name set. */ |
28609aa6c865
[gaim-migrate @ 8605]
Christian Hammond <chipx86@chipx86.com>
parents:
7820
diff
changeset
|
900 msn_user_set_name(pa->user, friend); |
28609aa6c865
[gaim-migrate @ 8605]
Christian Hammond <chipx86@chipx86.com>
parents:
7820
diff
changeset
|
901 |
5309 | 902 g_snprintf(msg, sizeof(msg), |
903 _("The user %s (%s) wants to add you to their " | |
904 "buddy list."), | |
905 msn_user_get_passport(pa->user), | |
906 msn_user_get_name(pa->user)); | |
907 | |
5498
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5479
diff
changeset
|
908 gaim_request_action(gc, NULL, msg, NULL, 0, pa, 2, |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5479
diff
changeset
|
909 _("Authorize"), |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5479
diff
changeset
|
910 G_CALLBACK(msn_accept_add_cb), |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5479
diff
changeset
|
911 _("Deny"), |
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5479
diff
changeset
|
912 G_CALLBACK(msn_cancel_add_cb)); |
5309 | 913 } |
914 } | |
915 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
916 session->num_users++; |
5309 | 917 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
918 if (session->num_users == session->total_users) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
919 { |
7590
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7566
diff
changeset
|
920 msn_user_set_buddy_icon(session->user, |
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7566
diff
changeset
|
921 gaim_account_get_buddy_icon(session->account)); |
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7566
diff
changeset
|
922 |
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7566
diff
changeset
|
923 if (!msn_session_change_status(session, "NLN")) |
5456
40e976d42028
[gaim-migrate @ 5844]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
924 return FALSE; |
40e976d42028
[gaim-migrate @ 5844]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
925 |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
926 gaim_connection_set_state(gc, GAIM_CONNECTED); |
5456
40e976d42028
[gaim-migrate @ 5844]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
927 serv_finish_login(gc); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
928 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
929 if (session->lists.allow == NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
930 session->lists.allow = g_slist_copy(account->permit); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
931 else |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
932 session->lists.allow = g_slist_concat(session->lists.allow, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
933 account->permit); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
934 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
935 if (session->lists.block == NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
936 session->lists.block = g_slist_copy(account->permit); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
937 else |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
938 session->lists.block = g_slist_concat(session->lists.block, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
939 account->deny); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
940 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
941 while (session->lists.forward != NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
942 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
943 MsnUser *user = session->lists.forward->data; |
6777
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
944 GSList *buddies; |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
945 GSList *sl; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
946 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
947 session->lists.forward = |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
948 g_slist_remove(session->lists.forward, user); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
949 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
950 add_buddy(servconn, user); |
6777
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
951 |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
952 buddies = gaim_find_buddies(account, |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
953 msn_user_get_passport(user)); |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
954 |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
955 /* Find all occurrences of this buddy in the wrong place. */ |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
956 for (sl = buddies; sl != NULL; sl = sl->next) |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
957 { |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
958 GaimBuddy *b = sl->data; |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
959 |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
960 if (b->proto_data == NULL) |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
961 { |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
962 gaim_debug_warning("msn", |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
963 "Deleting misplaced user %s (%s) during sync " |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
964 "with server.\n", |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
965 b->name, gaim_find_buddys_group(b)->name); |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
966 |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
967 gaim_blist_remove_buddy(b); |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
968 } |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
969 } |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
970 |
513fd80bcd2e
[gaim-migrate @ 7315]
Christian Hammond <chipx86@chipx86.com>
parents:
6773
diff
changeset
|
971 g_slist_free(buddies); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
972 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
973 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
974 session->syncing_lists = FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
975 session->lists_synced = TRUE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
976 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
977 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
978 else |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
979 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
980 const char *list_name; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
981 int user_num; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
982 int num_users; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
983 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
984 list_name = params[1]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
985 user_num = atoi(params[3]); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
986 num_users = atoi(params[4]); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
987 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
988 if (g_ascii_strcasecmp(list_name, "RL") && |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
989 user_num == 0 && num_users == 0) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
990 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
991 return TRUE; /* There are no users on this list. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
992 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
993 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
994 if (num_users > 0) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
995 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
996 passport = params[5]; |
7134 | 997 friend = gaim_url_decode(params[6]); |
5309 | 998 } |
999 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1000 if (session->syncing_lists && session->lists_synced) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1001 return TRUE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1002 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1003 if (!g_ascii_strcasecmp(list_name, "FL") && user_num != 0) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1004 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1005 /* These are users on our contact list. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1006 MsnUser *user; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1007 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1008 user = msn_user_new(session, passport, friend); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1009 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1010 if (param_count == 8) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1011 msn_user_add_group_id(user, atoi(params[7])); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1012 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1013 session->lists.forward = |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1014 g_slist_append(session->lists.forward, user); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1015 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1016 else if (!g_ascii_strcasecmp(list_name, "AL") && user_num != 0) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1017 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1018 /* These are users who are allowed to see our status. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1019 if (g_slist_find_custom(gc->account->deny, passport, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1020 (GCompareFunc)strcmp)) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1021 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1022 gaim_debug(GAIM_DEBUG_INFO, "msn", |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1023 "Moving user from deny list to permit: %s (%s)\n", |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1024 passport, friend); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1025 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1026 gaim_privacy_deny_remove(gc->account, passport, TRUE); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1027 } |
5309 | 1028 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1029 gaim_privacy_permit_add(gc->account, passport, TRUE); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1030 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1031 else if (!g_ascii_strcasecmp(list_name, "BL") && user_num != 0) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1032 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1033 /* These are users who are not allowed to see our status. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1034 gaim_privacy_deny_add(gc->account, passport, TRUE); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1035 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1036 else if (!g_ascii_strcasecmp(list_name, "RL")) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1037 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1038 /* These are users who have us on their contact list. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1039 if (user_num > 0) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1040 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1041 gboolean new_entry = TRUE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1042 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1043 if (g_slist_find_custom(gc->account->permit, passport, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1044 (GCompareFunc)g_ascii_strcasecmp)) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1045 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1046 new_entry = FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1047 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1048 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1049 if (g_slist_find_custom(gc->account->deny, passport, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1050 (GCompareFunc)g_ascii_strcasecmp)) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1051 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1052 new_entry = FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1053 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1054 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1055 if (new_entry) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1056 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1057 MsnPermitAdd *pa; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1058 char msg[MSN_BUF_LEN]; |
5309 | 1059 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1060 gaim_debug(GAIM_DEBUG_WARNING, "msn", |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1061 "Unresolved MSN RL entry: %s\n", passport); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1062 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1063 pa = g_new0(MsnPermitAdd, 1); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1064 pa->user = msn_user_new(session, passport, friend); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1065 pa->gc = gc; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1066 |
7941
14b8dc2f5408
[gaim-migrate @ 8612]
Christian Hammond <chipx86@chipx86.com>
parents:
7934
diff
changeset
|
1067 msn_user_set_name(pa->user, friend); |
14b8dc2f5408
[gaim-migrate @ 8612]
Christian Hammond <chipx86@chipx86.com>
parents:
7934
diff
changeset
|
1068 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1069 g_snprintf(msg, sizeof(msg), |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1070 _("The user %s (%s) wants to add you to their " |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1071 "buddy list."), |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1072 msn_user_get_passport(pa->user), |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1073 msn_user_get_name(pa->user)); |
5309 | 1074 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1075 gaim_request_action(gc, NULL, msg, NULL, 0, pa, 2, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1076 _("Authorize"), |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1077 G_CALLBACK(msn_accept_add_cb), |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1078 _("Deny"), |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1079 G_CALLBACK(msn_cancel_add_cb)); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1080 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1081 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1082 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1083 if (user_num != num_users) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1084 return TRUE; /* This isn't the last one in the RL. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1085 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1086 /* Now we're at the last one, so we can do final work. */ |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1087 if (!session->lists_synced) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1088 { |
7590
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7566
diff
changeset
|
1089 if (!msn_session_change_status(session, "NLN")) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1090 return FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1091 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1092 gaim_connection_set_state(gc, GAIM_CONNECTED); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1093 serv_finish_login(gc); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1094 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1095 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1096 if (session->lists.allow == NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1097 session->lists.allow = g_slist_copy(gc->account->permit); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1098 else |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1099 session->lists.allow = g_slist_concat(session->lists.allow, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1100 gc->account->permit); |
5406
9acf4832c0dc
[gaim-migrate @ 5782]
Christian Hammond <chipx86@chipx86.com>
parents:
5385
diff
changeset
|
1101 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1102 if (session->lists.block == NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1103 session->lists.block = g_slist_copy(gc->account->deny); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1104 else |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1105 session->lists.block = g_slist_concat(session->lists.block, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1106 gc->account->deny); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1107 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1108 while (session->lists.forward != NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1109 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1110 MsnUser *user = session->lists.forward->data; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1111 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1112 session->lists.forward = |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1113 g_slist_remove(session->lists.forward, user); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1114 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1115 add_buddy(servconn, user); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1116 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1117 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1118 session->syncing_lists = FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1119 session->lists_synced = TRUE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1120 } |
5309 | 1121 } |
1122 | |
1123 return TRUE; | |
1124 } | |
1125 | |
1126 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1127 nln_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1128 size_t param_count) |
5309 | 1129 { |
1130 MsnSession *session = servconn->session; | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1131 GaimConnection *gc = session->account->gc; |
6829
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
1132 MsnUser *user; |
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
1133 MsnObject *msnobj; |
5309 | 1134 const char *state; |
1135 const char *passport; | |
1136 const char *friend; | |
1137 int status = 0; | |
1138 | |
1139 state = params[0]; | |
1140 passport = params[1]; | |
7134 | 1141 friend = gaim_url_decode(params[2]); |
5309 | 1142 |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
1143 user = msn_users_find_with_passport(session->users, passport); |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
1144 |
6833
ccfbd7c552ba
[gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents:
6830
diff
changeset
|
1145 serv_got_alias(gc, (char *)passport, (char *)friend); |
ccfbd7c552ba
[gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents:
6830
diff
changeset
|
1146 |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
1147 msn_user_set_name(user, friend); |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
1148 |
6829
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
1149 if (session->protocol_ver >= 9 && param_count == 5) |
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
1150 { |
7134 | 1151 msnobj = msn_object_new_from_string(gaim_url_decode(params[4])); |
6829
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
1152 msn_user_set_object(user, msnobj); |
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
1153 } |
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
1154 |
5309 | 1155 if (!g_ascii_strcasecmp(state, "BSY")) |
1156 status |= UC_UNAVAILABLE | (MSN_BUSY << 1); | |
1157 else if (!g_ascii_strcasecmp(state, "IDL")) | |
1158 status |= UC_UNAVAILABLE | (MSN_IDLE << 1); | |
1159 else if (!g_ascii_strcasecmp(state, "BRB")) | |
1160 status |= UC_UNAVAILABLE | (MSN_BRB << 1); | |
1161 else if (!g_ascii_strcasecmp(state, "AWY")) | |
1162 status |= UC_UNAVAILABLE | (MSN_AWAY << 1); | |
1163 else if (!g_ascii_strcasecmp(state, "PHN")) | |
1164 status |= UC_UNAVAILABLE | (MSN_PHONE << 1); | |
1165 else if (!g_ascii_strcasecmp(state, "LUN")) | |
1166 status |= UC_UNAVAILABLE | (MSN_LUNCH << 1); | |
1167 | |
1168 serv_got_update(gc, (char *)passport, 1, 0, 0, 0, status); | |
1169 | |
1170 return TRUE; | |
1171 } | |
1172 | |
1173 static gboolean | |
5961
fc8ba872a43f
[gaim-migrate @ 6408]
Christian Hammond <chipx86@chipx86.com>
parents:
5960
diff
changeset
|
1174 not_cmd(MsnServConn *servconn, const char *command, const char **params, |
fc8ba872a43f
[gaim-migrate @ 6408]
Christian Hammond <chipx86@chipx86.com>
parents:
5960
diff
changeset
|
1175 size_t param_count) |
fc8ba872a43f
[gaim-migrate @ 6408]
Christian Hammond <chipx86@chipx86.com>
parents:
5960
diff
changeset
|
1176 { |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
1177 servconn->payload_cb = NULL; |
8652
5747e3fac25a
[gaim-migrate @ 9404]
Christian Hammond <chipx86@chipx86.com>
parents:
8646
diff
changeset
|
1178 servconn->payload_len = atoi(params[1]); |
5961
fc8ba872a43f
[gaim-migrate @ 6408]
Christian Hammond <chipx86@chipx86.com>
parents:
5960
diff
changeset
|
1179 |
fc8ba872a43f
[gaim-migrate @ 6408]
Christian Hammond <chipx86@chipx86.com>
parents:
5960
diff
changeset
|
1180 return TRUE; |
fc8ba872a43f
[gaim-migrate @ 6408]
Christian Hammond <chipx86@chipx86.com>
parents:
5960
diff
changeset
|
1181 } |
fc8ba872a43f
[gaim-migrate @ 6408]
Christian Hammond <chipx86@chipx86.com>
parents:
5960
diff
changeset
|
1182 |
fc8ba872a43f
[gaim-migrate @ 6408]
Christian Hammond <chipx86@chipx86.com>
parents:
5960
diff
changeset
|
1183 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1184 prp_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1185 size_t param_count) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1186 { |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1187 MsnSession *session = servconn->session; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1188 const char *type, *value; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1189 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1190 type = params[2]; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1191 value = params[3]; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1192 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1193 if (param_count == 4) { |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1194 if (!strcmp(type, "PHH")) |
7134 | 1195 msn_user_set_home_phone(session->user, gaim_url_decode(value)); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1196 else if (!strcmp(type, "PHW")) |
7134 | 1197 msn_user_set_work_phone(session->user, gaim_url_decode(value)); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1198 else if (!strcmp(type, "PHM")) |
7134 | 1199 msn_user_set_mobile_phone(session->user, gaim_url_decode(value)); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1200 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1201 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1202 return TRUE; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1203 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1204 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1205 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1206 rea_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1207 size_t param_count) |
5309 | 1208 { |
1209 MsnSession *session = servconn->session; | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1210 GaimConnection *gc = session->account->gc; |
7162 | 1211 const char *friend; |
5309 | 1212 |
7134 | 1213 friend = gaim_url_decode(params[3]); |
5309 | 1214 |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1215 gaim_connection_set_display_name(gc, friend); |
5309 | 1216 |
1217 return TRUE; | |
1218 } | |
1219 | |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1220 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1221 reg_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1222 size_t param_count) |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1223 { |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1224 MsnSession *session = servconn->session; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1225 MsnGroup *group; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1226 int group_id; |
7162 | 1227 const char *group_name; |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1228 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1229 group_id = atoi(params[2]); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1230 |
7134 | 1231 group_name = gaim_url_decode(params[3]); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1232 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1233 group = msn_groups_find_with_id(session->groups, group_id); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1234 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1235 gaim_debug(GAIM_DEBUG_INFO, "msn", "Renamed group %s to %s\n", |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1236 msn_group_get_name(group), group_name); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1237 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1238 if (group != NULL) |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1239 msn_group_set_name(group, group_name); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1240 |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1241 return TRUE; |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1242 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
1243 |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1244 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1245 rem_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1246 size_t param_count) |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1247 { |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1248 MsnSession *session = servconn->session; |
6772
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1249 const char *passport = params[3]; |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1250 |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1251 if (param_count == 5) |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1252 { |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1253 MsnUser *user; |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1254 int group_id = atoi(params[4]); |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1255 |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1256 user = msn_users_find_with_passport(session->users, passport); |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1257 |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1258 msn_user_remove_group_id(user, group_id); |
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
1259 } |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1260 |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1261 /* I hate this. */ |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1262 if (session->moving_buddy) { |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1263 MsnGroup *group, *old_group; |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1264 GaimConnection *gc = session->account->gc; |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
1265 const char *friendly; |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1266 char outparams[MSN_BUF_LEN]; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1267 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1268 group = msn_groups_find_with_name(session->groups, |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1269 session->dest_group_name); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1270 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1271 old_group = session->old_group; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1272 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1273 session->moving_buddy = FALSE; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1274 session->old_group = NULL; |
5327
b716ffc25d2d
[gaim-migrate @ 5700]
Christian Hammond <chipx86@chipx86.com>
parents:
5326
diff
changeset
|
1275 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1276 if (group == NULL) { |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1277 gaim_debug(GAIM_DEBUG_ERROR, "msn", |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1278 "Still don't have a group ID for %s while moving %s!\n", |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1279 session->dest_group_name, passport); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1280 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1281 g_free(session->dest_group_name); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1282 session->dest_group_name = NULL; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1283 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1284 return TRUE; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1285 } |
5327
b716ffc25d2d
[gaim-migrate @ 5700]
Christian Hammond <chipx86@chipx86.com>
parents:
5326
diff
changeset
|
1286 |
b716ffc25d2d
[gaim-migrate @ 5700]
Christian Hammond <chipx86@chipx86.com>
parents:
5326
diff
changeset
|
1287 g_free(session->dest_group_name); |
b716ffc25d2d
[gaim-migrate @ 5700]
Christian Hammond <chipx86@chipx86.com>
parents:
5326
diff
changeset
|
1288 session->dest_group_name = NULL; |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1289 |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
1290 if ((friendly = msn_user_get_name(session->moving_user)) == NULL) |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
1291 friendly = passport; |
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
1292 |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1293 g_snprintf(outparams, sizeof(outparams), "FL %s %s %d", |
7134 | 1294 passport, gaim_url_encode(friendly), |
6980
1da447732906
[gaim-migrate @ 7536]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1295 msn_group_get_id(group)); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1296 |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1297 if (!msn_servconn_send_command(session->notification_conn, |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1298 "ADD", outparams)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1299 gaim_connection_error(gc, _("Write error")); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1300 return FALSE; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1301 } |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1302 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1303 if (old_group != NULL) |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1304 msn_group_remove_user(old_group, session->moving_user); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1305 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1306 msn_user_unref(session->moving_user); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1307 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1308 session->moving_user = NULL; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1309 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1310 if (old_group != NULL && |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1311 msn_users_get_count(msn_group_get_users(old_group)) <= 0) { |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1312 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1313 g_snprintf(outparams, sizeof(outparams), "%d", |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1314 msn_group_get_id(old_group)); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1315 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1316 if (!msn_servconn_send_command(session->notification_conn, |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1317 "RMG", outparams)) { |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1318 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1319 gaim_connection_error(gc, _("Write error")); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1320 return FALSE; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1321 } |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1322 } |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1323 } |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1324 |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1325 return TRUE; |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1326 } |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1327 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1328 static gboolean |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1329 rmg_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1330 size_t param_count) |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1331 { |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1332 MsnSession *session = servconn->session; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1333 MsnGroup *group; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1334 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1335 group = msn_groups_find_with_id(session->groups, atoi(params[2])); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1336 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1337 if (group != NULL) |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1338 msn_groups_remove(session->groups, group); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1339 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1340 return TRUE; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1341 } |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
1342 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1343 static gboolean |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1344 syn_cmd(MsnServConn *servconn, const char *command, const char **params, |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1345 size_t param_count) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1346 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1347 MsnSession *session = servconn->session; |
7289
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1348 GaimConnection *gc = gaim_account_get_connection(session->account); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1349 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1350 if (session->protocol_ver >= 8) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1351 { |
8613
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1352 if (param_count == 2) |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1353 { |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1354 char buf[256]; |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1355 |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1356 /* |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1357 * This can happen if we sent a SYN with an up-to-date |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1358 * buddy list revision, but we send 0 to get a full list. |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1359 * So, error out. |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1360 */ |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1361 snprintf(buf, sizeof(buf), |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1362 _("Your MSN buddy list for %s is temporarily unavailable. " |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1363 "Please wait and try again."), |
8614
563d47350c7e
[gaim-migrate @ 9365]
Christian Hammond <chipx86@chipx86.com>
parents:
8613
diff
changeset
|
1364 gaim_account_get_username(session->account)); |
8613
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1365 gaim_connection_error(gc, buf); |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1366 |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1367 return FALSE; |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1368 } |
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
1369 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1370 session->total_users = atoi(params[2]); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1371 session->total_groups = atoi(params[3]); |
7289
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1372 |
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1373 if (session->total_users == 0) |
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1374 { |
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1375 gaim_connection_set_state(gc, GAIM_CONNECTED); |
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1376 serv_finish_login(gc); |
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1377 |
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1378 session->syncing_lists = FALSE; |
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1379 session->lists_synced = TRUE; |
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
1380 } |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1381 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1382 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1383 return TRUE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1384 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1385 |
5309 | 1386 /************************************************************************** |
1387 * Misc commands | |
1388 **************************************************************************/ | |
1389 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1390 url_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1391 size_t param_count) |
5309 | 1392 { |
1393 MsnSession *session = servconn->session; | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1394 GaimAccount *account = session->account; |
5309 | 1395 const char *rru; |
1396 const char *url; | |
1397 md5_state_t st; | |
1398 md5_byte_t di[16]; | |
1399 FILE *fd; | |
1400 char buf[2048]; | |
1401 char buf2[3]; | |
1402 char sendbuf[64]; | |
1403 int i; | |
1404 | |
1405 rru = params[1]; | |
1406 url = params[2]; | |
1407 | |
1408 g_snprintf(buf, sizeof(buf), "%s%lu%s", | |
1409 session->passport_info.mspauth, | |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1410 time(NULL) - session->passport_info.sl, |
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1411 gaim_account_get_password(account)); |
5309 | 1412 |
1413 md5_init(&st); | |
1414 md5_append(&st, (const md5_byte_t *)buf, strlen(buf)); | |
1415 md5_finish(&st, di); | |
1416 | |
1417 memset(sendbuf, 0, sizeof(sendbuf)); | |
1418 | |
1419 for (i = 0; i < 16; i++) { | |
1420 g_snprintf(buf2, sizeof(buf2), "%02x", di[i]); | |
1421 strcat(sendbuf, buf2); | |
1422 } | |
1423 | |
1424 if (session->passport_info.file != NULL) { | |
1425 unlink(session->passport_info.file); | |
1426 g_free(session->passport_info.file); | |
1427 } | |
1428 | |
1429 if ((fd = gaim_mkstemp(&session->passport_info.file)) == NULL) { | |
1430 gaim_debug(GAIM_DEBUG_ERROR, "msn", | |
1431 "Error opening temp passport file: %s\n", | |
1432 strerror(errno)); | |
1433 } | |
1434 else { | |
1435 fputs("<html>\n" | |
1436 "<head>\n" | |
1437 "<noscript>\n" | |
1438 "<meta http-equiv=\"Refresh\" content=\"0; " | |
1439 "url=http://www.hotmail.com\">\n" | |
1440 "</noscript>\n" | |
1441 "</head>\n\n", | |
1442 fd); | |
1443 | |
1444 fprintf(fd, "<body onload=\"document.pform.submit(); \">\n"); | |
1445 fprintf(fd, "<form name=\"pform\" action=\"%s\" method=\"POST\">\n\n", | |
1446 url); | |
1447 fprintf(fd, "<input type=\"hidden\" name=\"mode\" value=\"ttl\">\n"); | |
1448 fprintf(fd, "<input type=\"hidden\" name=\"login\" value=\"%s\">\n", | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1449 gaim_account_get_username(account)); |
5309 | 1450 fprintf(fd, "<input type=\"hidden\" name=\"username\" value=\"%s\">\n", |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1451 gaim_account_get_username(account)); |
5309 | 1452 fprintf(fd, "<input type=\"hidden\" name=\"sid\" value=\"%s\">\n", |
1453 session->passport_info.sid); | |
1454 fprintf(fd, "<input type=\"hidden\" name=\"kv\" value=\"%s\">\n", | |
1455 session->passport_info.kv); | |
1456 fprintf(fd, "<input type=\"hidden\" name=\"id\" value=\"2\">\n"); | |
1457 fprintf(fd, "<input type=\"hidden\" name=\"sl\" value=\"%ld\">\n", | |
1458 time(NULL) - session->passport_info.sl); | |
1459 fprintf(fd, "<input type=\"hidden\" name=\"rru\" value=\"%s\">\n", | |
1460 rru); | |
1461 fprintf(fd, "<input type=\"hidden\" name=\"auth\" value=\"%s\">\n", | |
1462 session->passport_info.mspauth); | |
1463 fprintf(fd, "<input type=\"hidden\" name=\"creds\" value=\"%s\">\n", | |
1464 sendbuf); /* TODO Digest me (huh? -- ChipX86) */ | |
1465 fprintf(fd, "<input type=\"hidden\" name=\"svc\" value=\"mail\">\n"); | |
7699 | 1466 fprintf(fd, "<input type=\"hidden\" name=\"js\" value=\"yes\">\n"); |
5309 | 1467 fprintf(fd, "</form></body>\n"); |
1468 fprintf(fd, "</html>\n"); | |
1469 | |
1470 if (fclose(fd)) { | |
1471 gaim_debug(GAIM_DEBUG_ERROR, "msn", | |
1472 "Error closing temp passport file: %s\n", | |
1473 strerror(errno)); | |
1474 | |
1475 unlink(session->passport_info.file); | |
1476 g_free(session->passport_info.file); | |
1477 } | |
1478 else { | |
1479 /* | |
1480 * Renaming file with .html extension, so that the | |
1481 * win32 open_url will work. | |
1482 */ | |
1483 char *tmp; | |
1484 | |
1485 if ((tmp = g_strdup_printf("%s.html", | |
1486 session->passport_info.file)) != NULL) { | |
1487 | |
1488 if (rename(session->passport_info.file, tmp) == 0) { | |
1489 g_free(session->passport_info.file); | |
1490 session->passport_info.file = tmp; | |
1491 } | |
1492 else | |
1493 g_free(tmp); | |
1494 } | |
1495 } | |
1496 } | |
1497 | |
1498 return TRUE; | |
1499 } | |
1500 /************************************************************************** | |
1501 * Switchboards | |
1502 **************************************************************************/ | |
1503 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1504 rng_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1505 size_t param_count) |
5309 | 1506 { |
1507 MsnSession *session = servconn->session; | |
1508 MsnSwitchBoard *swboard; | |
1509 MsnUser *user; | |
1510 const char *session_id; | |
1511 char *host, *c; | |
1512 int port; | |
1513 | |
1514 session_id = params[0]; | |
1515 | |
1516 host = g_strdup(params[1]); | |
1517 | |
1518 if ((c = strchr(host, ':')) != NULL) { | |
1519 *c = '\0'; | |
1520 port = atoi(c + 1); | |
1521 } | |
1522 else | |
1523 port = 1863; | |
1524 | |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1525 if (session->http_method) |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1526 port = 80; |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1527 |
5309 | 1528 swboard = msn_switchboard_new(session); |
1529 | |
1530 user = msn_user_new(session, params[4], NULL); | |
1531 | |
1532 msn_switchboard_set_invited(swboard, TRUE); | |
1533 msn_switchboard_set_session_id(swboard, params[0]); | |
1534 msn_switchboard_set_auth_key(swboard, params[3]); | |
1535 msn_switchboard_set_user(swboard, user); | |
1536 | |
1537 if (!msn_switchboard_connect(swboard, host, port)) { | |
1538 gaim_debug(GAIM_DEBUG_ERROR, "msn", | |
1539 "Unable to connect to switchboard on %s, port %d\n", | |
1540 host, port); | |
1541 | |
1542 g_free(host); | |
1543 | |
1544 return FALSE; | |
1545 } | |
1546 | |
1547 g_free(host); | |
1548 | |
1549 return TRUE; | |
1550 } | |
1551 | |
1552 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1553 xfr_cmd(MsnServConn *servconn, const char *command, const char **params, |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1554 size_t param_count) |
5309 | 1555 { |
1556 MsnSession *session = servconn->session; | |
1557 MsnSwitchBoard *swboard; | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1558 GaimConnection *gc = session->account->gc; |
5309 | 1559 char *host; |
1560 char *c; | |
1561 int port; | |
1562 | |
5385
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1563 if (strcmp(params[1], "SB") && strcmp(params[1], "NS")) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1564 gaim_connection_error(gc, _("Got invalid XFR")); |
7188
2ff225547cf4
[gaim-migrate @ 7757]
Christian Hammond <chipx86@chipx86.com>
parents:
7162
diff
changeset
|
1565 |
5309 | 1566 return FALSE; |
1567 } | |
1568 | |
1569 host = g_strdup(params[2]); | |
1570 | |
1571 if ((c = strchr(host, ':')) != NULL) { | |
1572 *c = '\0'; | |
1573 port = atoi(c + 1); | |
1574 } | |
1575 else | |
1576 port = 1863; | |
1577 | |
5385
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1578 if (!strcmp(params[1], "SB")) { |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1579 swboard = msn_session_find_unused_switch(session); |
5309 | 1580 |
5385
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1581 if (swboard == NULL) { |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1582 gaim_debug(GAIM_DEBUG_ERROR, "msn", |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1583 "Received an XFR SB request when there's no unused " |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1584 "switchboards!\n"); |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1585 return FALSE; |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1586 } |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1587 |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1588 msn_switchboard_set_auth_key(swboard, params[4]); |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1589 |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1590 if (session->http_method) |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1591 port = 80; |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1592 |
5385
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1593 if (!msn_switchboard_connect(swboard, host, port)) { |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1594 gaim_debug(GAIM_DEBUG_ERROR, "msn", |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1595 "Unable to connect to switchboard on %s, port %d\n", |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1596 host, port); |
5309 | 1597 |
5385
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1598 g_free(host); |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1599 |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1600 return FALSE; |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1601 } |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1602 } |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1603 else if (!strcmp(params[1], "NS")) { |
8583
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1604 if (!msn_notification_connect(session->notification_conn, host, |
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1605 port)) |
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1606 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1607 gaim_connection_error(gc, _("Unable to transfer to " |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
1608 "notification server")); |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
1609 |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
1610 g_free(host); |
5309 | 1611 |
5385
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1612 return FALSE; |
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1613 } |
5309 | 1614 } |
1615 | |
1616 g_free(host); | |
1617 | |
1618 return TRUE; | |
1619 } | |
1620 | |
1621 /************************************************************************** | |
1622 * Message Types | |
1623 **************************************************************************/ | |
1624 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1625 profile_msg(MsnServConn *servconn, MsnMessage *msg) |
5309 | 1626 { |
1627 MsnSession *session = servconn->session; | |
1628 const char *value; | |
1629 | |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
1630 if (strcmp(msg->passport, "Hotmail")) { |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1631 /* This isn't an official message. */ |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1632 return TRUE; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1633 } |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1634 |
5309 | 1635 if ((value = msn_message_get_attr(msg, "kv")) != NULL) |
1636 session->passport_info.kv = g_strdup(value); | |
1637 | |
1638 if ((value = msn_message_get_attr(msg, "sid")) != NULL) | |
1639 session->passport_info.sid = g_strdup(value); | |
1640 | |
1641 if ((value = msn_message_get_attr(msg, "MSPAuth")) != NULL) | |
1642 session->passport_info.mspauth = g_strdup(value); | |
1643 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1644 if ((value = msn_message_get_attr(msg, "ClientIP")) != NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1645 session->passport_info.client_ip = g_strdup(value); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1646 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1647 if ((value = msn_message_get_attr(msg, "ClientPort")) != NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1648 session->passport_info.client_port = ntohs(atoi(value)); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1649 |
5309 | 1650 return TRUE; |
1651 } | |
1652 | |
1653 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1654 initial_email_msg(MsnServConn *servconn, MsnMessage *msg) |
5309 | 1655 { |
1656 MsnSession *session = servconn->session; | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1657 GaimConnection *gc = session->account->gc; |
5309 | 1658 GHashTable *table; |
1659 const char *unread; | |
1660 | |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
1661 if (strcmp(msg->passport, "Hotmail")) { |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1662 /* This isn't an official message. */ |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1663 return TRUE; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1664 } |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1665 |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1666 if (!gaim_account_get_check_mail(session->account)) |
5520
11be8ae32937
[gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1667 return TRUE; |
11be8ae32937
[gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1668 |
5358
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1669 if (session->passport_info.file == NULL) { |
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1670 msn_servconn_send_command(servconn, "URL", "INBOX"); |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1671 |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1672 msn_servconn_queue_message(servconn, "URL", msg); |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1673 |
5358
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1674 return TRUE; |
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1675 } |
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1676 |
5309 | 1677 table = msn_message_get_hashtable_from_body(msg); |
1678 | |
1679 unread = g_hash_table_lookup(table, "Inbox-Unread"); | |
1680 | |
5520
11be8ae32937
[gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1681 if (unread != NULL) { |
7190
13c725566078
[gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents:
7188
diff
changeset
|
1682 int count = atoi(unread); |
13c725566078
[gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents:
7188
diff
changeset
|
1683 |
13c725566078
[gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents:
7188
diff
changeset
|
1684 if (count != 0) |
13c725566078
[gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents:
7188
diff
changeset
|
1685 { |
7699 | 1686 const char *passport = msn_user_get_passport(session->user); |
1687 const char *file = session->passport_info.file; | |
1688 gchar *url; | |
1689 while (*file && *file == '/') | |
1690 ++file; | |
1691 url = g_strconcat ("file:///", file, 0); | |
7820 | 1692 gaim_notify_emails(gc, count, FALSE, NULL, NULL, |
1693 &passport, (const char **)&url, NULL, NULL); | |
7699 | 1694 g_free (url); |
7190
13c725566078
[gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents:
7188
diff
changeset
|
1695 } |
5520
11be8ae32937
[gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1696 } |
5309 | 1697 |
1698 g_hash_table_destroy(table); | |
1699 | |
1700 return TRUE; | |
1701 } | |
1702 | |
1703 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1704 email_msg(MsnServConn *servconn, MsnMessage *msg) |
5309 | 1705 { |
1706 MsnSession *session = servconn->session; | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1707 GaimConnection *gc = session->account->gc; |
5309 | 1708 GHashTable *table; |
8657
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1709 char *from, *subject, *tmp; |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1710 |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1711 from = subject = NULL; |
5309 | 1712 |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
1713 if (strcmp(msg->passport, "Hotmail")) { |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1714 /* This isn't an official message. */ |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1715 return TRUE; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1716 } |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1717 |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1718 if (!gaim_account_get_check_mail(session->account)) |
5520
11be8ae32937
[gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1719 return TRUE; |
11be8ae32937
[gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1720 |
5358
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1721 if (session->passport_info.file == NULL) { |
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1722 msn_servconn_send_command(servconn, "URL", "INBOX"); |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1723 |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1724 msn_servconn_queue_message(servconn, "URL", msg); |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1725 |
5358
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1726 return TRUE; |
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1727 } |
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1728 |
5309 | 1729 table = msn_message_get_hashtable_from_body(msg); |
1730 | |
8657
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1731 tmp = g_hash_table_lookup(table, "From"); |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1732 if (tmp != NULL) |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1733 from = gaim_mime_decode_field(tmp); |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1734 |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1735 tmp = g_hash_table_lookup(table, "Subject"); |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1736 if (tmp != NULL) |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1737 subject = gaim_mime_decode_field(tmp); |
5309 | 1738 |
8657
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1739 if (from != NULL && subject != NULL) |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1740 gaim_notify_email(gc, subject, from, msn_user_get_passport(session->user), |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1741 session->passport_info.file, NULL, NULL); |
5309 | 1742 |
8657
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1743 if (from != NULL) |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1744 g_free(from); |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1745 |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1746 if (subject != NULL) |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1747 g_free(subject); |
7817 | 1748 |
5309 | 1749 g_hash_table_destroy(table); |
1750 | |
1751 return TRUE; | |
1752 } | |
1753 | |
1754 static gboolean | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1755 system_msg(MsnServConn *servconn, MsnMessage *msg) |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1756 { |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1757 GHashTable *table; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1758 const char *type_s; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1759 |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
1760 if (strcmp(msg->passport, "Hotmail")) { |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1761 /* This isn't an official message. */ |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1762 return TRUE; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1763 } |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1764 |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1765 table = msn_message_get_hashtable_from_body(msg); |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1766 |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1767 if ((type_s = g_hash_table_lookup(table, "Type")) != NULL) { |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1768 int type = atoi(type_s); |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1769 char buf[MSN_BUF_LEN]; |
6308 | 1770 int minutes; |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1771 |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1772 switch (type) { |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1773 case 1: |
6308 | 1774 minutes = atoi(g_hash_table_lookup(table, "Arg1")); |
1775 g_snprintf(buf, sizeof(buf), ngettext( | |
1776 "The MSN server will shut down for maintenance " | |
1777 "in %d minute. You will automatically be " | |
1778 "signed out at that time. Please finish any " | |
1779 "conversations in progress.\n\nAfter the " | |
1780 "maintenance has been completed, you will be " | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1781 "able to successfully sign in.", |
6308 | 1782 "The MSN server will shut down for maintenance " |
1783 "in %d minutes. You will automatically be " | |
1784 "signed out at that time. Please finish any " | |
1785 "conversations in progress.\n\nAfter the " | |
1786 "maintenance has been completed, you will be " | |
1787 "able to successfully sign in.", minutes), | |
1788 minutes); | |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1789 default: |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1790 break; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1791 } |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1792 |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5406
diff
changeset
|
1793 if (*buf != '\0') |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5406
diff
changeset
|
1794 gaim_notify_info(servconn->session->account->gc, NULL, buf, NULL); |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1795 } |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1796 |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1797 g_hash_table_destroy(table); |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1798 |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1799 return TRUE; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1800 } |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1801 |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1802 static gboolean |
8583
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1803 connect_cb(MsnServConn *servconn) |
5309 | 1804 { |
8583
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1805 MsnSession *session = servconn->session; |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1806 GaimAccount *account = session->account; |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1807 GaimConnection *gc = gaim_account_get_connection(account); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1808 char proto_vers[256]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1809 size_t i; |
5309 | 1810 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1811 proto_vers[0] = '\0'; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1812 |
6828
cdcb43229e33
[gaim-migrate @ 7373]
Christian Hammond <chipx86@chipx86.com>
parents:
6827
diff
changeset
|
1813 for (i = 7; i <= session->protocol_ver; i++) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1814 { |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1815 char old_buf[256]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1816 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1817 strcpy(old_buf, proto_vers); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1818 |
7386 | 1819 g_snprintf(proto_vers, sizeof(proto_vers), "MSNP%d %s", (int)i, old_buf); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1820 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1821 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1822 strncat(proto_vers, "CVR0", sizeof(proto_vers)); |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1823 |
8583
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1824 if (!msn_servconn_send_command(servconn, "VER", proto_vers)) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1825 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1826 gaim_connection_error(gc, _("Unable to write to server")); |
5309 | 1827 return FALSE; |
1828 } | |
1829 | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
1830 session->user = msn_user_new(session, |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1831 gaim_account_get_username(account), NULL); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1832 |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1833 gaim_connection_update_progress(gc, _("Syncing with server"), |
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
1834 4, MSN_CONNECT_STEPS); |
5309 | 1835 |
1836 return TRUE; | |
1837 } | |
1838 | |
1839 MsnServConn * | |
8583
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1840 msn_notification_new(MsnSession *session) |
5309 | 1841 { |
1842 MsnServConn *notification; | |
1843 | |
1844 notification = msn_servconn_new(session); | |
1845 | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1846 msn_servconn_set_connect_cb(notification, connect_cb); |
5309 | 1847 |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1848 if (session->http_method) |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1849 notification->http_data->server_type = "NS"; |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1850 |
5309 | 1851 if (notification_commands == NULL) { |
1852 /* Register the command callbacks. */ | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1853 msn_servconn_register_command(notification, "ADD", add_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1854 msn_servconn_register_command(notification, "ADG", adg_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1855 msn_servconn_register_command(notification, "BLP", blp_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1856 msn_servconn_register_command(notification, "BPR", bpr_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1857 msn_servconn_register_command(notification, "CHG", blank_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1858 msn_servconn_register_command(notification, "CHL", chl_cmd); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1859 msn_servconn_register_command(notification, "CVR", cvr_cmd); |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1860 msn_servconn_register_command(notification, "FLN", fln_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1861 msn_servconn_register_command(notification, "GTC", blank_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1862 msn_servconn_register_command(notification, "ILN", iln_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1863 msn_servconn_register_command(notification, "INF", inf_cmd); |
5960
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
1864 msn_servconn_register_command(notification, "IPG", ipg_cmd); |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1865 msn_servconn_register_command(notification, "LSG", lsg_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1866 msn_servconn_register_command(notification, "LST", lst_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1867 msn_servconn_register_command(notification, "MSG", msg_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1868 msn_servconn_register_command(notification, "NLN", nln_cmd); |
5961
fc8ba872a43f
[gaim-migrate @ 6408]
Christian Hammond <chipx86@chipx86.com>
parents:
5960
diff
changeset
|
1869 msn_servconn_register_command(notification, "NOT", not_cmd); |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1870 msn_servconn_register_command(notification, "OUT", out_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1871 msn_servconn_register_command(notification, "PRP", prp_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1872 msn_servconn_register_command(notification, "QNG", blank_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1873 msn_servconn_register_command(notification, "QRY", blank_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1874 msn_servconn_register_command(notification, "REA", rea_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1875 msn_servconn_register_command(notification, "REG", reg_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1876 msn_servconn_register_command(notification, "REM", rem_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1877 msn_servconn_register_command(notification, "RMG", rmg_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1878 msn_servconn_register_command(notification, "RNG", rng_cmd); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1879 msn_servconn_register_command(notification, "SYN", syn_cmd); |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1880 msn_servconn_register_command(notification, "URL", url_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1881 msn_servconn_register_command(notification, "USR", usr_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1882 msn_servconn_register_command(notification, "VER", ver_cmd); |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1883 msn_servconn_register_command(notification, "XFR", xfr_cmd); |
8663
17ef51dc609c
[gaim-migrate @ 9415]
Christian Hammond <chipx86@chipx86.com>
parents:
8657
diff
changeset
|
1884 msn_servconn_register_command(notification, "_UNKNOWN_", unknown_cmd); |
5309 | 1885 |
1886 /* Register the message type callbacks. */ | |
1887 msn_servconn_register_msg_type(notification, "text/x-msmsgsprofile", | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1888 profile_msg); |
5309 | 1889 msn_servconn_register_msg_type(notification, |
1890 "text/x-msmsgsinitialemailnotification", | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1891 initial_email_msg); |
5309 | 1892 msn_servconn_register_msg_type(notification, |
1893 "text/x-msmsgsemailnotification", | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1894 email_msg); |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1895 msn_servconn_register_msg_type(notification, |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1896 "application/x-msmsgssystemmessage", |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1897 system_msg); |
5309 | 1898 |
1899 /* Save these for future use. */ | |
1900 notification_commands = notification->commands; | |
1901 notification_msg_types = notification->msg_types; | |
1902 } | |
1903 else { | |
1904 g_hash_table_destroy(notification->commands); | |
1905 g_hash_table_destroy(notification->msg_types); | |
1906 | |
1907 notification->commands = notification_commands; | |
1908 notification->msg_types = notification_msg_types; | |
1909 } | |
1910 | |
1911 return notification; | |
1912 } | |
8583
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1913 |
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1914 gboolean |
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1915 msn_notification_connect(MsnServConn *notification, const char *host, int port) |
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1916 { |
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1917 g_return_val_if_fail(notification != NULL, FALSE); |
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1918 |
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1919 return msn_servconn_connect(notification, host, port); |
fc27237783ee
[gaim-migrate @ 9333]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
1920 } |