Mercurial > pidgin
annotate libpurple/protocols/msn/notification.c @ 27446:036d94041e09
Fix this compiler warning:
clientlogin.c: In function send_start_oscar_session:
clientlogin.c:293: warning: format %zu expects type size_t, but argument 4 has type time_t
I'm not sure it's 100% right this way but it preserves what was there
before for 64bit CPUs and makes my old crap happy too.
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Fri, 10 Jul 2009 02:26:37 +0000 |
parents | 01f1929d0936 |
children | 35b6fd563056 |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file notification.c Notification server functions |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15822 | 4 * purple |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * |
15822 | 6 * Purple is the legal property of its developers, whose names are too numerous |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18550
diff
changeset
|
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 #include "msn.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 #include "notification.h" |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
26 #include "contact.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "state.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 #include "error.h" |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
29 #include "msnutils.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 #include "page.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "userlist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "sync.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "slplink.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 static MsnTable *cbs_table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 * Main |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 destroy_cb(MsnServConn *servconn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 MsnNotification *notification; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 notification = servconn->cmdproc->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 g_return_if_fail(notification != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 msn_notification_destroy(notification); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 MsnNotification * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 msn_notification_new(MsnSession *session) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 MsnNotification *notification; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 MsnServConn *servconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 g_return_val_if_fail(session != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 notification = g_new0(MsnNotification, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 notification->session = session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 notification->servconn = servconn = msn_servconn_new(session, MSN_SERVCONN_NS); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 msn_servconn_set_destroy_cb(servconn, destroy_cb); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 notification->cmdproc = servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 notification->cmdproc->data = notification; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 notification->cmdproc->cbs_table = cbs_table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 return notification; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 msn_notification_destroy(MsnNotification *notification) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 notification->cmdproc->data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 msn_servconn_set_destroy_cb(notification->servconn, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 msn_servconn_destroy(notification->servconn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 g_free(notification); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 * Connect |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 connect_cb(MsnServConn *servconn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 MsnSession *session; |
15822 | 95 PurpleAccount *account; |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
96 GString *vers; |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
97 const char *ver_str; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
99 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 g_return_if_fail(servconn != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 cmdproc = servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 session = servconn->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 account = session->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
106 vers = g_string_new(""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
108 for (i = WLM_MAX_PROTOCOL; i >= WLM_MIN_PROTOCOL; i--) |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
109 g_string_append_printf(vers, " MSNP%d", i); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
111 g_string_append(vers, " CVR0"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 if (session->login_step == MSN_LOGIN_STEP_START) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
118 /* Skip the initial space */ |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
119 ver_str = (vers->str + 1); |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
120 msn_cmdproc_send(cmdproc, "VER", "%s", ver_str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
122 g_string_free(vers, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
125 gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 msn_notification_connect(MsnNotification *notification, const char *host, int port) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 MsnServConn *servconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 g_return_val_if_fail(notification != NULL, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
132 servconn = notification->servconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 msn_servconn_set_connect_cb(servconn, connect_cb); |
23504
5c95339855b2
Allow forcing an MSN HTTP connection to connect to a new server. This
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23502
diff
changeset
|
135 notification->in_use = msn_servconn_connect(servconn, host, port, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 return notification->in_use; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 msn_notification_disconnect(MsnNotification *notification) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 g_return_if_fail(notification != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 g_return_if_fail(notification->in_use); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 msn_servconn_disconnect(notification->servconn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 notification->in_use = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 * Login |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 void |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
156 msn_got_login_params(MsnSession *session, const char *ticket, const char *response) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 cmdproc = session->notification->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
164 msn_cmdproc_send(cmdproc, "USR", "SSO S %s %s", ticket, response); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 cvr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 { |
15822 | 170 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 account = cmdproc->session->account; |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
173 |
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
174 msn_cmdproc_send(cmdproc, "USR", "SSO I %s", purple_account_get_username(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
178 usr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
179 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 MsnSession *session; |
15822 | 181 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 account = session->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 if (!g_ascii_strcasecmp(cmd->params[1], "OK")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
188 /* authenticate OK */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 } |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
191 else if (!g_ascii_strcasecmp(cmd->params[1], "SSO")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 { |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
193 /* RPS authentication */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 session->nexus = msn_nexus_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
197 session->nexus->policy = g_strdup(cmd->params[3]); |
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
198 session->nexus->nonce = g_strdup(cmd->params[4]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_START); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 msn_nexus_connect(session->nexus); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 usr_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 MsnErrorType msnerr = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 switch (error) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 case 500: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 case 601: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 case 910: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 case 921: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 msnerr = MSN_ERROR_SERV_UNAVAILABLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 case 911: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 msnerr = MSN_ERROR_AUTH; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 msn_session_set_error(cmdproc->session, msnerr, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 ver_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 MsnSession *session; |
15822 | 234 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 gboolean protocol_supported = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 char proto_str[8]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 size_t i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 account = session->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 g_snprintf(proto_str, sizeof(proto_str), "MSNP%d", session->protocol_ver); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
243 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 for (i = 1; i < cmd->param_count; i++) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 if (!strcmp(cmd->params[i], proto_str)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 protocol_supported = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 if (!protocol_supported) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 msn_session_set_error(session, MSN_ERROR_UNSUPPORTED_PROTOCOL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
260 /* |
23464
1ac5faa72c8d
explicit merge of '9d90ebdb7e38fdd77bb504bc3302a083616360d9'
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
261 * Windows Live Messenger 8.5 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
262 * Notice :CVR String discriminate! |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
263 * reference of http://www.microsoft.com/globaldev/reference/oslocversion.mspx |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
264 * to see the Local ID |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
265 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 msn_cmdproc_send(cmdproc, "CVR", |
24193
345ed41d807b
Update MSN Client Version (CVR) string to match 8.5.1302.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24192
diff
changeset
|
267 "0x0409 winnt 5.1 i386 MSNMSGR 8.5.1302 BC01 %s", |
15822 | 268 purple_account_get_username(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 * Log out |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 out_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 { |
23512
f1ff35d14a95
When receiving an MSN OUT, don't try to dereference cmd->params when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23504
diff
changeset
|
278 if (cmd->param_count == 0) |
f1ff35d14a95
When receiving an MSN OUT, don't try to dereference cmd->params when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23504
diff
changeset
|
279 msn_session_set_error(cmdproc->session, -1, NULL); |
f1ff35d14a95
When receiving an MSN OUT, don't try to dereference cmd->params when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23504
diff
changeset
|
280 else if (!g_ascii_strcasecmp(cmd->params[0], "OTH")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 msn_session_set_error(cmdproc->session, MSN_ERROR_SIGN_OTHER, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 else if (!g_ascii_strcasecmp(cmd->params[0], "SSD")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 msn_session_set_error(cmdproc->session, MSN_ERROR_SERV_DOWN, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 msn_notification_close(MsnNotification *notification) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 g_return_if_fail(notification != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 if (!notification->in_use) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 msn_cmdproc_send_quick(notification->cmdproc, "OUT", NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 msn_notification_disconnect(notification); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 * Messages |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
302 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 msg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 size_t len) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
307 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 msg = msn_message_new_from_cmd(cmdproc->session, cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
312 msn_message_parse_payload(msg, payload, len, MSG_LINE_DEM, MSG_BODY_DEM); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 #ifdef MSN_DEBUG_NS |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
314 msn_message_show_readable(msg, "Notification", TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
316 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 msn_cmdproc_process_msg(cmdproc, msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 msn_message_destroy(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 msg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
325 purple_debug_info("msn", "Processing MSG... \n"); |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
326 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 * command and we are processing it */ |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
329 if (cmd->payload == NULL) { |
27115
5bc1f2ae4b19
Remove some cosmetic differences between msg_cmd() and ubm_cmd()
Mark Doliner <mark@kingant.net>
parents:
27066
diff
changeset
|
330 cmdproc->last_cmd->payload_cb = msg_cmd_post; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
331 cmd->payload_len = atoi(cmd->params[2]); |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
332 } else { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 g_return_if_fail(cmd->payload_cb != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 |
22832
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22822
diff
changeset
|
335 #if 0 /* glib on win32 doesn't correctly support precision modifiers for a string */ |
27115
5bc1f2ae4b19
Remove some cosmetic differences between msg_cmd() and ubm_cmd()
Mark Doliner <mark@kingant.net>
parents:
27066
diff
changeset
|
336 purple_debug_info("msn", "MSG payload:{%.*s}\n", (guint)cmd->payload_len, cmd->payload); |
22832
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22822
diff
changeset
|
337 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 cmd->payload_cb(cmdproc, cmd, cmd->payload, cmd->payload_len); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
342 /*send Message to Yahoo Messenger*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
343 void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
344 uum_send_msg(MsnSession *session,MsnMessage *msg) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
345 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
346 MsnCmdProc *cmdproc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
347 MsnTransaction *trans; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
348 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
349 gsize payload_len; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
350 int type; |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
351 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
352 cmdproc = session->notification->cmdproc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
353 g_return_if_fail(msg != NULL); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
354 payload = msn_message_gen_payload(msg, &payload_len); |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
355 purple_debug_info("msn", |
22822
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22570
diff
changeset
|
356 "send UUM, payload{%s}, strlen:%" G_GSIZE_FORMAT ", len:%" G_GSIZE_FORMAT "\n", |
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22570
diff
changeset
|
357 payload, strlen(payload), payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
358 type = msg->type; |
22822
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22570
diff
changeset
|
359 trans = msn_transaction_new(cmdproc, "UUM", "%s 32 %d %" G_GSIZE_FORMAT, |
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22570
diff
changeset
|
360 msg->remote_user, type, payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
361 msn_transaction_set_payload(trans, payload, strlen(payload)); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
362 msn_cmdproc_send_trans(cmdproc, trans); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
363 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
364 |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
365 #if 0 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
366 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
367 ubm_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
368 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
369 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
370 MsnMessage *msg; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
371 PurpleConnection *gc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
372 const char *passport; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
373 const char *content_type; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
374 |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
375 purple_debug_info("msn", "Process UBM payload:%.*s\n", (guint)len, payload); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
376 msg = msn_message_new_from_cmd(cmdproc->session, cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
377 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
378 msn_message_parse_payload(msg, payload, len,MSG_LINE_DEM,MSG_BODY_DEM); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
379 #ifdef MSN_DEBUG_NS |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
380 msn_message_show_readable(msg, "Notification", TRUE); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
381 #endif |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
382 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
383 gc = cmdproc->session->account->gc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
384 passport = msg->remote_user; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
385 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
386 content_type = msn_message_get_content_type(msg); |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
387 purple_debug_info("msn", "type:%s\n", content_type); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
388 if(!strcmp(content_type,"text/plain")){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
389 const char *value; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
390 const char *body; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
391 char *body_enc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
392 char *body_final = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
393 size_t body_len; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
394 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
395 body = msn_message_get_bin_data(msg, &body_len); |
20989
2097b1664fa3
Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20979
diff
changeset
|
396 body_enc = g_markup_escape_text(body, body_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
397 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
398 if ((value = msn_message_get_attr(msg, "X-MMS-IM-Format")) != NULL) { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
399 char *pre, *post; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
400 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
401 msn_parse_format(value, &pre, &post); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
402 body_final = g_strdup_printf("%s%s%s", pre ? pre : "", |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
403 body_enc ? body_enc : "", post ? post : ""); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
404 g_free(pre); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
405 g_free(post); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
406 } |
20494
82d8797e06f3
Plug memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20488
diff
changeset
|
407 g_free(body_enc); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
408 serv_got_im(gc, passport, body_final, 0, time(NULL)); |
20989
2097b1664fa3
Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20979
diff
changeset
|
409 g_free(body_final); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
410 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
411 if(!strcmp(content_type,"text/x-msmsgscontrol")){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
412 if(msn_message_get_attr(msg, "TypingUser") != NULL){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
413 serv_got_typing(gc, passport, MSN_TYPING_RECV_TIMEOUT, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
414 PURPLE_TYPING); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
415 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
416 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
417 if(!strcmp(content_type,"text/x-msnmsgr-datacast")){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
418 char *username, *str; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
419 PurpleAccount *account; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
420 PurpleBuddy *buddy; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
421 const char *user; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
422 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
423 account = cmdproc->session->account; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
424 user = msg->remote_user; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
425 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
426 if ((buddy = purple_find_buddy(account, user)) != NULL){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
427 username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
428 }else{ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
429 username = g_markup_escape_text(user, -1); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
430 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
431 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
432 str = g_strdup_printf(_("%s just sent you a Nudge!"), username); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
433 g_free(username); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
434 msn_session_report_user(cmdproc->session,user,str,PURPLE_MESSAGE_SYSTEM); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
435 g_free(str); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
436 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
437 msn_message_destroy(msg); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
438 } |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
439 #endif |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
440 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
441 /*Yahoo msg process*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
442 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
443 ubm_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
444 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
445 purple_debug_info("msn", "Processing UBM... \n"); |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
446 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
447 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
448 * command and we are processing it */ |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
449 if (cmd->payload == NULL) { |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
450 cmdproc->last_cmd->payload_cb = msg_cmd_post; |
24505
dc7942955a7a
Cleaned up version of 2f409bcdde5ebbb1edf097aeb4b4366d7c71518d:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24492
diff
changeset
|
451 cmd->payload_len = atoi(cmd->params[3]); |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
452 } else { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
453 g_return_if_fail(cmd->payload_cb != NULL); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
454 |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
455 purple_debug_info("msn", "UBM payload:{%.*s}\n", (guint)(cmd->payload_len), cmd->payload); |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
456 msg_cmd_post(cmdproc, cmd, cmd->payload, cmd->payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
457 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
458 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
459 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
461 * Challenges |
20425
5048651671e1
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents:
20422
diff
changeset
|
462 * we use MD5 to caculate the Challenges |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
463 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
464 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 chl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
467 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 char buf[33]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
469 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
470 msn_handle_chl(cmd->params[1], buf); |
23443
75be80ddeca5
Patch 1 from Qulogic, this one mostly updates the version sent by pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
21790
diff
changeset
|
471 trans = msn_transaction_new(cmdproc, "QRY", "%s 32", MSNP15_WLM_PRODUCT_ID); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
473 msn_transaction_set_payload(trans, buf, 32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
475 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
476 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 * Buddy Lists |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 **************************************************************************/ |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
481 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
482 typedef struct MsnFqyCbData { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
483 MsnFqyCb cb; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
484 gpointer data; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
485 } MsnFqyCbData; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
486 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
487 /* add contact to xmlnode */ |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
488 static void |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
489 msn_add_contact_xml(MsnSession *session, xmlnode *mlNode,const char *passport, MsnListOp list_op, MsnNetwork networkId) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
490 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
491 xmlnode *d_node,*c_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
492 char **tokens; |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
493 const char *email,*domain; |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
494 char fmt_str[3]; |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
495 |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
496 g_return_if_fail(passport != NULL); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
497 |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
498 purple_debug_info("msn", "Passport: %s, type: %d\n", passport, networkId); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
499 tokens = g_strsplit(passport, "@", 2); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
500 email = tokens[0]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
501 domain = tokens[1]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
502 |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
503 if (email == NULL || domain == NULL) { |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
504 purple_debug_error("msn", "Invalid passport (%s) specified to add to contact xml.\n", passport); |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
505 g_strfreev(tokens); |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
506 g_return_if_reached(); |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
507 } |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
508 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
509 /*find a domain Node*/ |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
510 for (d_node = xmlnode_get_child(mlNode, "d"); d_node; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
511 d_node = xmlnode_get_next_twin(d_node)) { |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
512 const char *attr = xmlnode_get_attrib(d_node,"n"); |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
513 if (attr == NULL) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
514 continue; |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
515 if (!strcmp(attr, domain)) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
516 break; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
517 } |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
518 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
519 if (d_node == NULL) { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
520 /*domain not found, create a new domain Node*/ |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
521 purple_debug_info("msn", "Didn't find existing domain node, adding one.\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
522 d_node = xmlnode_new("d"); |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
523 xmlnode_set_attrib(d_node, "n", domain); |
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
524 xmlnode_insert_child(mlNode, d_node); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
525 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
526 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
527 /*create contact node*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
528 c_node = xmlnode_new("c"); |
20671
4dd60add6a7c
Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
529 xmlnode_set_attrib(c_node, "n", email); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
530 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
531 if (list_op != 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
532 purple_debug_info("msn", "list_op: %d\n", list_op); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
533 g_snprintf(fmt_str, sizeof(fmt_str), "%d", list_op); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
534 xmlnode_set_attrib(c_node, "l", fmt_str); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
535 } |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
536 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
537 if (networkId != MSN_NETWORK_UNKNOWN) { |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
538 g_snprintf(fmt_str, sizeof(fmt_str), "%d", networkId); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
539 /*mobile*/ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
540 /*type_str = g_strdup_printf("4");*/ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
541 xmlnode_set_attrib(c_node, "t", fmt_str); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
542 } |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
543 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
544 xmlnode_insert_child(d_node, c_node); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
545 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
546 g_strfreev(tokens); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
547 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
548 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 static void |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
550 msn_notification_post_adl(MsnCmdProc *cmdproc, const char *payload, int payload_len) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
551 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
552 MsnTransaction *trans; |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
553 purple_debug_info("msn", "Sending ADL with payload: %s\n", payload); |
23465
1d97298ccff5
Fix up some merge errors in MSN's notification.c. Darn meld...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23464
diff
changeset
|
554 trans = msn_transaction_new(cmdproc, "ADL", "%i", payload_len); |
22832
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22822
diff
changeset
|
555 msn_transaction_set_payload(trans, payload, payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
556 msn_cmdproc_send_trans(cmdproc, trans); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
557 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
558 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
559 static void |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
560 msn_notification_post_rml(MsnCmdProc *cmdproc, const char *payload, int payload_len) |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
561 { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
562 MsnTransaction *trans; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
563 purple_debug_info("msn", "Sending RML with payload: %s\n", payload); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
564 trans = msn_transaction_new(cmdproc, "RML", "%i", payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
565 msn_transaction_set_payload(trans, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
566 msn_cmdproc_send_trans(cmdproc, trans); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
567 } |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
568 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
569 void |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
570 msn_notification_send_fqy(MsnSession *session, |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
571 const char *payload, int payload_len, |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
572 MsnFqyCb cb, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
573 gpointer cb_data) |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
574 { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
575 MsnTransaction *trans; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
576 MsnCmdProc *cmdproc; |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
577 MsnFqyCbData *data; |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
578 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
579 cmdproc = session->notification->cmdproc; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
580 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
581 data = g_new(MsnFqyCbData, 1); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
582 data->cb = cb; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
583 data->data = cb_data; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
584 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
585 trans = msn_transaction_new(cmdproc, "FQY", "%d", payload_len); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
586 msn_transaction_set_payload(trans, payload, payload_len); |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
587 msn_transaction_set_data(trans, data); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
588 msn_cmdproc_send_trans(cmdproc, trans); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
589 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
590 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
591 static void |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
592 update_contact_network(MsnSession *session, const char *passport, MsnNetwork network, gpointer unused) |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
593 { |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
594 MsnUser *user; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
595 |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
596 if (network == MSN_NETWORK_UNKNOWN) |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
597 { |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
598 purple_debug_warning("msn", |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
599 "Ignoring user %s about which server knows nothing.\n", |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
600 passport); |
25603
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
601 /* Decrement the count for unknown results so that we'll continue login. |
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
602 Also, need to finish the login process here as well, because ADL OK |
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
603 will not be called. */ |
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
604 if (--session->adl_fqy == 0) |
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
605 msn_session_finish_login(session); |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
606 return; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
607 } |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
608 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
609 /* TODO: Also figure out how to update membership lists */ |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
610 user = msn_userlist_find_user(session->userlist, passport); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
611 if (user) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
612 xmlnode *adl_node; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
613 char *payload; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
614 int payload_len; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
615 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
616 msn_user_set_network(user, network); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
617 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
618 adl_node = xmlnode_new("ml"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
619 xmlnode_set_attrib(adl_node, "l", "1"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
620 msn_add_contact_xml(session, adl_node, passport, |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
621 user->list_op & MSN_LIST_OP_MASK, network); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
622 payload = xmlnode_to_str(adl_node, &payload_len); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
623 msn_notification_post_adl(session->notification->cmdproc, payload, payload_len); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
624 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
625 } else { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
626 purple_debug_error("msn", |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
627 "Got FQY update for unknown user %s on network %d.\n", |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
628 passport, network); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
629 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
630 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
631 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
632 /*dump contact info to NS*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
633 void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
634 msn_notification_dump_contact(MsnSession *session) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
635 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 MsnUser *user; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
637 GList *l; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
638 xmlnode *adl_node; |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
639 xmlnode *fqy_node; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
640 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
641 int payload_len; |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
642 int adl_count = 0; |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
643 int fqy_count = 0; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
644 const char *display_name; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
645 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
646 adl_node = xmlnode_new("ml"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
647 adl_node->child = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
648 xmlnode_set_attrib(adl_node, "l", "1"); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
649 fqy_node = xmlnode_new("ml"); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
650 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
651 /*get the userlist*/ |
23938
b9d4d8a77fef
disapproval of revision 'd50e4b01c210ebbcd8f8d5a001fa72450e021a97'
Ka-Hing Cheung <khc@hxbc.us>
parents:
23937
diff
changeset
|
652 for (l = session->userlist->users; l != NULL; l = l->next) { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
653 user = l->data; |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
654 |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
655 /* skip RL & PL during initial dump */ |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
656 if (!(user->list_op & MSN_LIST_OP_MASK)) |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
657 continue; |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
658 |
24229
e93ca60b97dc
References #6907, wrap a NULL check
Ka-Hing Cheung <khc@hxbc.us>
parents:
24228
diff
changeset
|
659 if (user->passport && !strcmp(user->passport, "messenger@microsoft.com")) |
23938
b9d4d8a77fef
disapproval of revision 'd50e4b01c210ebbcd8f8d5a001fa72450e021a97'
Ka-Hing Cheung <khc@hxbc.us>
parents:
23937
diff
changeset
|
660 continue; |
b9d4d8a77fef
disapproval of revision 'd50e4b01c210ebbcd8f8d5a001fa72450e021a97'
Ka-Hing Cheung <khc@hxbc.us>
parents:
23937
diff
changeset
|
661 |
25582
7ea04b53f553
Pluck the MSN bug fixes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25575
diff
changeset
|
662 if ((user->list_op & MSN_LIST_OP_MASK & ~MSN_LIST_FL_OP) |
7ea04b53f553
Pluck the MSN bug fixes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25575
diff
changeset
|
663 == (MSN_LIST_AL_OP | MSN_LIST_BL_OP)) { |
25477
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
664 /* The server will complain if we send it a user on both the |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
665 Allow and Block lists. So assume they're on the Block list |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
666 and remove them from the Allow list in the membership lists to |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
667 stop this from happening again. */ |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
668 purple_debug_warning("msn", |
25582
7ea04b53f553
Pluck the MSN bug fixes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25575
diff
changeset
|
669 "User %s is on both Allow and Block list; " |
25477
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
670 "removing from Allow list.\n", |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
671 user->passport); |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
672 msn_userlist_rem_buddy_from_list(session->userlist, user->passport, MSN_LIST_AL); |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
673 } |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
674 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
675 if (user->networkid != MSN_NETWORK_UNKNOWN) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
676 msn_add_contact_xml(session, adl_node, user->passport, |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
677 user->list_op & MSN_LIST_OP_MASK, user->networkid); |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
678 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
679 /* each ADL command may contain up to 150 contacts */ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
680 if (++adl_count % 150 == 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
681 payload = xmlnode_to_str(adl_node, &payload_len); |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
682 |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
683 /* ADL's are returned all-together */ |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
684 session->adl_fqy++; |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
685 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
686 msn_notification_post_adl(session->notification->cmdproc, |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
687 payload, payload_len); |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
688 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
689 g_free(payload); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
690 xmlnode_free(adl_node); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
691 |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
692 adl_node = xmlnode_new("ml"); |
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
693 adl_node->child = NULL; |
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
694 xmlnode_set_attrib(adl_node, "l", "1"); |
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
695 } |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
696 } else { |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
697 /* FQY's are returned one-at-a-time */ |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
698 session->adl_fqy++; |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
699 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
700 msn_add_contact_xml(session, fqy_node, user->passport, |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
701 0, user->networkid); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
702 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
703 /* each FQY command may contain up to 150 contacts, probably */ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
704 if (++fqy_count % 150 == 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
705 payload = xmlnode_to_str(fqy_node, &payload_len); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
706 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
707 msn_notification_send_fqy(session, payload, payload_len, |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
708 update_contact_network, NULL); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
709 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
710 g_free(payload); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
711 xmlnode_free(fqy_node); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
712 fqy_node = xmlnode_new("ml"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
713 } |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
714 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
715 } |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
716 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
717 /* Send the rest, or just an empty one to let the server set us online */ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
718 if (adl_count == 0 || adl_count % 150 != 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
719 payload = xmlnode_to_str(adl_node, &payload_len); |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
720 |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
721 /* ADL's are returned all-together */ |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
722 session->adl_fqy++; |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
723 |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
724 msn_notification_post_adl(session->notification->cmdproc, payload, payload_len); |
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
725 |
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
726 g_free(payload); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
727 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
728 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
729 if (fqy_count % 150 != 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
730 payload = xmlnode_to_str(fqy_node, &payload_len); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
731 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
732 msn_notification_send_fqy(session, payload, payload_len, |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
733 update_contact_network, NULL); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
734 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
735 g_free(payload); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
736 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
737 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
738 xmlnode_free(adl_node); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
739 xmlnode_free(fqy_node); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
740 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
741 display_name = purple_connection_get_display_name(session->account->gc); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
742 if (display_name |
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
743 && strcmp(display_name, |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
744 purple_account_get_username(session->account))) { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
745 msn_act_id(session->account->gc, display_name); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
746 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
747 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
748 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
749 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
750 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
751 blp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
752 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
753 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
754 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
755 static void |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
756 adl_cmd_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
757 size_t len) |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
758 { |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
759 xmlnode *root, *domain_node; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
760 |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
761 purple_debug_misc("msn", "Parsing received ADL XML data\n"); |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
762 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
763 g_return_if_fail(payload != NULL); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
764 |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
765 root = xmlnode_from_str(payload, (gssize) len); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
766 |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
767 if (root == NULL) { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
768 purple_debug_info("msn", "Invalid XML in ADL!\n"); |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
769 return; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
770 } |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
771 for (domain_node = xmlnode_get_child(root, "d"); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
772 domain_node; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
773 domain_node = xmlnode_get_next_twin(domain_node)) { |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
774 const gchar * domain = NULL; |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
775 xmlnode *contact_node = NULL; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
776 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
777 domain = xmlnode_get_attrib(domain_node, "n"); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
778 |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
779 for (contact_node = xmlnode_get_child(domain_node, "c"); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
780 contact_node; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
781 contact_node = xmlnode_get_next_twin(contact_node)) { |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
782 const gchar *list; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
783 gint list_op = 0; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
784 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
785 list = xmlnode_get_attrib(contact_node, "l"); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
786 if (list != NULL) { |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
787 list_op = atoi(list); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
788 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
789 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
790 if (list_op & MSN_LIST_RL_OP) { |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
791 /* someone is adding us */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
792 msn_get_contact_list(cmdproc->session, MSN_PS_PENDING_LIST, NULL); |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
793 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
794 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
795 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
796 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
797 xmlnode_free(root); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
798 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
799 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
800 static void |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
801 adl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
802 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
803 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
804 |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
805 g_return_if_fail(cmdproc != NULL); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
806 g_return_if_fail(cmdproc->session != NULL); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
807 g_return_if_fail(cmdproc->last_cmd != NULL); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
808 g_return_if_fail(cmd != NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
809 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
810 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
811 |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
812 if (!strcmp(cmd->params[1], "OK")) { |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
813 /* ADL ack */ |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
814 if (--session->adl_fqy == 0) |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
815 msn_session_finish_login(session); |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
816 } else { |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
817 cmdproc->last_cmd->payload_cb = adl_cmd_parse; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
818 cmd->payload_len = atoi(cmd->params[1]); |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
819 } |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
820 |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
821 return; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
822 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
823 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
824 static void |
24267
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
825 adl_error_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
826 { |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
827 MsnSession *session; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
828 PurpleAccount *account; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
829 PurpleConnection *gc; |
26810
55736bd691e2
re-enable something that qulogic wrote but commented out because of a
Ka-Hing Cheung <khc@hxbc.us>
parents:
26786
diff
changeset
|
830 char *adl = g_strndup(payload, len); |
55736bd691e2
re-enable something that qulogic wrote but commented out because of a
Ka-Hing Cheung <khc@hxbc.us>
parents:
26786
diff
changeset
|
831 char *reason = g_strdup_printf(_("Unknown error (%d): %s"), |
55736bd691e2
re-enable something that qulogic wrote but commented out because of a
Ka-Hing Cheung <khc@hxbc.us>
parents:
26786
diff
changeset
|
832 GPOINTER_TO_INT(cmd->payload_cbdata), adl); |
55736bd691e2
re-enable something that qulogic wrote but commented out because of a
Ka-Hing Cheung <khc@hxbc.us>
parents:
26786
diff
changeset
|
833 g_free(adl); |
24267
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
834 |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
835 session = cmdproc->session; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
836 account = session->account; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
837 gc = purple_account_get_connection(account); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
838 |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
839 purple_notify_error(gc, NULL, _("Unable to add user"), reason); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
840 g_free(reason); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
841 } |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
842 |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
843 static void |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
844 adl_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 MsnSession *session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
847 PurpleAccount *account; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
848 PurpleConnection *gc; |
24267
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
849 MsnCommand *cmd = cmdproc->last_cmd; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
850 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
851 session = cmdproc->session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
852 account = session->account; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
853 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
855 purple_debug_error("msn", "ADL error\n"); |
24267
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
856 if (cmd->param_count > 1) { |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
857 cmd->payload_cb = adl_error_parse; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
858 cmd->payload_len = atoi(cmd->params[1]); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
859 cmd->payload_cbdata = GINT_TO_POINTER(error); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
860 } else { |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
861 char *reason = g_strdup_printf(_("Unknown error (%d)"), error); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
862 purple_notify_error(gc, NULL, _("Unable to add user"), reason); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
863 g_free(reason); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
864 } |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
865 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
867 static void |
24128
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
868 adl_241_error_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
869 size_t len) |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
870 { |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
871 /* khc: some googling suggests that error 241 means the buddy is somehow |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
872 in the local list, but not the server list, and that we should add |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
873 those buddies to the addressbook. For now I will just notify the user |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
874 about the raw payload, because I am lazy */ |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
875 MsnSession *session; |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
876 PurpleAccount *account; |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
877 PurpleConnection *gc; |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
878 xmlnode *adl; |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
879 xmlnode *domain; |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
880 GString *emails; |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
881 |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
882 session = cmdproc->session; |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
883 account = session->account; |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
884 gc = purple_account_get_connection(account); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
885 |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
886 adl = xmlnode_from_str(payload, len); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
887 emails = g_string_new(NULL); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
888 |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
889 domain = xmlnode_get_child(adl, "d"); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
890 while (domain) { |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
891 const char *domain_str = xmlnode_get_attrib(domain, "n"); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
892 xmlnode *contact = xmlnode_get_child(domain, "c"); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
893 while (contact) { |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
894 g_string_append_printf(emails, "%s@%s\n", |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
895 xmlnode_get_attrib(contact, "n"), domain_str); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
896 contact = xmlnode_get_next_twin(contact); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
897 } |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
898 domain = xmlnode_get_next_twin(domain); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
899 } |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
900 |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
901 purple_notify_error(gc, NULL, |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
902 _("The following users are missing from your addressbook"), emails->str); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
903 g_string_free(emails, TRUE); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
904 xmlnode_free(adl); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
905 } |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
906 |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
907 static void |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
908 adl_241_error_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
909 { |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
910 cmdproc->last_cmd->payload_cb = adl_241_error_cmd_post; |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
911 cmd->payload_len = atoi(cmd->params[1]); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
912 } |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
913 |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
914 static void |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
915 fqy_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
916 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
917 { |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
918 MsnSession *session; |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
919 xmlnode *ml, *d, *c; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
920 const char *domain; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
921 const char *local; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
922 const char *type; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
923 char *passport; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
924 MsnNetwork network = MSN_NETWORK_PASSPORT; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
925 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
926 session = cmdproc->session; |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
927 |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
928 /* FQY response: |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
929 <ml><d n="domain.com"><c n="local-node" t="network" /></d></ml> */ |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
930 ml = xmlnode_from_str(payload, len); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
931 for (d = xmlnode_get_child(ml, "d"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
932 d != NULL; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
933 d = xmlnode_get_next_twin(d)) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
934 domain = xmlnode_get_attrib(d, "n"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
935 for (c = xmlnode_get_child(d, "c"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
936 c != NULL; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
937 c = xmlnode_get_next_twin(c)) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
938 local = xmlnode_get_attrib(c, "n"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
939 type = xmlnode_get_attrib(c, "t"); |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
940 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
941 passport = g_strdup_printf("%s@%s", local, domain); |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
942 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
943 if (g_ascii_isdigit(cmd->command[0])) |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
944 network = MSN_NETWORK_UNKNOWN; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
945 else if (type != NULL) |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
946 network = (MsnNetwork)strtoul(type, NULL, 10); |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
947 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
948 purple_debug_info("msn", "FQY response says %s is from network %d\n", |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
949 passport, network); |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
950 if (cmd->trans->data) { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
951 MsnFqyCbData *fqy_data = cmd->trans->data; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
952 fqy_data->cb(session, passport, network, fqy_data->data); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
953 /* TODO: This leaks, but the server responds to FQY multiple times, so we |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
954 can't free it yet. We need to figure out somewhere else to do so. |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
955 g_free(fqy_data); */ |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
956 } |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
957 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
958 g_free(passport); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
959 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
960 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
961 |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
962 xmlnode_free(ml); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
963 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
964 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
965 static void |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
966 fqy_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
967 { |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
968 MsnCommand *cmd = cmdproc->last_cmd; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
969 |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
970 purple_debug_warning("msn", "FQY error %d\n", error); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
971 if (cmd->param_count > 1) { |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
972 cmd->payload_cb = fqy_cmd_post; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
973 cmd->payload_len = atoi(cmd->params[1]); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
974 cmd->payload_cbdata = GINT_TO_POINTER(error); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
975 } |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
976 #if 0 |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
977 /* If the server didn't send us a corresponding email address for this |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
978 FQY error, it's probably going to disconnect us. So it isn't necessary |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
979 to tell the handler about it. */ |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
980 else if (trans->data) |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
981 ((MsnFqyCb)trans->data)(session, NULL, MSN_NETWORK_UNKNOWN, NULL); |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
982 #endif |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
983 } |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
984 |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
985 static void |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
986 fqy_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
987 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
988 purple_debug_info("msn", "Process FQY\n"); |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
989 cmdproc->last_cmd->payload_cb = fqy_cmd_post; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
990 cmd->payload_len = atoi(cmd->params[1]); |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
991 } |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
992 |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
993 static void |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
994 rml_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
995 size_t len) |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
996 { |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
997 if (payload != NULL) |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
998 purple_debug_info("msn", "Received RML:\n%s\n", payload); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
999 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1000 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1001 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1002 rml_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1003 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
1004 purple_debug_info("msn", "Process RML\n"); |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1005 cmd->payload_len = atoi(cmd->params[1]); |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1006 cmdproc->last_cmd->payload_cb = rml_cmd_post; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1007 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1008 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1009 static void |
17128
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1010 qng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1011 { |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1012 /* TODO: Call PNG after the timeout specified. */ |
17128
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1013 } |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1014 |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1015 |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1016 static void |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1017 fln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1018 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1019 MsnSlpLink *slplink; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1020 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1021 |
23305
27f7fae4a361
Add a few bits of documentation
Mark Doliner <mark@kingant.net>
parents:
23301
diff
changeset
|
1022 /* Tell libpurple that the user has signed off */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1023 user = msn_userlist_find_user(cmdproc->session->userlist, cmd->params[0]); |
23498
80d09f42b157
A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23496
diff
changeset
|
1024 msn_user_set_state(user, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1025 msn_user_update(user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1026 |
23305
27f7fae4a361
Add a few bits of documentation
Mark Doliner <mark@kingant.net>
parents:
23301
diff
changeset
|
1027 /* If we have an open MsnSlpLink with the user then close it */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 slplink = msn_session_find_slplink(cmdproc->session, cmd->params[0]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1029 if (slplink != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 msn_slplink_destroy(slplink); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1031 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1032 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1033 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1034 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1035 iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1036 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1037 MsnSession *session; |
15822 | 1038 PurpleAccount *account; |
1039 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1040 MsnUser *user; |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1041 MsnObject *msnobj = NULL; |
22570
1168dc635ac1
some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents:
22536
diff
changeset
|
1042 unsigned long clientid; |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1043 int networkid = 0; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1044 const char *state, *passport; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1045 char *friendly; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1046 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1047 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1048 account = session->account; |
15822 | 1049 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1050 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1051 state = cmd->params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1052 passport = cmd->params[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1053 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1054 user = msn_userlist_find_user(session->userlist, passport); |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1055 if (user == NULL) |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1056 /* Where'd this come from? */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1057 return; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1058 |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1059 if (cmd->param_count == 7) { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1060 /* MSNP14+ with Display Picture object */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1061 networkid = atoi(cmd->params[3]); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1062 friendly = g_strdup(purple_url_decode(cmd->params[4])); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1063 clientid = strtoul(cmd->params[5], NULL, 10); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1064 msnobj = msn_object_new_from_string(purple_url_decode(cmd->params[6])); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1065 } else if (cmd->param_count == 6) { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1066 /* Yes, this is 5. The friendly name could start with a number, |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1067 but the display picture object can't... */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1068 if (isdigit(cmd->params[5][0])) { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1069 /* MSNP14 without Display Picture object */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1070 networkid = atoi(cmd->params[3]); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1071 friendly = g_strdup(purple_url_decode(cmd->params[4])); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1072 clientid = strtoul(cmd->params[5], NULL, 10); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1073 } else { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1074 /* MSNP8+ with Display Picture object */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1075 friendly = g_strdup(purple_url_decode(cmd->params[3])); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1076 clientid = strtoul(cmd->params[4], NULL, 10); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1077 msnobj = msn_object_new_from_string(purple_url_decode(cmd->params[5])); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1078 } |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1079 } else if (cmd->param_count == 5) { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1080 /* MSNP8+ without Display Picture object */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1081 friendly = g_strdup(purple_url_decode(cmd->params[3])); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1082 clientid = strtoul(cmd->params[4], NULL, 10); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1083 } else { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1084 purple_debug_warning("msn", "Received ILN with unknown number of parameters.\n"); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1085 return; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1086 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1087 |
25394
ea9e0fa89c02
Update the Address Book when we recieve a new friendly name for a buddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25393
diff
changeset
|
1088 if (msn_user_set_friendly_name(user, friendly)) { |
25393
f5188d4d84e3
Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24720
diff
changeset
|
1089 serv_got_alias(gc, passport, friendly); |
25394
ea9e0fa89c02
Update the Address Book when we recieve a new friendly name for a buddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25393
diff
changeset
|
1090 msn_update_contact(session, passport, MSN_UPDATE_DISPLAY, friendly); |
ea9e0fa89c02
Update the Address Book when we recieve a new friendly name for a buddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25393
diff
changeset
|
1091 } |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1092 g_free(friendly); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1093 |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1094 msn_user_set_object(user, msnobj); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1095 |
22570
1168dc635ac1
some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents:
22536
diff
changeset
|
1096 user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE) || (user->phone.mobile && user->phone.mobile[0] == '+'); |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1097 msn_user_set_clientid(user, clientid); |
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1098 msn_user_set_network(user, networkid); |
22570
1168dc635ac1
some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents:
22536
diff
changeset
|
1099 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1100 msn_user_set_state(user, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1101 msn_user_update(user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1102 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1103 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1104 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1105 ipg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1106 { |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1107 PurpleConnection *gc; |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1108 MsnUserList *userlist; |
24192
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1109 const char *who = NULL; |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1110 char *text = NULL; |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1111 const char *id = NULL; |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1112 xmlnode *payloadNode, *from, *msg, *textNode; |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1113 |
15822 | 1114 purple_debug_misc("msn", "Incoming Page: {%s}\n", payload); |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1115 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1116 userlist = cmdproc->session->userlist; |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1117 gc = purple_account_get_connection(cmdproc->session->account); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1118 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1119 /* payload looks like this: |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1120 <?xml version="1.0"?> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1121 <NOTIFICATION id="0" siteid="111100400" siteurl="http://mobile.msn.com/"> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1122 <TO name="passport@example.com"> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1123 <VIA agent="mobile"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1124 </TO> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1125 <FROM name="tel:+XXXXXXXXXXX"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1126 <MSG pri="1" id="1"> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1127 <CAT Id="110110001"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1128 <ACTION url="2wayIM.asp"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1129 <SUBSCR url="2wayIM.asp"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1130 <BODY lcid="1033"> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1131 <TEXT>Message was here</TEXT> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1132 </BODY> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1133 </MSG> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1134 </NOTIFICATION> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1135 */ |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1136 |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1137 /* This is the payload if your message was too long: |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1138 <NOTIFICATION id="TrID" siteid="111100400" siteurl="http://mobile.msn.com/"> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1139 <TO name="passport@example.com"> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1140 <VIA agent="mobile"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1141 </TO> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1142 <FROM name="tel:+XXXXXXXXXXX"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1143 <MSG pri="1" id="407"> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1144 <CAT Id="110110001"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1145 <ACTION url="2wayIM.asp"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1146 <SUBSCR url="2wayIM.asp"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1147 <BODY lcid="1033"> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1148 <TEXT></TEXT> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1149 </BODY> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1150 </MSG> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1151 </NOTIFICATION> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1152 */ |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1153 |
24192
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1154 payloadNode = xmlnode_from_str(payload, len); |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1155 if (!payloadNode) |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1156 return; |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1157 |
24192
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1158 if (!(from = xmlnode_get_child(payloadNode, "FROM")) || |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1159 !(msg = xmlnode_get_child(payloadNode, "MSG")) || |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1160 !(textNode = xmlnode_get_child(msg, "BODY/TEXT"))) { |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1161 xmlnode_free(payloadNode); |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1162 return; |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1163 } |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1164 |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1165 who = xmlnode_get_attrib(from, "name"); |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1166 if (!who) return; |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1167 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1168 text = xmlnode_get_data(textNode); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1169 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1170 /* Match number to user's mobile number, FROM is a phone number if the |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1171 other side page you using your phone number */ |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1172 if (!strncmp(who, "tel:+", 5)) { |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1173 MsnUser *user = |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1174 msn_userlist_find_user_with_mobile_phone(userlist, who + 4); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1175 |
24192
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1176 if (user && user->passport) |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1177 who = user->passport; |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1178 } |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1179 |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1180 id = xmlnode_get_attrib(msg, "id"); |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1181 |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1182 if (id && !strcmp(id, "407")) { |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1183 /* TODO: Use this to NAK the transaction, maybe print the text, too. |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1184 unsigned int trId; |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1185 id = xmlnode_get_attrib(payloadNode, "id"); |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1186 trId = atol(id); |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1187 */ |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1188 purple_conv_present_error(who, gc->account, |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1189 _("Mobile message was not sent because it was too long.")); |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1190 |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1191 } else { |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1192 serv_got_im(gc, who, text, 0, time(NULL)); |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1193 } |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1194 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1195 g_free(text); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1196 xmlnode_free(payloadNode); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1197 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 ipg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 { |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1202 cmd->payload_len = atoi(cmd->params[0]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 cmdproc->last_cmd->payload_cb = ipg_cmd_post; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1204 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1206 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1207 nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1208 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1209 MsnSession *session; |
15822 | 1210 PurpleAccount *account; |
1211 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1212 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1213 MsnObject *msnobj; |
22346
382bc33e8824
Patch from Jorge Villaseor, treat the client id as unsigned so 0x80000000
Ka-Hing Cheung <khc@hxbc.us>
parents:
21790
diff
changeset
|
1214 unsigned long clientid; |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1215 int networkid; |
25393
f5188d4d84e3
Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24720
diff
changeset
|
1216 const char *state, *passport, *friendly; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1217 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1218 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1219 account = session->account; |
15822 | 1220 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1221 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1222 state = cmd->params[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1223 passport = cmd->params[1]; |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1224 networkid = atoi(cmd->params[2]); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1225 friendly = purple_url_decode(cmd->params[3]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1226 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1227 user = msn_userlist_find_user(session->userlist, passport); |
24168
a1a88c1bd59e
don't crash if we get a NLN command from someone not on the blist
Ka-Hing Cheung <khc@hxbc.us>
parents:
23988
diff
changeset
|
1228 if (user == NULL) return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 |
25393
f5188d4d84e3
Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24720
diff
changeset
|
1230 if (msn_user_set_friendly_name(user, friendly)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1231 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1232 serv_got_alias(gc, passport, friendly); |
25394
ea9e0fa89c02
Update the Address Book when we recieve a new friendly name for a buddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25393
diff
changeset
|
1233 msn_update_contact(session, passport, MSN_UPDATE_DISPLAY, friendly); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1234 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 |
23517
7f4473544c64
Fix updating the MSN buddy icon, which was probably broken by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23514
diff
changeset
|
1236 if (cmd->param_count == 6) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1237 { |
23481
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1238 msnobj = msn_object_new_from_string(purple_url_decode(cmd->params[5])); |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1239 msn_user_set_object(user, msnobj); |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1240 } |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1241 else |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1242 { |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1243 msn_user_set_object(user, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 |
22348
a298447b2d66
Specify the base to convert from to prevent interpreting 0-prefixed client
Stu Tomlinson <stu@nosnilmot.com>
parents:
22346
diff
changeset
|
1246 clientid = strtoul(cmd->params[4], NULL, 10); |
22570
1168dc635ac1
some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents:
22536
diff
changeset
|
1247 user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE) || (user->phone.mobile && user->phone.mobile[0] == '+'); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1248 |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1249 msn_user_set_clientid(user, clientid); |
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1250 msn_user_set_network(user, networkid); |
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1251 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 msn_user_set_state(user, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1253 msn_user_update(user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1256 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1258 chg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1259 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 char *state = cmd->params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1261 int state_id = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 if (!strcmp(state, "NLN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 state_id = MSN_ONLINE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 else if (!strcmp(state, "BSY")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 state_id = MSN_BUSY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 else if (!strcmp(state, "IDL")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 state_id = MSN_IDLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 else if (!strcmp(state, "BRB")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 state_id = MSN_BRB; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 else if (!strcmp(state, "AWY")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 state_id = MSN_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 else if (!strcmp(state, "PHN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 state_id = MSN_PHONE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1275 else if (!strcmp(state, "LUN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 state_id = MSN_LUNCH; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 else if (!strcmp(state, "HDN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1278 state_id = MSN_HIDDEN; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1279 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 cmdproc->session->state = state_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1283 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1286 not_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1287 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1288 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 MSN_SET_PARAMS("NOT %d\r\n%s", cmdproc->servconn->payload, payload); |
23892
e7cce5e911d8
Turn off those MSN NOTification debug messages. It should work now, and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23680
diff
changeset
|
1290 purple_debug_misc("msn", "Notification: {%s}\n", payload); |
23680
38c76b5b846b
Correctly save the payload_len of a MSN notification command. Also,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23674
diff
changeset
|
1291 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1292 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1294 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 not_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1296 { |
23680
38c76b5b846b
Correctly save the payload_len of a MSN notification command. Also,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23674
diff
changeset
|
1297 cmd->payload_len = atoi(cmd->params[0]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1298 cmdproc->last_cmd->payload_cb = not_cmd_post; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1299 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1300 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1301 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 MsnSession *session = cmdproc->session; |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
1305 const char *type, *value, *friendlyname; |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
1306 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 g_return_if_fail(cmd->param_count >= 3); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1309 type = cmd->params[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 if (cmd->param_count == 4) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 value = cmd->params[3]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1314 if (!strcmp(type, "PHH")) |
15822 | 1315 msn_user_set_home_phone(session->user, purple_url_decode(value)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 else if (!strcmp(type, "PHW")) |
15822 | 1317 msn_user_set_work_phone(session->user, purple_url_decode(value)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1318 else if (!strcmp(type, "PHM")) |
15822 | 1319 msn_user_set_mobile_phone(session->user, purple_url_decode(value)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 if (!strcmp(type, "PHH")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 msn_user_set_home_phone(session->user, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 else if (!strcmp(type, "PHW")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 msn_user_set_work_phone(session->user, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 else if (!strcmp(type, "PHM")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 msn_user_set_mobile_phone(session->user, NULL); |
20464
c3b23c9f170e
oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@hxbc.us>
parents:
20460
diff
changeset
|
1329 else { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1330 type = cmd->params[1]; |
20464
c3b23c9f170e
oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@hxbc.us>
parents:
20460
diff
changeset
|
1331 if (!strcmp(type, "MFN")) { |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
1332 friendlyname = purple_url_decode(cmd->params[2]); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1333 |
23472
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23465
diff
changeset
|
1334 msn_update_contact(session, "Me", MSN_UPDATE_DISPLAY, friendlyname); |
20464
c3b23c9f170e
oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@hxbc.us>
parents:
20460
diff
changeset
|
1335 |
c3b23c9f170e
oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@hxbc.us>
parents:
20460
diff
changeset
|
1336 purple_connection_set_display_name( |
c3b23c9f170e
oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@hxbc.us>
parents:
20460
diff
changeset
|
1337 purple_account_get_connection(session->account), |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
1338 friendlyname); |
20464
c3b23c9f170e
oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@hxbc.us>
parents:
20460
diff
changeset
|
1339 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1340 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1345 * Misc commands |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 url_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1350 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1351 MsnSession *session; |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1352 PurpleConnection *gc; |
15822 | 1353 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 const char *rru; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 const char *url; |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1356 PurpleCipherContext *cipher; |
23673
59f8890ae8cf
Fix up the MSN Inbox URL. There was a typo that caused a use-after-free
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23612
diff
changeset
|
1357 gchar creds[33]; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1358 char *buf; |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1359 |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1360 gulong tmp_timestamp; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1362 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1363 account = session->account; |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1364 gc = account->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 rru = cmd->params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 url = cmd->params[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1369 session->passport_info.mail_timestamp = time(NULL); |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1370 tmp_timestamp = session->passport_info.mail_timestamp - session->passport_info.sl; |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1371 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 buf = g_strdup_printf("%s%lu%s", |
23674
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1373 session->passport_info.mspauth ? session->passport_info.mspauth : "BOGUS", |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1374 tmp_timestamp, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1375 purple_connection_get_password(gc)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1377 cipher = purple_cipher_context_new_by_name("md5", NULL); |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1378 purple_cipher_context_append(cipher, (const guchar *)buf, strlen(buf)); |
23673
59f8890ae8cf
Fix up the MSN Inbox URL. There was a typo that caused a use-after-free
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23612
diff
changeset
|
1379 purple_cipher_context_digest_to_str(cipher, sizeof(creds), creds, NULL); |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1380 purple_cipher_context_destroy(cipher); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1381 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1382 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1383 g_free(session->passport_info.mail_url); |
23674
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1384 session->passport_info.mail_url = |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1385 g_strdup_printf("%s&auth=%s&creds=%s&sl=%ld&username=%s&mode=ttl&sid=%s&id=2&rru=%s&svc=mail&js=yes", |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1386 url, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1387 session->passport_info.mspauth ? purple_url_encode(session->passport_info.mspauth) : "BOGUS", |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1388 creds, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1389 tmp_timestamp, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1390 msn_user_get_passport(session->user), |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1391 session->passport_info.sid, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1392 rru); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1393 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1394 /* The user wants to check his or her email */ |
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1395 if (cmd->trans && cmd->trans->data) |
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1396 purple_notify_uri(purple_account_get_connection(account), session->passport_info.mail_url); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1397 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1398 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1399 * Switchboards |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1400 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1401 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1402 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1403 rng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1404 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1405 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1406 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1407 const char *session_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1408 char *host; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1409 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1410 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1411 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1412 session_id = cmd->params[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1413 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1414 msn_parse_socket(cmd->params[1], &host, &port); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1415 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1416 if (session->http_method) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1417 port = 80; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1418 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1419 swboard = msn_switchboard_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1420 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1421 msn_switchboard_set_invited(swboard, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 msn_switchboard_set_session_id(swboard, cmd->params[0]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1423 msn_switchboard_set_auth_key(swboard, cmd->params[3]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1424 swboard->im_user = g_strdup(cmd->params[4]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1425 /* msn_switchboard_add_user(swboard, cmd->params[4]); */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1426 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1427 if (!msn_switchboard_connect(swboard, host, port)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1428 msn_switchboard_destroy(swboard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1430 g_free(host); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1431 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1433 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1434 xfr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1435 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1436 char *host; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1437 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1438 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1439 if (strcmp(cmd->params[1], "SB") && strcmp(cmd->params[1], "NS")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1440 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1441 /* Maybe we can have a generic bad command error. */ |
15822 | 1442 purple_debug_error("msn", "Bad XFR command (%s)\n", cmd->params[1]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1443 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1444 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1445 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1446 msn_parse_socket(cmd->params[2], &host, &port); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1447 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1448 if (!strcmp(cmd->params[1], "SB")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1449 { |
15822 | 1450 purple_debug_error("msn", "This shouldn't be handled here.\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1451 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1452 else if (!strcmp(cmd->params[1], "NS")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1453 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1454 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1455 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1456 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1457 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1458 msn_session_set_login_step(session, MSN_LOGIN_STEP_TRANSFER); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1459 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1460 msn_notification_connect(session->notification, host, port); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1461 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1462 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1463 g_free(host); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1464 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1465 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1466 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1467 gcf_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1468 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1469 { |
23527
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23521
diff
changeset
|
1470 /* QuLogic: Disabled until confirmed correct. */ |
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23521
diff
changeset
|
1471 #if 0 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1472 xmlnode *root; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1473 xmlnode *policy; |
20468
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1474 |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1475 g_return_if_fail(cmd->payload != NULL); |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1476 |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1477 if ( (root = xmlnode_from_str(cmd->payload, cmd->payload_len)) == NULL) |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1478 { |
26196
399776a9ad98
Add some missing newlines in debug messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25954
diff
changeset
|
1479 purple_debug_error("msn", "Unable to parse GCF payload into a XML tree\n"); |
20468
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1480 return; |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1481 } |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1482 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1483 |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1484 g_free(cmdproc->session->blocked_text); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1485 cmdproc->session->blocked_text = NULL; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1486 |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1487 /* We need a get_child with attrib... */ |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1488 policy = xmlnode_get_child(root, "Policy"); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1489 while (policy) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1490 if (g_str_equal(xmlnode_get_attrib(policy, "type"), "SHIELDS")) |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1491 break; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1492 policy = xmlnode_get_next_twin(policy); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1493 } |
20468
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1494 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1495 if (policy) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1496 GString *blocked = g_string_new(NULL); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1497 xmlnode *imtext = xmlnode_get_child(policy, |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1498 "config/block/regexp/imtext"); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1499 while (imtext) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1500 const char *value = xmlnode_get_attrib(imtext, "value"); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1501 g_string_append_printf(blocked, "%s<br/>\n", |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1502 purple_base64_decode(value, NULL)); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1503 imtext = xmlnode_get_next_twin(imtext); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1504 } |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1505 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1506 cmdproc->session->blocked_text = g_string_free(blocked, FALSE); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1507 } |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1508 |
20468
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1509 xmlnode_free(root); |
23527
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23521
diff
changeset
|
1510 #endif |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1511 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1512 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1513 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1514 gcf_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1515 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
1516 purple_debug_info("msn", "Processing GCF command\n"); |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1517 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1518 cmdproc->last_cmd->payload_cb = gcf_cmd_post; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1519 cmd->payload_len = atoi(cmd->params[1]); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1520 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1521 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1522 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1523 sbs_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1524 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
1525 purple_debug_info("msn", "Processing SBS... \n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1526 /*get the payload content*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1527 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1528 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1529 /* |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1530 * Get the UBX's PSM info |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1531 * Post it to the User status |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1532 * Thanks for Chris <ukdrizzle@yahoo.co.uk>'s code |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1533 */ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1534 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1535 ubx_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1536 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1537 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1538 MsnSession *session; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1539 PurpleAccount *account; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1540 MsnUser *user; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1541 const char *passport; |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1542 char *psm_str, *str; |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24505
diff
changeset
|
1543 CurrentMedia media = {CURRENT_MEDIA_UNKNOWN, NULL, NULL, NULL}; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1544 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1545 session = cmdproc->session; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1546 account = session->account; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1547 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1548 passport = cmd->params[0]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1549 user = msn_userlist_find_user(session->userlist, passport); |
23988
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1550 if (user == NULL) { |
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1551 char *str = g_strndup(payload, len); |
26196
399776a9ad98
Add some missing newlines in debug messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25954
diff
changeset
|
1552 purple_debug_info("msn", "unknown user %s, payload is %s\n", |
23988
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1553 passport, str); |
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1554 g_free(str); |
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1555 return; |
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1556 } |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1557 |
25460
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1558 if (len != 0) { |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1559 psm_str = msn_get_psm(cmd->payload,len); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1560 msn_user_set_statusline(user, psm_str); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1561 g_free(psm_str); |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1562 |
25460
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1563 str = msn_get_currentmedia(cmd->payload, len); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1564 if (msn_parse_currentmedia(str, &media)) |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1565 msn_user_set_currentmedia(user, &media); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1566 else |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1567 msn_user_set_currentmedia(user, NULL); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1568 g_free(media.title); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1569 g_free(media.album); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1570 g_free(media.artist); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1571 g_free(str); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1572 |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1573 } else { |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1574 msn_user_set_statusline(user, NULL); |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1575 msn_user_set_currentmedia(user, NULL); |
25460
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1576 } |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
16063
diff
changeset
|
1577 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1578 msn_user_update(user); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1579 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1580 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1581 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1582 ubx_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1583 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
1584 purple_debug_misc("msn", "UBX received.\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1585 cmdproc->last_cmd->payload_cb = ubx_cmd_post; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1586 cmd->payload_len = atoi(cmd->params[2]); |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1587 } |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1588 |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1589 static void |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1590 uux_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1591 size_t len) |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1592 { |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1593 /* Do Nothing, right now. */ |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1594 if (payload != NULL) |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1595 purple_debug_info("msn", "UUX payload:\n%s\n", payload); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1596 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1597 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1598 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1599 uux_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1600 { |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1601 purple_debug_misc("msn", "UUX received.\n"); |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1602 cmdproc->last_cmd->payload_cb = uux_cmd_post; |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1603 cmd->payload_len = atoi(cmd->params[1]); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1604 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1605 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1606 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1607 * Message Types |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1608 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1609 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1610 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1611 profile_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1612 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1613 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1614 const char *value; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1615 const char *clLastChange; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1616 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1617 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1618 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1619 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1620 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1621 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1622 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1623 if ((value = msn_message_get_attr(msg, "kv")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1624 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1625 g_free(session->passport_info.kv); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1626 session->passport_info.kv = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1627 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1628 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1629 if ((value = msn_message_get_attr(msg, "sid")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1630 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1631 g_free(session->passport_info.sid); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1632 session->passport_info.sid = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1633 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1634 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1635 if ((value = msn_message_get_attr(msg, "MSPAuth")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1636 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1637 g_free(session->passport_info.mspauth); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1638 session->passport_info.mspauth = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1639 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1640 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1641 if ((value = msn_message_get_attr(msg, "ClientIP")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1642 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1643 g_free(session->passport_info.client_ip); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1644 session->passport_info.client_ip = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1645 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1646 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1647 if ((value = msn_message_get_attr(msg, "ClientPort")) != NULL) |
20399
6f986caeab59
merge of 'b4911943cba6f29cf0694dfd563cac17612236dc'
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
1648 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1649 session->passport_info.client_port = ntohs(atoi(value)); |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
16063
diff
changeset
|
1650 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1651 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1652 if ((value = msn_message_get_attr(msg, "LoginTime")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1653 session->passport_info.sl = atol(value); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1654 |
23611
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23570
diff
changeset
|
1655 if ((value = msn_message_get_attr(msg, "EmailEnabled")) != NULL) |
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23570
diff
changeset
|
1656 session->passport_info.email_enabled = (gboolean)atol(value); |
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23570
diff
changeset
|
1657 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1658 /*starting retrieve the contact list*/ |
20440
5ecaa00090d7
Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <stu@nosnilmot.com>
parents:
20439
diff
changeset
|
1659 clLastChange = purple_account_get_string(session->account, "CLLastChange", NULL); |
5ecaa00090d7
Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <stu@nosnilmot.com>
parents:
20439
diff
changeset
|
1660 #ifdef MSN_PARTIAL_LISTS |
5ecaa00090d7
Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <stu@nosnilmot.com>
parents:
20439
diff
changeset
|
1661 /* msn_userlist_load defeats all attempts at trying to detect blist sync issues */ |
5ecaa00090d7
Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <stu@nosnilmot.com>
parents:
20439
diff
changeset
|
1662 msn_userlist_load(session); |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
1663 msn_get_contact_list(session, MSN_PS_INITIAL, clLastChange); |
20440
5ecaa00090d7
Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <stu@nosnilmot.com>
parents:
20439
diff
changeset
|
1664 #else |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1665 /* always get the full list? */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
1666 msn_get_contact_list(session, MSN_PS_INITIAL, NULL); |
20440
5ecaa00090d7
Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <stu@nosnilmot.com>
parents:
20439
diff
changeset
|
1667 #endif |
5ecaa00090d7
Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <stu@nosnilmot.com>
parents:
20439
diff
changeset
|
1668 #if 0 |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
1669 msn_contact_connect(session); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1670 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1671 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1672 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1673 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1674 initial_email_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1675 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1676 MsnSession *session; |
15822 | 1677 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1678 GHashTable *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1679 const char *unread; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1680 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1681 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1682 gc = session->account->gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1683 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1684 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1685 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1686 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1687 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1688 if (session->passport_info.mail_url == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1689 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1690 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1691 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1692 msn_transaction_queue_cmd(trans, msg->cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1693 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1694 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1695 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1696 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1697 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1698 |
15822 | 1699 if (!purple_account_get_check_mail(session->account)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1700 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1701 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1702 table = msn_message_get_hashtable_from_body(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1703 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1704 unread = g_hash_table_lookup(table, "Inbox-Unread"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1705 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1706 if (unread != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1707 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1708 int count = atoi(unread); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1709 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1710 if (count > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1711 { |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
1712 const char *passports[2] = { msn_user_get_passport(session->user) }; |
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
1713 const char *urls[2] = { session->passport_info.mail_url }; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1714 |
21767
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21672
diff
changeset
|
1715 purple_notify_emails(gc, count, FALSE, NULL, NULL, |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
1716 passports, urls, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1717 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1718 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1719 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1720 g_hash_table_destroy(table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1721 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1722 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1723 /*offline Message notification process*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1724 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1725 initial_mdata_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1726 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1727 MsnSession *session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1728 PurpleConnection *gc; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1729 GHashTable *table; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1730 const char *mdata, *unread; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1731 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1732 session = cmdproc->session; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1733 gc = session->account->gc; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1734 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1735 if (strcmp(msg->remote_user, "Hotmail")) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1736 /* This isn't an official message. */ |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1737 return; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1738 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1739 table = msn_message_get_hashtable_from_body(msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1740 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1741 mdata = g_hash_table_lookup(table, "Mail-Data"); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1742 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1743 if (mdata != NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1744 msn_parse_oim_msg(session->oim, mdata); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1745 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1746 if (g_hash_table_lookup(table, "Inbox-URL") == NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1747 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1748 g_hash_table_destroy(table); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1749 return; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1750 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1751 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1752 if (session->passport_info.mail_url == NULL) |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1753 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1754 MsnTransaction *trans; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1755 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1756 msn_transaction_queue_cmd(trans, msg->cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1757 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1758 msn_cmdproc_send_trans(cmdproc, trans); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1759 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1760 g_hash_table_destroy(table); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1761 return; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1762 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1763 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1764 if (!purple_account_get_check_mail(session->account)) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1765 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1766 g_hash_table_destroy(table); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1767 return; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1768 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1769 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1770 unread = g_hash_table_lookup(table, "Inbox-Unread"); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1771 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1772 if (unread != NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1773 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1774 int count = atoi(unread); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1775 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1776 if (count > 0) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1777 { |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
1778 const char *passports[2] = { msn_user_get_passport(session->user) }; |
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
1779 const char *urls[2] = { session->passport_info.mail_url }; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1780 |
21767
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21672
diff
changeset
|
1781 purple_notify_emails(gc, count, FALSE, NULL, NULL, |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
1782 passports, urls, NULL, NULL); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1783 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1784 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1785 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1786 g_hash_table_destroy(table); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1787 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1788 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1789 /*offline Message Notification*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1790 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1791 delete_oim_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1792 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
1793 purple_debug_misc("msn", "Delete OIM message.\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1794 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1795 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1796 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1797 email_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1798 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1799 MsnSession *session; |
15822 | 1800 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1801 GHashTable *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1802 char *from, *subject, *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1803 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1804 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1805 gc = session->account->gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1806 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1807 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1808 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1809 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1810 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1811 if (session->passport_info.mail_url == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1812 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1813 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1814 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1815 msn_transaction_queue_cmd(trans, msg->cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1816 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1817 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1818 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1819 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1820 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1821 |
15822 | 1822 if (!purple_account_get_check_mail(session->account)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1823 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1824 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1825 table = msn_message_get_hashtable_from_body(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1826 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1827 from = subject = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1828 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1829 tmp = g_hash_table_lookup(table, "From"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1830 if (tmp != NULL) |
15822 | 1831 from = purple_mime_decode_field(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1832 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1833 tmp = g_hash_table_lookup(table, "Subject"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1834 if (tmp != NULL) |
15822 | 1835 subject = purple_mime_decode_field(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1836 |
15822 | 1837 purple_notify_email(gc, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1838 (subject != NULL ? subject : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1839 (from != NULL ? from : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1840 msn_user_get_passport(session->user), |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1841 session->passport_info.mail_url, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1842 |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1843 g_free(from); |
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1844 g_free(subject); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1846 g_hash_table_destroy(table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1847 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1848 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1849 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 system_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1851 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1852 GHashTable *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1853 const char *type_s; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1854 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1855 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1856 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1857 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1858 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1859 table = msn_message_get_hashtable_from_body(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1861 if ((type_s = g_hash_table_lookup(table, "Type")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1862 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1863 int type = atoi(type_s); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1864 char buf[MSN_BUF_LEN]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1865 int minutes; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1866 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1867 switch (type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1868 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1869 case 1: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1870 minutes = atoi(g_hash_table_lookup(table, "Arg1")); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1871 g_snprintf(buf, sizeof(buf), dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1872 "The MSN server will shut down for maintenance " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1873 "in %d minute. You will automatically be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1874 "signed out at that time. Please finish any " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1875 "conversations in progress.\n\nAfter the " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1876 "maintenance has been completed, you will be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1877 "able to successfully sign in.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1878 "The MSN server will shut down for maintenance " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1879 "in %d minutes. You will automatically be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1880 "signed out at that time. Please finish any " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 "conversations in progress.\n\nAfter the " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1882 "maintenance has been completed, you will be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1883 "able to successfully sign in.", minutes), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1884 minutes); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1885 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1886 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1887 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1888 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1889 if (*buf != '\0') |
15822 | 1890 purple_notify_info(cmdproc->session->account->gc, NULL, buf, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1891 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1892 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1893 g_hash_table_destroy(table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1894 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1895 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1896 /************************************************************************** |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1897 * Dispatch server list management |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1898 **************************************************************************/ |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1899 typedef struct MsnAddRemoveListData { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1900 MsnCmdProc *cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1901 MsnUser *user; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1902 MsnListOp list_op; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1903 gboolean add; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1904 } MsnAddRemoveListData; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1905 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1906 static void |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1907 modify_unknown_buddy_on_list(MsnSession *session, const char *passport, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1908 MsnNetwork network, gpointer data) |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1909 { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1910 MsnAddRemoveListData *addrem = data; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1911 MsnCmdProc *cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1912 xmlnode *node; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1913 char *payload; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1914 int payload_len; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1915 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1916 cmdproc = addrem->cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1917 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1918 /* Update user first */ |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1919 msn_user_set_network(addrem->user, network); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1920 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1921 node = xmlnode_new("ml"); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1922 node->child = NULL; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1923 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1924 msn_add_contact_xml(session, node, passport, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1925 addrem->list_op, network); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1926 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1927 payload = xmlnode_to_str(node, &payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1928 xmlnode_free(node); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1929 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1930 if (addrem->add) |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1931 msn_notification_post_adl(cmdproc, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1932 else |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1933 msn_notification_post_rml(cmdproc, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1934 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1935 g_free(payload); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1936 g_free(addrem); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1937 } |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1938 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1939 void |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
1940 msn_notification_add_buddy_to_list(MsnNotification *notification, MsnListId list_id, |
24720
d6de4f9de12d
Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24518
diff
changeset
|
1941 MsnUser *user) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 { |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1943 MsnAddRemoveListData *addrem; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1944 MsnCmdProc *cmdproc; |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
1945 MsnListOp list_op = 1 << list_id; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1946 xmlnode *adl_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1947 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1948 int payload_len; |
20488 | 1949 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 cmdproc = notification->servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1951 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1952 adl_node = xmlnode_new("ml"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1953 adl_node->child = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1954 |
24720
d6de4f9de12d
Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24518
diff
changeset
|
1955 msn_add_contact_xml(notification->session, adl_node, user->passport, |
d6de4f9de12d
Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24518
diff
changeset
|
1956 list_op, user->networkid); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1957 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1958 payload = xmlnode_to_str(adl_node, &payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1959 xmlnode_free(adl_node); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1960 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1961 if (user->networkid != MSN_NETWORK_UNKNOWN) { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1962 msn_notification_post_adl(cmdproc, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1963 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1964 } else { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1965 addrem = g_new(MsnAddRemoveListData, 1); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1966 addrem->cmdproc = cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1967 addrem->user = user; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1968 addrem->list_op = list_op; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1969 addrem->add = TRUE; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1970 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1971 msn_notification_send_fqy(notification->session, payload, payload_len, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1972 modify_unknown_buddy_on_list, addrem); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1973 } |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1974 |
20504
d23c3a5884ee
Make the buddylist sync issue a little less worse.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20495
diff
changeset
|
1975 g_free(payload); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1976 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1977 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1978 void |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
1979 msn_notification_rem_buddy_from_list(MsnNotification *notification, MsnListId list_id, |
24720
d6de4f9de12d
Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24518
diff
changeset
|
1980 MsnUser *user) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1981 { |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
1982 MsnAddRemoveListData *addrem; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1983 MsnCmdProc *cmdproc; |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
1984 MsnListOp list_op = 1 << list_id; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1985 xmlnode *rml_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1986 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1987 int payload_len; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1988 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1989 cmdproc = notification->servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1990 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1991 rml_node = xmlnode_new("ml"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1992 rml_node->child = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1993 |
24720
d6de4f9de12d
Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24518
diff
changeset
|
1994 msn_add_contact_xml(notification->session, rml_node, user->passport, |
d6de4f9de12d
Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24518
diff
changeset
|
1995 list_op, user->networkid); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1996 |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
1997 payload = xmlnode_to_str(rml_node, &payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1998 xmlnode_free(rml_node); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1999 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2000 if (user->networkid != MSN_NETWORK_UNKNOWN) { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2001 msn_notification_post_rml(cmdproc, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2002 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2003 } else { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2004 addrem = g_new(MsnAddRemoveListData, 1); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2005 addrem->cmdproc = cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2006 addrem->user = user; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2007 addrem->list_op = list_op; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2008 addrem->add = FALSE; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2009 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2010 msn_notification_send_fqy(notification->session, payload, payload_len, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2011 modify_unknown_buddy_on_list, addrem); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2012 } |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2013 |
20504
d23c3a5884ee
Make the buddylist sync issue a little less worse.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20495
diff
changeset
|
2014 g_free(payload); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2015 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2016 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2017 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2018 * Init |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2019 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2020 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2021 msn_notification_init(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2022 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2023 cbs_table = msn_table_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2024 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2025 /* Synchronous */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2026 msn_table_add_cmd(cbs_table, "CHG", "CHG", NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2027 msn_table_add_cmd(cbs_table, "CHG", "ILN", iln_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2028 msn_table_add_cmd(cbs_table, "ADL", "ILN", iln_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2029 msn_table_add_cmd(cbs_table, "USR", "USR", usr_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2030 msn_table_add_cmd(cbs_table, "USR", "XFR", xfr_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2031 msn_table_add_cmd(cbs_table, "USR", "GCF", gcf_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2032 msn_table_add_cmd(cbs_table, "CVR", "CVR", cvr_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2033 msn_table_add_cmd(cbs_table, "VER", "VER", ver_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2034 msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2035 msn_table_add_cmd(cbs_table, "BLP", "BLP", blp_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2036 msn_table_add_cmd(cbs_table, "XFR", "XFR", xfr_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2037 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2038 /* Asynchronous */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2039 msn_table_add_cmd(cbs_table, NULL, "IPG", ipg_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2040 msn_table_add_cmd(cbs_table, NULL, "MSG", msg_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2041 msn_table_add_cmd(cbs_table, NULL, "UBM", ubm_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2042 msn_table_add_cmd(cbs_table, NULL, "GCF", gcf_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2043 msn_table_add_cmd(cbs_table, NULL, "SBS", sbs_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2044 msn_table_add_cmd(cbs_table, NULL, "NOT", not_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2045 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2046 msn_table_add_cmd(cbs_table, NULL, "CHL", chl_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2047 msn_table_add_cmd(cbs_table, NULL, "RML", rml_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2048 msn_table_add_cmd(cbs_table, NULL, "ADL", adl_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2049 msn_table_add_cmd(cbs_table, NULL, "FQY", fqy_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2050 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2051 msn_table_add_cmd(cbs_table, NULL, "QRY", NULL); |
17128
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
2052 msn_table_add_cmd(cbs_table, NULL, "QNG", qng_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2053 msn_table_add_cmd(cbs_table, NULL, "FLN", fln_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2054 msn_table_add_cmd(cbs_table, NULL, "NLN", nln_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2055 msn_table_add_cmd(cbs_table, NULL, "ILN", iln_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2056 msn_table_add_cmd(cbs_table, NULL, "OUT", out_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2057 msn_table_add_cmd(cbs_table, NULL, "RNG", rng_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2058 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2059 msn_table_add_cmd(cbs_table, NULL, "UBX", ubx_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2060 msn_table_add_cmd(cbs_table, NULL, "UUX", uux_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2061 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2062 msn_table_add_cmd(cbs_table, NULL, "URL", url_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2063 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2064 msn_table_add_cmd(cbs_table, "fallback", "XFR", xfr_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2065 |
24128
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
2066 msn_table_add_cmd(cbs_table, NULL, "241", adl_241_error_cmd); |
f5923e2e6513
Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24127
diff
changeset
|
2067 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2068 msn_table_add_error(cbs_table, "ADL", adl_error); |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
2069 msn_table_add_error(cbs_table, "FQY", fqy_error); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2070 msn_table_add_error(cbs_table, "USR", usr_error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2071 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2072 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2073 "text/x-msmsgsprofile", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2074 profile_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2075 /*initial OIM notification*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2076 msn_table_add_msg_type(cbs_table, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2077 "text/x-msmsgsinitialmdatanotification", |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
2078 initial_mdata_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2079 /*OIM notification when user online*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2080 msn_table_add_msg_type(cbs_table, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2081 "text/x-msmsgsoimnotification", |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
2082 initial_mdata_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2083 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2084 "text/x-msmsgsinitialemailnotification", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2085 initial_email_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2086 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2087 "text/x-msmsgsemailnotification", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2088 email_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2089 /*delete an offline Message notification*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2090 msn_table_add_msg_type(cbs_table, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2091 "text/x-msmsgsactivemailnotification", |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2092 delete_oim_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2093 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2094 "application/x-msmsgssystemmessage", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2095 system_msg); |
25400
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2096 /* generic message handlers */ |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2097 msn_table_add_msg_type(cbs_table, "text/plain", |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2098 msn_plain_msg); |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2099 msn_table_add_msg_type(cbs_table, "text/x-msmsgscontrol", |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2100 msn_control_msg); |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2101 msn_table_add_msg_type(cbs_table, "text/x-msnmsgr-datacast", |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2102 msn_datacast_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2103 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2104 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2105 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2106 msn_notification_end(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2107 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2108 msn_table_destroy(cbs_table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2109 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2110 |