annotate src/protocols/msn/notification.c @ 19737:995aea35b05c

[gaim-migrate @ 16329] change it to windows Live Messenger Basic TWN authentication OK now committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Sat, 24 Jun 2006 12:04:32 +0000
parents 967ef719cb62
children bc30c6270d9f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file notification.c Notification server functions
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 * gaim
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 *
9198
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
6 * Gaim is the legal property of its developers, whose names are too numerous
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
8 * source distribution.
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
9 *
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * (at your option) any later version.
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * GNU General Public License for more details.
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 */
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #include "msn.h"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #include "notification.h"
5361
953aa05279f4 [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
26 #include "state.h"
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 #include "error.h"
13627
3cfdf1653a64 [gaim-migrate @ 16014]
Evan Schoenberg <evan.s@dreskin.net>
parents: 11992
diff changeset
28 #include "msn-utils.h"
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
29 #include "page.h"
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
30
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
31 #include "userlist.h"
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
32 #include "sync.h"
10296
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
33 #include "slplink.h"
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
35 static MsnTable *cbs_table;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 /**************************************************************************
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
38 * Main
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
39 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
40
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
41 static void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
42 destroy_cb(MsnServConn *servconn)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
43 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
44 MsnNotification *notification;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
45
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
46 notification = servconn->cmdproc->data;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
47 g_return_if_fail(notification != NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
48
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
49 msn_notification_destroy(notification);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
50 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
51
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
52 MsnNotification *
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
53 msn_notification_new(MsnSession *session)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
54 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
55 MsnNotification *notification;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
56 MsnServConn *servconn;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
57
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
58 g_return_val_if_fail(session != NULL, NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
59
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
60 notification = g_new0(MsnNotification, 1);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
61
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
62 notification->session = session;
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
63 notification->servconn = servconn = msn_servconn_new(session, MSN_SERVCONN_NS);
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
64 msn_servconn_set_destroy_cb(servconn, destroy_cb);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
65
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
66 notification->cmdproc = servconn->cmdproc;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
67 notification->cmdproc->data = notification;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
68 notification->cmdproc->cbs_table = cbs_table;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
69
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
70 return notification;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
71 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
72
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
73 void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
74 msn_notification_destroy(MsnNotification *notification)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
75 {
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
76 notification->cmdproc->data = NULL;
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
77
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
78 msn_servconn_set_destroy_cb(notification->servconn, NULL);
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
79
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
80 msn_servconn_destroy(notification->servconn);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
81
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
82 g_free(notification);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
83 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
84
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
85 /**************************************************************************
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
86 * Connect
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
87 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
88
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
89 static void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
90 connect_cb(MsnServConn *servconn)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
91 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
92 MsnCmdProc *cmdproc;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
93 MsnSession *session;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
94 GaimAccount *account;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
95 char **a, **c, *vers;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
96 int i;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
97
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
98 g_return_if_fail(servconn != NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
99
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
100 cmdproc = servconn->cmdproc;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
101 session = servconn->session;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
102 account = session->account;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
103
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
104 /* Allocate an array for CVR0, NULL, and all the versions */
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
105 a = c = g_new0(char *, session->protocol_ver - WLM_MIN_PROTOCOL + 3);
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
106
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
107 for (i = session->protocol_ver; i >= WLM_MIN_PROTOCOL; i--)
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
108 *c++ = g_strdup_printf("MSNP%d", i);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
109
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
110 *c++ = g_strdup("CVR0");
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
111
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
112 vers = g_strjoinv(" ", a);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
113
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
114 if (session->login_step == MSN_LOGIN_STEP_START)
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
115 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE);
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
116 else
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
117 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE2);
10514
8f1316d77315 [gaim-migrate @ 11814]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10504
diff changeset
118
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
119 msn_cmdproc_send(cmdproc, "VER", "%s", vers);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
120
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
121 g_strfreev(a);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
122 g_free(vers);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
123 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
124
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
125 gboolean
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
126 msn_notification_connect(MsnNotification *notification, const char *host, int port)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
127 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
128 MsnServConn *servconn;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
129
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
130 g_return_val_if_fail(notification != NULL, FALSE);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
131
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
132 servconn = notification->servconn;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
133
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
134 msn_servconn_set_connect_cb(servconn, connect_cb);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
135 notification->in_use = msn_servconn_connect(servconn, host, port);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
136
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
137 return notification->in_use;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
138 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
139
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
140 void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
141 msn_notification_disconnect(MsnNotification *notification)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
142 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
143 g_return_if_fail(notification != NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
144 g_return_if_fail(notification->in_use);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
145
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
146 msn_servconn_disconnect(notification->servconn);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
147
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
148 notification->in_use = FALSE;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
149 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
150
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
151 /**************************************************************************
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
152 * Util
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
153 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
154
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
155 static void
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
156 group_error_helper(MsnSession *session, const char *msg, int group_id, int error)
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
157 {
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
158 GaimAccount *account;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
159 GaimConnection *gc;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
160 char *reason = NULL;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
161 char *title = NULL;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
162
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
163 account = session->account;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
164 gc = gaim_account_get_connection(account);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
165
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
166 if (error == 224)
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
167 {
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
168 if (group_id == 0)
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
169 {
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
170 return;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
171 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
172 else
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
173 {
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
174 const char *group_name;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
175 group_name =
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
176 msn_userlist_find_group_name(session->userlist,
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
177 group_id);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
178 reason = g_strdup_printf(_("%s is not a valid group."),
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
179 group_name);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
180 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
181 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
182 else
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
183 {
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
184 reason = g_strdup(_("Unknown error."));
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
185 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
186
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
187 title = g_strdup_printf(_("%s on %s (%s)"), msg,
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
188 gaim_account_get_username(account),
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
189 gaim_account_get_protocol_name(account));
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
190 gaim_notify_error(gc, NULL, title, reason);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
191 g_free(title);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
192 g_free(reason);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
193 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
194
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
195 /**************************************************************************
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
196 * Login
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
197 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
198
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
199 void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
200 msn_got_login_params(MsnSession *session, const char *login_params)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
201 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
202 MsnCmdProc *cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
203
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
204 cmdproc = session->notification->cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
205
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
206 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END);
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
207
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
208 msn_cmdproc_send(cmdproc, "USR", "TWN S %s", login_params);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
209 }
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
210
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
211 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
212 cvr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
213 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
214 GaimAccount *account;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
215
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
216 account = cmdproc->session->account;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
217
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
218 msn_cmdproc_send(cmdproc, "USR", "TWN I %s",
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
219 gaim_account_get_username(account));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
220 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
221
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
222 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
223 usr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
224 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
225 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
226 GaimAccount *account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
227 GaimConnection *gc;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
228
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
229 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
230 account = session->account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
231 gc = gaim_account_get_connection(account);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
232
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
233 if (!g_ascii_strcasecmp(cmd->params[1], "OK")){
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
234 /* authenticate OK */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
235 const char *friendly = gaim_url_decode(cmd->params[3]);
5508
2a57266df5f6 [gaim-migrate @ 5907]
Christian Hammond <chipx86@chipx86.com>
parents: 5506
diff changeset
236
5566
9896e9068bc4 [gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents: 5564
diff changeset
237 gaim_connection_set_display_name(gc, friendly);
5508
2a57266df5f6 [gaim-migrate @ 5907]
Christian Hammond <chipx86@chipx86.com>
parents: 5506
diff changeset
238
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
239 msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
240
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
241 msn_cmdproc_send(cmdproc, "SYN", "%s", "0");
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
242 }else if (!g_ascii_strcasecmp(cmd->params[1], "TWN")){
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
243 /* Passport authentication */
8171
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
244 char **elems, **cur, **tokens;
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
245
8171
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
246 session->nexus = msn_nexus_new(session);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
247
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
248 /* Parse the challenge data. */
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
249
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
250 elems = g_strsplit(cmd->params[3], ",", 0);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
251
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
252 for (cur = elems; *cur != NULL; cur++){
8171
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
253 tokens = g_strsplit(*cur, "=", 2);
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
254 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
255 /* Don't free each of the tokens, only the array. */
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
256 g_free(tokens);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
257 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
258
8171
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
259 g_strfreev(elems);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
260
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
261 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_START);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
262
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
263 msn_nexus_connect(session->nexus);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
264 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
265 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
266
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
267 static void
10568
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
268 usr_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
269 {
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
270 MsnErrorType msnerr = 0;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
271
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
272 switch (error)
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
273 {
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
274 case 500:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
275 case 601:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
276 case 910:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
277 case 921:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
278 msnerr = MSN_ERROR_SERV_UNAVAILABLE;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
279 break;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
280 case 911:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
281 msnerr = MSN_ERROR_AUTH;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
282 break;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
283 default:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
284 return;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
285 break;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
286 }
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
287
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
288 msn_session_set_error(cmdproc->session, msnerr, NULL);
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
289 }
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
290
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
291 static void
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
292 ver_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
293 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
294 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
295 GaimAccount *account;
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
296 gboolean protocol_supported = FALSE;
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
297 char proto_str[8];
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
298 size_t i;
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
299
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
300 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
301 account = session->account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
302
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
303 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
304
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
305 for (i = 1; i < cmd->param_count; i++)
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
306 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
307 if (!strcmp(cmd->params[i], proto_str))
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
308 {
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
309 protocol_supported = TRUE;
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
310 break;
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
311 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
312 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
313
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
314 if (!protocol_supported)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
315 {
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
316 msn_session_set_error(session, MSN_ERROR_UNSUPPORTED_PROTOCOL,
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
317 NULL);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
318 return;
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
319 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
320
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
321 /*
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
322 * Windows Live Messenger 8.0
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
323 * Notice :CVR String discriminate!
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
324 */
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
325 msn_cmdproc_send(cmdproc, "CVR",
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
326 "0x0409 winnt 5.1 i386 MSG80BETA 8.0.0689 msmsgs %s",
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
327 gaim_account_get_username(account));
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
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
330 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
331 * Log out
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
332 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
333
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
334 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
335 out_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
336 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
337 if (!g_ascii_strcasecmp(cmd->params[0], "OTH"))
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
338 msn_session_set_error(cmdproc->session, MSN_ERROR_SIGN_OTHER,
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
339 NULL);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
340 else if (!g_ascii_strcasecmp(cmd->params[0], "SSD"))
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
341 msn_session_set_error(cmdproc->session, MSN_ERROR_SERV_DOWN, NULL);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
342 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
343
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
344 void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
345 msn_notification_close(MsnNotification *notification)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
346 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
347 g_return_if_fail(notification != NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
348
10568
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
349 if (!notification->in_use)
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
350 return;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
351
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
352 msn_cmdproc_send_quick(notification->cmdproc, "OUT", NULL, NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
353
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
354 msn_notification_disconnect(notification);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
355 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
356
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
357 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
358 * Messages
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
359 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
360
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
361 static void
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
362 msg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
363 size_t len)
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
364 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
365 MsnMessage *msg;
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
366
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
367 msg = msn_message_new_from_cmd(cmdproc->session, cmd);
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
368
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
369 msn_message_parse_payload(msg, payload, len);
11321
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
370 #ifdef MSN_DEBUG_NS
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
371 msn_message_show_readable(msg, "Notification", TRUE);
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
372 #endif
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
373
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
374 msn_cmdproc_process_msg(cmdproc, msg);
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
375
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
376 msn_message_destroy(msg);
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
377 }
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
378
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
379 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
380 msg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
381 {
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
382 gaim_debug_info("MaYuan","Processing MSG... \n");
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
383 if(cmd->payload_len == 0){
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
384 return;
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
385 }
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
386 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
387 * command and we are processing it */
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
388 if (cmd->payload == NULL){
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
389 cmdproc->last_cmd->payload_cb = msg_cmd_post;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
390 cmdproc->servconn->payload_len = atoi(cmd->params[2]);
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
391 }else{
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
392 g_return_if_fail(cmd->payload_cb != NULL);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
393
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
394 cmd->payload_cb(cmdproc, cmd, cmd->payload, cmd->payload_len);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
395 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
396 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
397
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
398 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
399 * Challenges
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
400 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
401
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
402 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
403 chl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
404 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
405 MsnTransaction *trans;
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
406 char buf[33];
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
407 const char *challenge_resp;
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
408 GaimCipher *cipher;
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
409 GaimCipherContext *context;
11183
8dca96cbcd64 [gaim-migrate @ 13295]
Mark Doliner <mark@kingant.net>
parents: 11164
diff changeset
410 guchar digest[16];
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
411 int i;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
412
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
413 cipher = gaim_ciphers_find_cipher("md5");
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
414 context = gaim_cipher_context_new(cipher, NULL);
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
415
11183
8dca96cbcd64 [gaim-migrate @ 13295]
Mark Doliner <mark@kingant.net>
parents: 11164
diff changeset
416 gaim_cipher_context_append(context, (const guchar *)cmd->params[1],
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
417 strlen(cmd->params[1]));
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
418
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
419 challenge_resp = "VT6PX?UQTM4WM%YR";
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
420
11183
8dca96cbcd64 [gaim-migrate @ 13295]
Mark Doliner <mark@kingant.net>
parents: 11164
diff changeset
421 gaim_cipher_context_append(context, (const guchar *)challenge_resp,
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
422 strlen(challenge_resp));
10687
b256ce6b85b8 [gaim-migrate @ 12235]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10684
diff changeset
423 gaim_cipher_context_digest(context, sizeof(digest), digest, NULL);
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
424 gaim_cipher_context_destroy(context);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
425
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
426 for (i = 0; i < 16; i++)
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
427 g_snprintf(buf + (i*2), 3, "%02x", digest[i]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
428
10225
ecf3ce2e2ab1 [gaim-migrate @ 11357]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10203
diff changeset
429 trans = msn_transaction_new(cmdproc, "QRY", "%s 32", "PROD0038W!61ZTF9");
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
430
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
431 msn_transaction_set_payload(trans, buf, 32);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
432
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
433 msn_cmdproc_send_trans(cmdproc, trans);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
434 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
435
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
436 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
437 * Buddy Lists
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
438 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
439
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
440 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
441 add_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
442 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
443 MsnSession *session;
5457
c8c290021b7b [gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents: 5456
diff changeset
444 MsnUser *user;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
445 const char *list;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
446 const char *passport;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
447 const char *friendly;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
448 MsnListId list_id;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
449 int group_id;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
450
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
451 list = cmd->params[1];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
452 passport = cmd->params[3];
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
453 friendly = gaim_url_decode(cmd->params[4]);
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
454
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
455 session = cmdproc->session;
5457
c8c290021b7b [gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents: 5456
diff changeset
456
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
457 user = msn_userlist_find_user(session->userlist, passport);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
458
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
459 if (user == NULL)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
460 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
461 user = msn_user_new(session->userlist, passport, friendly);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
462 msn_userlist_add_user(session->userlist, user);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
463 }
9197
ec417d2f9666 [gaim-migrate @ 9992]
Christian Hammond <chipx86@chipx86.com>
parents: 9194
diff changeset
464 else
ec417d2f9666 [gaim-migrate @ 9992]
Christian Hammond <chipx86@chipx86.com>
parents: 9194
diff changeset
465 msn_user_set_friendly_name(user, friendly);
5457
c8c290021b7b [gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents: 5456
diff changeset
466
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
467 list_id = msn_get_list_id(list);
9197
ec417d2f9666 [gaim-migrate @ 9992]
Christian Hammond <chipx86@chipx86.com>
parents: 9194
diff changeset
468
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
469 if (cmd->param_count >= 6)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
470 group_id = atoi(cmd->params[5]);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
471 else
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
472 group_id = -1;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
473
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
474 msn_got_add_user(session, user, list_id, group_id);
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
475 msn_user_update(user);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
476 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
477
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
478 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
479 add_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
480 {
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
481 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
482 GaimAccount *account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
483 GaimConnection *gc;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
484 const char *list, *passport;
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
485 char *reason = NULL;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
486 char *msg = NULL;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
487 char **params;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
488
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
489 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
490 account = session->account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
491 gc = gaim_account_get_connection(account);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
492 params = g_strsplit(trans->params, " ", 0);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
493
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
494 list = params[0];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
495 passport = params[1];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
496
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
497 if (!strcmp(list, "FL"))
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
498 msg = g_strdup_printf(_("Unable to add user on %s (%s)"),
9900
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
499 gaim_account_get_username(account),
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
500 gaim_account_get_protocol_name(account));
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
501 else if (!strcmp(list, "BL"))
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
502 msg = g_strdup_printf(_("Unable to block user on %s (%s)"),
9900
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
503 gaim_account_get_username(account),
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
504 gaim_account_get_protocol_name(account));
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
505 else if (!strcmp(list, "AL"))
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
506 msg = g_strdup_printf(_("Unable to permit user on %s (%s)"),
9900
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
507 gaim_account_get_username(account),
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
508 gaim_account_get_protocol_name(account));
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
509
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
510 if (!strcmp(list, "FL"))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
511 {
9900
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
512 if (error == 210)
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
513 {
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
514 reason = g_strdup_printf(_("%s could not be added because "
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
515 "your buddy list is full."), passport);
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
516 }
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
517 }
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
518
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
519 if (reason == NULL)
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
520 {
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
521 if (error == 208)
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
522 {
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
523 reason = g_strdup_printf(_("%s is not a valid passport account."),
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
524 passport);
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
525 }
11862
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
526 else if (error == 500)
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
527 {
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
528 reason = g_strdup(_("Service Temporarily Unavailable."));
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
529 }
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
530 else
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
531 {
11862
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
532 reason = g_strdup(_("Unknown error."));
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
533 }
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
534 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
535
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
536 if (msg != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
537 {
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
538 gaim_notify_error(gc, NULL, msg, reason);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
539 g_free(msg);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
540 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
541
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
542 if (!strcmp(list, "FL"))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
543 {
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
544 GaimBuddy *buddy;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
545
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
546 buddy = gaim_find_buddy(account, passport);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
547
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
548 if (buddy != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
549 gaim_blist_remove_buddy(buddy);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
550 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
551
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
552 g_free(reason);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
553
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
554 g_strfreev(params);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
555 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
556
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
557 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
558 adg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
559 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
560 MsnSession *session;
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
561 gint group_id;
7162
d14e026611c0 [gaim-migrate @ 7729]
Nathan Walp <nwalp@pidgin.im>
parents: 7134
diff changeset
562 const char *group_name;
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
563
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
564 session = cmdproc->session;
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
565
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
566 group_id = atoi(cmd->params[3]);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
567
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
568 group_name = gaim_url_decode(cmd->params[2]);
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
569
13711
967ef719cb62 [gaim-migrate @ 16115]
Richard Laager <rlaager@wiktel.com>
parents: 13627
diff changeset
570 msn_group_new(session->userlist, group_id, group_name);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
571
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
572 /* There is a user that must me moved to this group */
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
573 if (cmd->trans->data)
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
574 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
575 /* msn_userlist_move_buddy(); */
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
576 MsnUserList *userlist = cmdproc->session->userlist;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
577 MsnMoveBuddy *data = cmd->trans->data;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
578
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
579 if (data->old_group_name != NULL)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
580 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
581 msn_userlist_rem_buddy(userlist, data->who, MSN_LIST_FL, data->old_group_name);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
582 g_free(data->old_group_name);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
583 }
9198
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
584
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
585 msn_userlist_add_buddy(userlist, data->who, MSN_LIST_FL, group_name);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
586 g_free(data->who);
5963
eb336b2c451f [gaim-migrate @ 6410]
Christian Hammond <chipx86@chipx86.com>
parents: 5962
diff changeset
587
5361
953aa05279f4 [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
588 }
953aa05279f4 [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
589 }
953aa05279f4 [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
590
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
591 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
592 fln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
593 {
10296
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
594 MsnSlpLink *slplink;
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
595 MsnUser *user;
10296
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
596
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
597 user = msn_userlist_find_user(cmdproc->session->userlist, cmd->params[0]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
598
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
599 user->status = "offline";
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
600 msn_user_update(user);
10296
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
601
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
602 slplink = msn_session_find_slplink(cmdproc->session, cmd->params[0]);
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
603
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
604 if (slplink != NULL)
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
605 msn_slplink_destroy(slplink);
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
606
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
607 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
608
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
609 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
610 iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
611 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
612 MsnSession *session;
10010
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
613 GaimAccount *account;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
614 GaimConnection *gc;
6800
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
615 MsnUser *user;
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
616 MsnObject *msnobj;
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
617 const char *state, *passport, *friendly;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
618
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
619 session = cmdproc->session;
10010
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
620 account = session->account;
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
621 gc = gaim_account_get_connection(account);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
622
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
623 state = cmd->params[1];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
624 passport = cmd->params[2];
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
625 friendly = gaim_url_decode(cmd->params[3]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
626
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
627 user = msn_userlist_find_user(session->userlist, passport);
6858
885c6528843b [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
628
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
629 serv_got_alias(gc, passport, friendly);
6833
ccfbd7c552ba [gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents: 6830
diff changeset
630
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
631 msn_user_set_friendly_name(user, friendly);
6858
885c6528843b [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
632
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
633 if (session->protocol_ver >= 9 && cmd->param_count == 6)
6800
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
634 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
635 msnobj = msn_object_new_from_string(gaim_url_decode(cmd->params[5]));
6800
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
636 msn_user_set_object(user, msnobj);
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
637 }
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
638
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
639 msn_user_set_state(user, state);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
640 msn_user_update(user);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
641 }
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
642
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
643 static void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
644 ipg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
645 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
646 #if 0
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
647 gaim_debug_misc("msn", "Incoming Page: {%s}\n", payload);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
648 #endif
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
649 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
650
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
651 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
652 ipg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5960
03bf7c905782 [gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents: 5933
diff changeset
653 {
8926
8ef82d89faf3 [gaim-migrate @ 9696]
Luke Schierer <lschiere@pidgin.im>
parents: 8924
diff changeset
654 cmdproc->servconn->payload_len = atoi(cmd->params[0]);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
655 cmdproc->last_cmd->payload_cb = ipg_cmd_post;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
656 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
657
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
658 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
659 nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
660 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
661 MsnSession *session;
10010
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
662 GaimAccount *account;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
663 GaimConnection *gc;
6829
dff2d0a282e7 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
664 MsnUser *user;
dff2d0a282e7 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
665 MsnObject *msnobj;
11819
1452a3a9f07a [gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents: 11321
diff changeset
666 int clientid;
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
667 const char *state, *passport, *friendly;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
668
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
669 session = cmdproc->session;
10010
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
670 account = session->account;
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
671 gc = gaim_account_get_connection(account);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
672
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
673 state = cmd->params[0];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
674 passport = cmd->params[1];
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
675 friendly = gaim_url_decode(cmd->params[2]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
676
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
677 user = msn_userlist_find_user(session->userlist, passport);
6858
885c6528843b [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
678
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
679 serv_got_alias(gc, passport, friendly);
6833
ccfbd7c552ba [gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents: 6830
diff changeset
680
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
681 msn_user_set_friendly_name(user, friendly);
6858
885c6528843b [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
682
9859
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
683 if (session->protocol_ver >= 9)
6829
dff2d0a282e7 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
684 {
9859
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
685 if (cmd->param_count == 5)
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
686 {
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
687 msnobj =
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
688 msn_object_new_from_string(gaim_url_decode(cmd->params[4]));
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
689 msn_user_set_object(user, msnobj);
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
690 }
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
691 else
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
692 {
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
693 msn_user_set_object(user, NULL);
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
694 }
6829
dff2d0a282e7 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
695 }
dff2d0a282e7 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
696
11819
1452a3a9f07a [gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents: 11321
diff changeset
697 clientid = atoi(cmd->params[3]);
1452a3a9f07a [gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents: 11321
diff changeset
698 user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE);
1452a3a9f07a [gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents: 11321
diff changeset
699
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
700 msn_user_set_state(user, state);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
701 msn_user_update(user);
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
702 }
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
703
11992
c824e39db0e7 [gaim-migrate @ 14285]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11862
diff changeset
704 #if 0
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
705 static void
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
706 chg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
707 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
708 char *state = cmd->params[1];
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
709 int state_id = 0;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
710
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
711 if (!strcmp(state, "NLN"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
712 state_id = MSN_ONLINE;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
713 else if (!strcmp(state, "BSY"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
714 state_id = MSN_BUSY;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
715 else if (!strcmp(state, "IDL"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
716 state_id = MSN_IDLE;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
717 else if (!strcmp(state, "BRB"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
718 state_id = MSN_BRB;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
719 else if (!strcmp(state, "AWY"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
720 state_id = MSN_AWAY;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
721 else if (!strcmp(state, "PHN"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
722 state_id = MSN_PHONE;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
723 else if (!strcmp(state, "LUN"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
724 state_id = MSN_LUNCH;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
725 else if (!strcmp(state, "HDN"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
726 state_id = MSN_HIDDEN;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
727
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
728 cmdproc->session->state = state_id;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
729 }
11992
c824e39db0e7 [gaim-migrate @ 14285]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11862
diff changeset
730 #endif
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
731
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
732
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
733 static void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
734 not_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
735 {
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
736 #if 0
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
737 MSN_SET_PARAMS("NOT %d\r\n%s", cmdproc->servconn->payload, payload);
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
738 gaim_debug_misc("msn", "Notification: {%s}\n", payload);
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
739 #endif
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
740 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
741
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
742 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
743 not_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
744 {
8926
8ef82d89faf3 [gaim-migrate @ 9696]
Luke Schierer <lschiere@pidgin.im>
parents: 8924
diff changeset
745 cmdproc->servconn->payload_len = atoi(cmd->params[0]);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
746 cmdproc->last_cmd->payload_cb = not_cmd_post;
5363
ebebc833cf77 [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
747 }
ebebc833cf77 [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
748
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
749 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
750 rea_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
751 {
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
752 /* TODO: This might be for us too */
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
753
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
754 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
755 GaimConnection *gc;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
756 const char *friendly;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
757
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
758 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
759 gc = session->account->gc;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
760 friendly = gaim_url_decode(cmd->params[3]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
761
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
762 gaim_connection_set_display_name(gc, friendly);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
763 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
764
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
765 static void
10833
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
766 prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
767 {
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
768 MsnSession *session = cmdproc->session;
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
769 const char *type, *value;
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
770
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
771 g_return_if_fail(cmd->param_count >= 3);
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
772
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
773 type = cmd->params[2];
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
774
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
775 if (cmd->param_count == 4)
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
776 {
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
777 value = cmd->params[3];
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
778 if (!strcmp(type, "PHH"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
779 msn_user_set_home_phone(session->user, gaim_url_decode(value));
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
780 else if (!strcmp(type, "PHW"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
781 msn_user_set_work_phone(session->user, gaim_url_decode(value));
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
782 else if (!strcmp(type, "PHM"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
783 msn_user_set_mobile_phone(session->user, gaim_url_decode(value));
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
784 }
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
785 else
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
786 {
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
787 if (!strcmp(type, "PHH"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
788 msn_user_set_home_phone(session->user, NULL);
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
789 else if (!strcmp(type, "PHW"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
790 msn_user_set_work_phone(session->user, NULL);
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
791 else if (!strcmp(type, "PHM"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
792 msn_user_set_mobile_phone(session->user, NULL);
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
793 }
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
794 }
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
795
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
796 static void
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
797 reg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5318
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
798 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
799 MsnSession *session;
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
800 int group_id;
7162
d14e026611c0 [gaim-migrate @ 7729]
Nathan Walp <nwalp@pidgin.im>
parents: 7134
diff changeset
801 const char *group_name;
5318
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
802
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
803 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
804 group_id = atoi(cmd->params[2]);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
805 group_name = gaim_url_decode(cmd->params[3]);
5318
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
806
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
807 msn_userlist_rename_group_id(session->userlist, group_id, group_name);
5318
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
808 }
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
809
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
810 static void
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
811 reg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
812 {
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
813 int group_id;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
814 char **params;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
815
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
816 params = g_strsplit(trans->params, " ", 0);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
817
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
818 group_id = atoi(params[0]);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
819
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
820 group_error_helper(cmdproc->session, _("Unable to rename group"), group_id, error);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
821
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
822 g_strfreev(params);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
823 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
824
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
825 static void
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
826 rem_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
827 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
828 MsnSession *session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
829 MsnUser *user;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
830 const char *list;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
831 const char *passport;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
832 MsnListId list_id;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
833 int group_id;
6772
e719379c8a79 [gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents: 6767
diff changeset
834
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
835 session = cmdproc->session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
836 list = cmd->params[1];
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
837 passport = cmd->params[3];
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
838 user = msn_userlist_find_user(session->userlist, passport);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
839
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
840 g_return_if_fail(user != NULL);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
841
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
842 list_id = msn_get_list_id(list);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
843
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
844 if (cmd->param_count == 5)
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
845 group_id = atoi(cmd->params[4]);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
846 else
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
847 group_id = -1;
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
848
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
849 msn_got_rem_user(session, user, list_id, group_id);
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
850 msn_user_update(user);
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
851 }
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
852
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
853 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
854 rmg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
855 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
856 MsnSession *session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
857 int group_id;
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
858
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
859 session = cmdproc->session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
860 group_id = atoi(cmd->params[2]);
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
861
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
862 msn_userlist_remove_group_id(session->userlist, group_id);
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
863 }
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
864
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
865 static void
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
866 rmg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
867 {
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
868 int group_id;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
869 char **params;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
870
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
871 params = g_strsplit(trans->params, " ", 0);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
872
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
873 group_id = atoi(params[0]);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
874
10452
e1c98422f4df [gaim-migrate @ 11719]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10451
diff changeset
875 group_error_helper(cmdproc->session, _("Unable to delete group"), group_id, error);
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
876
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
877 g_strfreev(params);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
878 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
879
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
880 static void
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
881 syn_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
882 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
883 MsnSession *session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
884 int total_users;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
885
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
886 session = cmdproc->session;
10269
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
887
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
888 if (cmd->param_count == 2)
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
889 {
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
890 /*
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
891 * This can happen if we sent a SYN with an up-to-date
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
892 * buddy list revision, but we send 0 to get a full list.
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
893 * So, error out.
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
894 */
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
895
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
896 msn_session_set_error(cmdproc->session, MSN_ERROR_BAD_BLIST, NULL);
10269
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
897 return;
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
898 }
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
899
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
900 total_users = atoi(cmd->params[2]);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
901
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
902 if (total_users == 0)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
903 {
10044
86a6d78b070b [gaim-migrate @ 11003]
Luke Schierer <lschiere@pidgin.im>
parents: 10043
diff changeset
904 msn_session_finish_login(session);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
905 }
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
906 else
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
907 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
908 /* syn_table */
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
909 MsnSync *sync;
8613
b0ceb2a9e122 [gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents: 8583
diff changeset
910
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
911 sync = msn_sync_new(session);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
912 sync->total_users = total_users;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
913 sync->old_cbs_table = cmdproc->cbs_table;
7289
ab2085024a29 [gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
914
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
915 session->sync = sync;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
916 cmdproc->cbs_table = sync->cbs_table;
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
917 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
918 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
919
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
920 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
921 * Misc commands
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
922 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
923
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
924 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
925 url_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
926 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
927 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
928 GaimAccount *account;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
929 const char *rru;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
930 const char *url;
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
931 GaimCipher *cipher;
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
932 GaimCipherContext *context;
11183
8dca96cbcd64 [gaim-migrate @ 13295]
Mark Doliner <mark@kingant.net>
parents: 11164
diff changeset
933 guchar digest[16];
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
934 FILE *fd;
11164
93663df88ec4 [gaim-migrate @ 13265]
Mark Doliner <mark@kingant.net>
parents: 10833
diff changeset
935 char *buf;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
936 char buf2[3];
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
937 char sendbuf[64];
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
938 int i;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
939
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
940 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
941 account = session->account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
942
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
943 rru = cmd->params[1];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
944 url = cmd->params[2];
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
945
11164
93663df88ec4 [gaim-migrate @ 13265]
Mark Doliner <mark@kingant.net>
parents: 10833
diff changeset
946 buf = g_strdup_printf("%s%lu%s",
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
947 session->passport_info.mspauth,
5566
9896e9068bc4 [gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents: 5564
diff changeset
948 time(NULL) - session->passport_info.sl,
10740
94cc67130789 [gaim-migrate @ 12342]
Mark Doliner <mark@kingant.net>
parents: 10687
diff changeset
949 gaim_connection_get_password(account->gc));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
950
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
951 cipher = gaim_ciphers_find_cipher("md5");
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
952 context = gaim_cipher_context_new(cipher, NULL);
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
953
11183
8dca96cbcd64 [gaim-migrate @ 13295]
Mark Doliner <mark@kingant.net>
parents: 11164
diff changeset
954 gaim_cipher_context_append(context, (const guchar *)buf, strlen(buf));
10687
b256ce6b85b8 [gaim-migrate @ 12235]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10684
diff changeset
955 gaim_cipher_context_digest(context, sizeof(digest), digest, NULL);
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
956 gaim_cipher_context_destroy(context);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
957
11164
93663df88ec4 [gaim-migrate @ 13265]
Mark Doliner <mark@kingant.net>
parents: 10833
diff changeset
958 g_free(buf);
93663df88ec4 [gaim-migrate @ 13265]
Mark Doliner <mark@kingant.net>
parents: 10833
diff changeset
959
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
960 memset(sendbuf, 0, sizeof(sendbuf));
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
961
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
962 for (i = 0; i < 16; i++)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
963 {
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
964 g_snprintf(buf2, sizeof(buf2), "%02x", digest[i]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
965 strcat(sendbuf, buf2);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
966 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
967
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
968 if (session->passport_info.file != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
969 {
10589
0f7452b1f777 [gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10568
diff changeset
970 g_unlink(session->passport_info.file);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
971 g_free(session->passport_info.file);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
972 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
973
10203
7ff9b8b22e7d [gaim-migrate @ 11324]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 10057
diff changeset
974 if ((fd = gaim_mkstemp(&session->passport_info.file, FALSE)) == NULL)
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
975 {
10345
2e01c503aa4f [gaim-migrate @ 11556]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10310
diff changeset
976 gaim_debug_error("msn",
2e01c503aa4f [gaim-migrate @ 11556]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10310
diff changeset
977 "Error opening temp passport file: %s\n",
2e01c503aa4f [gaim-migrate @ 11556]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10310
diff changeset
978 strerror(errno));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
979 }
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
980 else
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
981 {
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
982 fputs("<html>\n"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
983 "<head>\n"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
984 "<noscript>\n"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
985 "<meta http-equiv=\"Refresh\" content=\"0; "
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
986 "url=http://www.hotmail.com\">\n"
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
987 "</noscript>\n"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
988 "</head>\n\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
989 fd);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
990
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
991 fprintf(fd, "<body onload=\"document.pform.submit(); \">\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
992 fprintf(fd, "<form name=\"pform\" action=\"%s\" method=\"POST\">\n\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
993 url);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
994 fprintf(fd, "<input type=\"hidden\" name=\"mode\" value=\"ttl\">\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
995 fprintf(fd, "<input type=\"hidden\" name=\"login\" value=\"%s\">\n",
5564
187c740f2a4e [gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents: 5520
diff changeset
996 gaim_account_get_username(account));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
997 fprintf(fd, "<input type=\"hidden\" name=\"username\" value=\"%s\">\n",
5564
187c740f2a4e [gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents: 5520
diff changeset
998 gaim_account_get_username(account));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
999 fprintf(fd, "<input type=\"hidden\" name=\"sid\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1000 session->passport_info.sid);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1001 fprintf(fd, "<input type=\"hidden\" name=\"kv\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1002 session->passport_info.kv);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1003 fprintf(fd, "<input type=\"hidden\" name=\"id\" value=\"2\">\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1004 fprintf(fd, "<input type=\"hidden\" name=\"sl\" value=\"%ld\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1005 time(NULL) - session->passport_info.sl);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1006 fprintf(fd, "<input type=\"hidden\" name=\"rru\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1007 rru);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1008 fprintf(fd, "<input type=\"hidden\" name=\"auth\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1009 session->passport_info.mspauth);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1010 fprintf(fd, "<input type=\"hidden\" name=\"creds\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1011 sendbuf); /* TODO Digest me (huh? -- ChipX86) */
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1012 fprintf(fd, "<input type=\"hidden\" name=\"svc\" value=\"mail\">\n");
7699
04f9c750657f [gaim-migrate @ 8344]
Luke Schierer <lschiere@pidgin.im>
parents: 7590
diff changeset
1013 fprintf(fd, "<input type=\"hidden\" name=\"js\" value=\"yes\">\n");
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1014 fprintf(fd, "</form></body>\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1015 fprintf(fd, "</html>\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1016
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1017 if (fclose(fd))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1018 {
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1019 gaim_debug_error("msn",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1020 "Error closing temp passport file: %s\n",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1021 strerror(errno));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1022
10589
0f7452b1f777 [gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10568
diff changeset
1023 g_unlink(session->passport_info.file);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1024 g_free(session->passport_info.file);
10240
95ca0db2d01d [gaim-migrate @ 11377]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 10225
diff changeset
1025 session->passport_info.file = NULL;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1026 }
10647
7d13c04387ad [gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10629
diff changeset
1027 #ifdef _WIN32
10629
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1028 else
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1029 {
10647
7d13c04387ad [gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10629
diff changeset
1030 /*
10629
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1031 * Renaming file with .html extension, so that the
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1032 * win32 open_url will work.
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1033 */
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1034 char *tmp;
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1035
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1036 if ((tmp =
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1037 g_strdup_printf("%s.html",
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1038 session->passport_info.file)) != NULL)
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1039 {
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1040 if (g_rename(session->passport_info.file,
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1041 tmp) == 0)
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1042 {
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1043 g_free(session->passport_info.file);
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1044 session->passport_info.file = tmp;
10647
7d13c04387ad [gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10629
diff changeset
1045 }
10629
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1046 else
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1047 g_free(tmp);
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1048 }
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1049 }
10647
7d13c04387ad [gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10629
diff changeset
1050 #endif
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1051 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1052 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1053 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1054 * Switchboards
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1055 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1056
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1057 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1058 rng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1059 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1060 MsnSession *session;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1061 MsnSwitchBoard *swboard;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1062 const char *session_id;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1063 char *host;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1064 int port;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1065
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1066 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1067 session_id = cmd->params[0];
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1068
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1069 msn_parse_socket(cmd->params[1], &host, &port);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1070
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7274
diff changeset
1071 if (session->http_method)
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7274
diff changeset
1072 port = 80;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7274
diff changeset
1073
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1074 swboard = msn_switchboard_new(session);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1075
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1076 msn_switchboard_set_invited(swboard, TRUE);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1077 msn_switchboard_set_session_id(swboard, cmd->params[0]);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1078 msn_switchboard_set_auth_key(swboard, cmd->params[3]);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1079 swboard->im_user = g_strdup(cmd->params[4]);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1080 /* msn_switchboard_add_user(swboard, cmd->params[4]); */
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1081
10568
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
1082 if (!msn_switchboard_connect(swboard, host, port))
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
1083 msn_switchboard_destroy(swboard);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1084
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1085 g_free(host);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1086 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1087
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1088 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1089 xfr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1090 {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1091 char *host;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1092 int port;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1093
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1094 if (strcmp(cmd->params[1], "SB") && strcmp(cmd->params[1], "NS"))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1095 {
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1096 /* Maybe we can have a generic bad command error. */
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1097 gaim_debug_error("msn", "Bad XFR command (%s)\n", cmd->params[1]);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1098 return;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1099 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1100
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1101 msn_parse_socket(cmd->params[2], &host, &port);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1102
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1103 if (!strcmp(cmd->params[1], "SB"))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1104 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1105 gaim_debug_error("msn", "This shouldn't be handled here.\n");
5385
150cf1615098 [gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents: 5375
diff changeset
1106 }
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1107 else if (!strcmp(cmd->params[1], "NS"))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1108 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1109 MsnSession *session;
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
1110
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1111 session = cmdproc->session;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1112
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
1113 msn_session_set_login_step(session, MSN_LOGIN_STEP_TRANSFER);
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1114
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1115 msn_notification_connect(session->notification, host, port);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1116 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1117
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1118 g_free(host);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1119 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1120
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1121 static void
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1122 gcf_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1123 {
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1124 gaim_debug_info("MaYuan","Processing GCF... \n");
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1125 if(cmd->payload_len == 0){
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1126 // cmd->payload_len = is_num(cmd->params[1]) ? atoi(cmd->params[1]) : 0;
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1127 return;
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1128 }
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1129 /*get the payload content*/
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1130 }
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1131
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1132 static void
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1133 sbs_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1134 {
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1135 gaim_debug_info("MaYuan","Processing SBS... \n");
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1136 if(cmd->payload_len == 0){
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1137 return;
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1138 }
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1139 /*get the payload content*/
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1140 }
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1141
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1142 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1143 * Message Types
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1144 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1145
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1146 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1147 profile_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1148 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1149 MsnSession *session;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1150 const char *value;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1151
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1152 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1153
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1154 if (strcmp(msg->remote_user, "Hotmail"))
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1155 /* This isn't an official message. */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1156 return;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1157
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1158 if ((value = msn_message_get_attr(msg, "kv")) != NULL)
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1159 {
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1160 if (session->passport_info.kv != NULL)
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1161 g_free(session->passport_info.kv);
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1162
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1163 session->passport_info.kv = g_strdup(value);
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1164 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1165
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1166 if ((value = msn_message_get_attr(msg, "sid")) != NULL)
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1167 {
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1168 if (session->passport_info.sid != NULL)
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1169 g_free(session->passport_info.sid);
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1170
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1171 session->passport_info.sid = g_strdup(value);
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1172 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1173
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1174 if ((value = msn_message_get_attr(msg, "MSPAuth")) != NULL)
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1175 {
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1176 if (session->passport_info.mspauth != NULL)
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1177 g_free(session->passport_info.mspauth);
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1178
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1179 session->passport_info.mspauth = g_strdup(value);
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1180 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1181
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1182 if ((value = msn_message_get_attr(msg, "ClientIP")) != NULL)
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1183 {
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1184 if (session->passport_info.client_ip != NULL)
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1185 g_free(session->passport_info.client_ip);
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1186
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1187 session->passport_info.client_ip = g_strdup(value);
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1188 }
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1189
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1190 if ((value = msn_message_get_attr(msg, "ClientPort")) != NULL)
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1191 session->passport_info.client_port = ntohs(atoi(value));
10275
d9468bd22b7c [gaim-migrate @ 11428]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10269
diff changeset
1192
d9468bd22b7c [gaim-migrate @ 11428]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10269
diff changeset
1193 if ((value = msn_message_get_attr(msg, "LoginTime")) != NULL)
d9468bd22b7c [gaim-migrate @ 11428]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10269
diff changeset
1194 session->passport_info.sl = atol(value);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1195 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1196
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1197 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1198 initial_email_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1199 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1200 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1201 GaimConnection *gc;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1202 GHashTable *table;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1203 const char *unread;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1204
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1205 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1206 gc = session->account->gc;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1207
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1208 if (strcmp(msg->remote_user, "Hotmail"))
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1209 /* This isn't an official message. */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1210 return;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1211
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1212 if (session->passport_info.file == NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1213 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1214 MsnTransaction *trans;
10225
ecf3ce2e2ab1 [gaim-migrate @ 11357]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10203
diff changeset
1215 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1216 msn_transaction_queue_cmd(trans, msg->cmd);
5506
4f72b611f0ee [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1217
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1218 msn_cmdproc_send_trans(cmdproc, trans);
5506
4f72b611f0ee [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1219
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1220 return;
5358
91db34a45cbe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1221 }
91db34a45cbe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1222
11321
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1223 if (!gaim_account_get_check_mail(session->account))
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1224 return;
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1225
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1226 table = msn_message_get_hashtable_from_body(msg);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1227
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1228 unread = g_hash_table_lookup(table, "Inbox-Unread");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1229
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1230 if (unread != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1231 {
7190
13c725566078 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1232 int count = atoi(unread);
13c725566078 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1233
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1234 if (count > 0)
7190
13c725566078 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1235 {
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1236 const char *passport;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1237 const char *url;
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1238
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1239 passport = msn_user_get_passport(session->user);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1240 url = session->passport_info.file;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1241
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1242 gaim_notify_emails(gc, atoi(unread), FALSE, NULL, NULL,
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1243 &passport, &url, NULL, NULL);
7190
13c725566078 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1244 }
5520
11be8ae32937 [gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
1245 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1246
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1247 g_hash_table_destroy(table);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1248 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1249
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1250 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1251 email_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1252 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1253 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1254 GaimConnection *gc;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1255 GHashTable *table;
8657
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1256 char *from, *subject, *tmp;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1257
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1258 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1259 gc = session->account->gc;
8657
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1260
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1261 if (strcmp(msg->remote_user, "Hotmail"))
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1262 /* This isn't an official message. */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1263 return;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1264
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1265 if (session->passport_info.file == NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1266 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1267 MsnTransaction *trans;
10225
ecf3ce2e2ab1 [gaim-migrate @ 11357]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10203
diff changeset
1268 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1269 msn_transaction_queue_cmd(trans, msg->cmd);
5506
4f72b611f0ee [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1270
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1271 msn_cmdproc_send_trans(cmdproc, trans);
5506
4f72b611f0ee [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1272
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1273 return;
5358
91db34a45cbe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1274 }
91db34a45cbe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1275
11321
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1276 if (!gaim_account_get_check_mail(session->account))
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1277 return;
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1278
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1279 table = msn_message_get_hashtable_from_body(msg);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1280
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1281 from = subject = NULL;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1282
8657
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1283 tmp = g_hash_table_lookup(table, "From");
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1284 if (tmp != NULL)
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1285 from = gaim_mime_decode_field(tmp);
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1286
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1287 tmp = g_hash_table_lookup(table, "Subject");
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1288 if (tmp != NULL)
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1289 subject = gaim_mime_decode_field(tmp);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1290
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1291 gaim_notify_email(gc,
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1292 (subject != NULL ? subject : ""),
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1293 (from != NULL ? from : ""),
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1294 msn_user_get_passport(session->user),
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1295 session->passport_info.file, NULL, NULL);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1296
8657
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1297 if (from != NULL)
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1298 g_free(from);
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1299
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1300 if (subject != NULL)
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1301 g_free(subject);
7817
954b986ad3e3 [gaim-migrate @ 8464]
Mark Doliner <mark@kingant.net>
parents: 7699
diff changeset
1302
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1303 g_hash_table_destroy(table);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1304 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1305
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1306 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1307 system_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1308 {
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1309 GHashTable *table;
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1310 const char *type_s;
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1311
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1312 if (strcmp(msg->remote_user, "Hotmail"))
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1313 /* This isn't an official message. */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1314 return;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1315
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1316 table = msn_message_get_hashtable_from_body(msg);
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1317
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1318 if ((type_s = g_hash_table_lookup(table, "Type")) != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1319 {
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1320 int type = atoi(type_s);
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1321 char buf[MSN_BUF_LEN];
6308
a21cf07cd8e1 [gaim-migrate @ 6807]
Mark Doliner <mark@kingant.net>
parents: 5963
diff changeset
1322 int minutes;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1323
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1324 switch (type)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1325 {
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1326 case 1:
6308
a21cf07cd8e1 [gaim-migrate @ 6807]
Mark Doliner <mark@kingant.net>
parents: 5963
diff changeset
1327 minutes = atoi(g_hash_table_lookup(table, "Arg1"));
a21cf07cd8e1 [gaim-migrate @ 6807]
Mark Doliner <mark@kingant.net>
parents: 5963
diff changeset
1328 g_snprintf(buf, sizeof(buf), ngettext(
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1329 "The MSN server will shut down for maintenance "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1330 "in %d minute. You will automatically be "
10816
c94f40ffcafb [gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents: 10812
diff changeset
1331 "signed out at that time. Please finish any "
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1332 "conversations in progress.\n\nAfter the "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1333 "maintenance has been completed, you will be "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1334 "able to successfully sign in.",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1335 "The MSN server will shut down for maintenance "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1336 "in %d minutes. You will automatically be "
10816
c94f40ffcafb [gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents: 10812
diff changeset
1337 "signed out at that time. Please finish any "
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1338 "conversations in progress.\n\nAfter the "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1339 "maintenance has been completed, you will be "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1340 "able to successfully sign in.", minutes),
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1341 minutes);
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1342 default:
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1343 break;
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1344 }
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1345
5436
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5406
diff changeset
1346 if (*buf != '\0')
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1347 gaim_notify_info(cmdproc->session->account->gc, NULL, buf, NULL);
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1348 }
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1349
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1350 g_hash_table_destroy(table);
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1351 }
5793
952710ac6635 [gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents: 5768
diff changeset
1352
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1353 void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1354 msn_notification_add_buddy(MsnNotification *notification, const char *list,
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1355 const char *who, const char *store_name,
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1356 int group_id)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1357 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1358 MsnCmdProc *cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1359 cmdproc = notification->servconn->cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1360
9204
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1361 if (group_id < 0 && !strcmp(list, "FL"))
9194
364aa73323b5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1362 group_id = 0;
364aa73323b5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1363
9204
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1364 if (group_id >= 0)
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1365 {
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1366 msn_cmdproc_send(cmdproc, "ADD", "%s %s %s %d",
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1367 list, who, store_name, group_id);
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1368 }
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1369 else
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1370 {
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1371 msn_cmdproc_send(cmdproc, "ADD", "%s %s %s", list, who, store_name);
6478190b36a9 [gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents: 9198
diff changeset
1372 }
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1373 }
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1374
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1375 void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1376 msn_notification_rem_buddy(MsnNotification *notification, const char *list,
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1377 const char *who, int group_id)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1378 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1379 MsnCmdProc *cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1380 cmdproc = notification->servconn->cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1381
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1382 if (group_id >= 0)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1383 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1384 msn_cmdproc_send(cmdproc, "REM", "%s %s %d", list, who, group_id);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1385 }
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1386 else
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1387 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1388 msn_cmdproc_send(cmdproc, "REM", "%s %s", list, who);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1389 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1390 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1391
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
1392 /**************************************************************************
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
1393 * Init
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
1394 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1395
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1396 void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1397 msn_notification_init(void)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1398 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1399 /* TODO: check prp, blp */
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1400
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1401 cbs_table = msn_table_new();
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1402
10310
926bd0e5f487 [gaim-migrate @ 11504]
Mark Doliner <mark@kingant.net>
parents: 10296
diff changeset
1403 /* Synchronous */
11992
c824e39db0e7 [gaim-migrate @ 14285]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11862
diff changeset
1404 msn_table_add_cmd(cbs_table, "CHG", "CHG", NULL);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1405 msn_table_add_cmd(cbs_table, "CHG", "ILN", iln_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1406 msn_table_add_cmd(cbs_table, "ADD", "ADD", add_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1407 msn_table_add_cmd(cbs_table, "ADD", "ILN", iln_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1408 msn_table_add_cmd(cbs_table, "REM", "REM", rem_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1409 msn_table_add_cmd(cbs_table, "USR", "USR", usr_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1410 msn_table_add_cmd(cbs_table, "USR", "XFR", xfr_cmd);
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1411 msn_table_add_cmd(cbs_table, "USR", "GCF", gcf_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1412 msn_table_add_cmd(cbs_table, "SYN", "SYN", syn_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1413 msn_table_add_cmd(cbs_table, "CVR", "CVR", cvr_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1414 msn_table_add_cmd(cbs_table, "VER", "VER", ver_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1415 msn_table_add_cmd(cbs_table, "REA", "REA", rea_cmd);
10833
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1416 msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1417 /* msn_table_add_cmd(cbs_table, "BLP", "BLP", blp_cmd); */
9194
364aa73323b5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1418 msn_table_add_cmd(cbs_table, "BLP", "BLP", NULL);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1419 msn_table_add_cmd(cbs_table, "REG", "REG", reg_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1420 msn_table_add_cmd(cbs_table, "ADG", "ADG", adg_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1421 msn_table_add_cmd(cbs_table, "RMG", "RMG", rmg_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1422 msn_table_add_cmd(cbs_table, "XFR", "XFR", xfr_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1423
10310
926bd0e5f487 [gaim-migrate @ 11504]
Mark Doliner <mark@kingant.net>
parents: 10296
diff changeset
1424 /* Asynchronous */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1425 msn_table_add_cmd(cbs_table, NULL, "IPG", ipg_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1426 msn_table_add_cmd(cbs_table, NULL, "MSG", msg_cmd);
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1427 msn_table_add_cmd(cbs_table, NULL, "GCF", gcf_cmd);
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1428 msn_table_add_cmd(cbs_table, NULL, "SBS", sbs_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1429 msn_table_add_cmd(cbs_table, NULL, "NOT", not_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1430
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1431 msn_table_add_cmd(cbs_table, NULL, "CHL", chl_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1432 msn_table_add_cmd(cbs_table, NULL, "REM", rem_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1433 msn_table_add_cmd(cbs_table, NULL, "ADD", add_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1434
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1435 msn_table_add_cmd(cbs_table, NULL, "QRY", NULL);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1436 msn_table_add_cmd(cbs_table, NULL, "QNG", NULL);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1437 msn_table_add_cmd(cbs_table, NULL, "FLN", fln_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1438 msn_table_add_cmd(cbs_table, NULL, "NLN", nln_cmd);
8832
c313e3b1f2c0 [gaim-migrate @ 9596]
Christian Hammond <chipx86@chipx86.com>
parents: 8808
diff changeset
1439 msn_table_add_cmd(cbs_table, NULL, "ILN", iln_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1440 msn_table_add_cmd(cbs_table, NULL, "OUT", out_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1441 msn_table_add_cmd(cbs_table, NULL, "RNG", rng_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1442
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1443 msn_table_add_cmd(cbs_table, NULL, "URL", url_cmd);
9194
364aa73323b5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1444
10043
700f8fb9e581 [gaim-migrate @ 11002]
Luke Schierer <lschiere@pidgin.im>
parents: 10010
diff changeset
1445 msn_table_add_cmd(cbs_table, "fallback", "XFR", xfr_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1446
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1447 msn_table_add_error(cbs_table, "ADD", add_error);
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1448 msn_table_add_error(cbs_table, "REG", reg_error);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1449 msn_table_add_error(cbs_table, "RMG", rmg_error);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1450 /* msn_table_add_error(cbs_table, "REA", rea_error); */
10568
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
1451 msn_table_add_error(cbs_table, "USR", usr_error);
10403
e5455f1dc9b6 [gaim-migrate @ 11648]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10345
diff changeset
1452
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1453 msn_table_add_msg_type(cbs_table,
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1454 "text/x-msmsgsprofile",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1455 profile_msg);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1456 msn_table_add_msg_type(cbs_table,
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1457 "text/x-msmsgsinitialemailnotification",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1458 initial_email_msg);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1459 msn_table_add_msg_type(cbs_table,
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1460 "text/x-msmsgsemailnotification",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1461 email_msg);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1462 msn_table_add_msg_type(cbs_table,
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1463 "application/x-msmsgssystemmessage",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1464 system_msg);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1465 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1466
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1467 void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1468 msn_notification_end(void)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1469 {
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1470 msn_table_destroy(cbs_table);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1471 }