Mercurial > pidgin
annotate libpurple/protocols/msn/notification.c @ 23936:54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
monitoring software inserts these, even though it's invalid on MSNP15.
Also, quit processing the ILN command if the user is not known to us.
Fixes #6656.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Thu, 21 Aug 2008 06:40:00 +0000 |
parents | 2457162f6750 |
children | b8d38a11f9c6 |
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 * Util |
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 static void |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
156 group_error_helper(MsnSession *session, const char *msg, const char *group_id, int error) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 { |
15822 | 158 PurpleAccount *account; |
159 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 char *reason = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 char *title = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 account = session->account; |
15822 | 164 gc = purple_account_get_connection(account); |
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 if (error == 224) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 if (group_id == 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 return; |
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 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 const char *group_name; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
175 group_name = msn_userlist_find_group_name(session->userlist,group_id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 reason = g_strdup_printf(_("%s is not a valid group."), |
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
|
177 group_name ? group_name : ""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
178 } |
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 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 reason = g_strdup(_("Unknown error.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 title = g_strdup_printf(_("%s on %s (%s)"), msg, |
15822 | 186 purple_account_get_username(account), |
187 purple_account_get_protocol_name(account)); | |
188 purple_notify_error(gc, NULL, title, reason); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 g_free(reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 * Login |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 void |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
198 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
|
199 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 MsnCmdProc *cmdproc; |
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 cmdproc = session->notification->cmdproc; |
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 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
|
205 |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
206 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
|
207 } |
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 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 cvr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 { |
15822 | 212 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 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
|
215 |
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
216 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
|
217 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 usr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 MsnSession *session; |
15822 | 223 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 account = session->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 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
|
229 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
230 /* authenticate OK */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 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
|
232 } |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
233 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
|
234 { |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
235 /* RPS authentication */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 session->nexus = msn_nexus_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
239 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
|
240 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
|
241 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 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
|
243 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 msn_nexus_connect(session->nexus); |
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 } |
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 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 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
|
250 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 MsnErrorType msnerr = 0; |
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 switch (error) |
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 case 500: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 case 601: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 case 910: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 case 921: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 msnerr = MSN_ERROR_SERV_UNAVAILABLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 case 911: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 msnerr = MSN_ERROR_AUTH; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 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
|
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 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 ver_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
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 MsnSession *session; |
15822 | 276 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 gboolean protocol_supported = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 char proto_str[8]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 size_t i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 account = session->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 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
|
285 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 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
|
287 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 if (!strcmp(cmd->params[i], proto_str)) |
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 protocol_supported = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 } |
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 if (!protocol_supported) |
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_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
|
298 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 return; |
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 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
302 /* |
23464
1ac5faa72c8d
explicit merge of '9d90ebdb7e38fdd77bb504bc3302a083616360d9'
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
303 * Windows Live Messenger 8.5 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
304 * Notice :CVR String discriminate! |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
305 * 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
|
306 * to see the Local ID |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
307 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 msn_cmdproc_send(cmdproc, "CVR", |
23452
b268fc2c9121
References #4382, fixes getting offline messages in p15
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23444
diff
changeset
|
309 "0x0409 winnt 5.1 i386 MSNMSGR 8.5.1288 msmsgs %s", |
15822 | 310 purple_account_get_username(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
312 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
314 * Log out |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 **************************************************************************/ |
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 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 out_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 { |
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
|
320 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
|
321 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
|
322 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
|
323 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
|
324 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 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
|
326 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
|
327 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
330 msn_notification_close(MsnNotification *notification) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 g_return_if_fail(notification != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 if (!notification->in_use) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 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
|
338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 msn_notification_disconnect(notification); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 * Messages |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
346 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 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
|
348 size_t len) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
350 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 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
|
353 |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
354 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
|
355 #ifdef MSN_DEBUG_NS |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 msn_message_show_readable(msg, "Notification", TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 msn_cmdproc_process_msg(cmdproc, msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 msn_message_destroy(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
362 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
363 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
364 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 msg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 { |
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
|
367 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
|
368 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
369 /* 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
|
370 * 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
|
371 if (cmd->payload == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
372 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
|
373 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
|
374 |
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
375 } else { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 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
|
377 |
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
|
378 #if 0 /* glib on win32 doesn't correctly support precision modifiers for a string */ |
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
|
379 purple_debug_info("msn", "MSG payload:{%.*s}\n", 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
|
380 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
381 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
|
382 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
383 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
384 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
385 /*send Message to Yahoo Messenger*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
386 void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
387 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
|
388 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
389 MsnCmdProc *cmdproc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
390 MsnTransaction *trans; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
391 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
392 gsize payload_len; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
393 int type; |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
394 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
395 cmdproc = session->notification->cmdproc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
396 g_return_if_fail(msg != NULL); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
397 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
|
398 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
|
399 "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
|
400 payload, strlen(payload), payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
401 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
|
402 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
|
403 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
|
404 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
|
405 msn_cmdproc_send_trans(cmdproc, trans); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
406 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
407 |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
408 #if 0 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
409 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
410 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
|
411 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
412 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
413 MsnMessage *msg; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
414 PurpleConnection *gc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
415 const char *passport; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
416 const char *content_type; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
417 |
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
|
418 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
|
419 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
|
420 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
421 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
|
422 #ifdef MSN_DEBUG_NS |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
423 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
|
424 #endif |
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 gc = cmdproc->session->account->gc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
427 passport = msg->remote_user; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
428 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
429 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
|
430 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
|
431 if(!strcmp(content_type,"text/plain")){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
432 const char *value; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
433 const char *body; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
434 char *body_enc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
435 char *body_final = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
436 size_t body_len; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
437 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
438 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
|
439 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
|
440 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
441 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
|
442 char *pre, *post; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
443 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
444 msn_parse_format(value, &pre, &post); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
445 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
|
446 body_enc ? body_enc : "", post ? post : ""); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
447 g_free(pre); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
448 g_free(post); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
449 } |
20494
82d8797e06f3
Plug memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20488
diff
changeset
|
450 g_free(body_enc); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
451 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
|
452 g_free(body_final); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
453 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
454 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
|
455 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
|
456 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
|
457 PURPLE_TYPING); |
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 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
460 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
|
461 char *username, *str; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
462 PurpleAccount *account; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
463 PurpleBuddy *buddy; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
464 const char *user; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
465 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
466 account = cmdproc->session->account; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
467 user = msg->remote_user; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
468 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
469 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
|
470 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
|
471 }else{ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
472 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
|
473 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
474 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
475 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
|
476 g_free(username); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
477 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
|
478 g_free(str); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
479 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
480 msn_message_destroy(msg); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
481 } |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
482 #endif |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
483 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
484 /*Yahoo msg process*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
485 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
486 ubm_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
487 { |
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
|
488 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
|
489 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
490 /* 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
|
491 * 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
|
492 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
|
493 cmdproc->last_cmd->payload_cb = msg_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
|
494 cmd->payload_len = atoi(cmd->params[4]); |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
495 } else { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
496 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
|
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", "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
|
499 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
|
500 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
501 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
502 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 * Challenges |
20425
5048651671e1
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents:
20422
diff
changeset
|
505 * 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
|
506 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 chl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
511 char buf[33]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
513 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
|
514 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
|
515 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 msn_transaction_set_payload(trans, buf, 32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 * Buddy Lists |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 **************************************************************************/ |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
524 /* 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
|
525 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
|
526 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
|
527 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
528 xmlnode *d_node,*c_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
529 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
|
530 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
|
531 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
|
532 |
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
|
533 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
|
534 |
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
|
535 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
|
536 tokens = g_strsplit(passport, "@", 2); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
537 email = tokens[0]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
538 domain = tokens[1]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
539 |
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
|
540 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
|
541 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
|
542 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
|
543 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
|
544 } |
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
|
545 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
546 /*find a domain Node*/ |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
547 for(d_node = xmlnode_get_child(mlNode,"d"); d_node; d_node = xmlnode_get_next_twin(d_node)) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
548 { |
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
|
549 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
|
550 if (attr == NULL) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
551 continue; |
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
|
552 if (!strcmp(attr,domain)) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
553 break; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
554 } |
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
|
555 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
556 if(d_node == NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
557 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
558 /*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
|
559 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
|
560 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
|
561 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
|
562 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
|
563 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
564 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
565 /*create contact node*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
566 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
|
567 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
|
568 |
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
|
569 purple_debug_info("msn", "list_op: %d\n", list_op); |
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
|
570 g_snprintf(fmt_str, sizeof(fmt_str), "%d", list_op); |
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
|
571 xmlnode_set_attrib(c_node, "l", fmt_str); |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
572 |
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
|
573 if (networkId != MSN_NETWORK_UNKNOWN) |
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
|
574 g_snprintf(fmt_str, sizeof(fmt_str), "%d", networkId); |
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
|
575 else if (msn_user_is_yahoo(session->account, passport)) |
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
|
576 g_snprintf(fmt_str, sizeof(fmt_str), "%d", MSN_NETWORK_YAHOO); |
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
|
577 else |
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
|
578 g_snprintf(fmt_str, sizeof(fmt_str), "%d", MSN_NETWORK_PASSPORT); |
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
|
579 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
580 /*mobile*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
581 //type_str = g_strdup_printf("4"); |
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
|
582 xmlnode_set_attrib(c_node, "t", fmt_str); |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
583 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
584 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
|
585 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
586 g_strfreev(tokens); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
587 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
589 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
|
590 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
|
591 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
592 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
|
593 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
|
594 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
|
595 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
|
596 msn_cmdproc_send_trans(cmdproc, trans); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
597 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
598 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
599 /*dump contact info to NS*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
600 void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
601 msn_notification_dump_contact(MsnSession *session) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
602 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 MsnUser *user; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
604 GList *l; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
605 xmlnode *adl_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
606 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
607 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
|
608 int adl_count = 0; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
609 const char *display_name; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
610 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
611 adl_node = xmlnode_new("ml"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
612 adl_node->child = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
613 xmlnode_set_attrib(adl_node, "l", "1"); |
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
|
614 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
615 /*get the userlist*/ |
23935
2457162f6750
Apparently messenger@microsoft.com is some sort of server-side buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23892
diff
changeset
|
616 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
|
617 user = l->data; |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
618 |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
619 /* 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
|
620 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
|
621 continue; |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
622 |
23935
2457162f6750
Apparently messenger@microsoft.com is some sort of server-side buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23892
diff
changeset
|
623 if (!strcmp(user->passport, "messenger@microsoft.com")) |
2457162f6750
Apparently messenger@microsoft.com is some sort of server-side buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23892
diff
changeset
|
624 continue; |
2457162f6750
Apparently messenger@microsoft.com is some sort of server-side buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23892
diff
changeset
|
625 |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
626 msn_add_contact_xml(session, adl_node, user->passport, |
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
|
627 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
|
628 |
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
|
629 /* each ADL command may contain up to 150 contacts */ |
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
|
630 if (++adl_count % 150 == 0 || l->next == 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
|
631 payload = xmlnode_to_str(adl_node,&payload_len); |
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
|
632 |
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
|
633 msn_notification_post_adl(session->notification->cmdproc, |
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
|
634 payload, payload_len); |
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
|
635 |
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
|
636 g_free(payload); |
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
|
637 xmlnode_free(adl_node); |
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
|
638 |
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
|
639 if (l->next) { |
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
|
640 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
|
641 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
|
642 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
|
643 } |
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
|
644 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
645 } |
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
|
646 |
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
|
647 if (adl_count == 0) { |
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
|
648 payload = xmlnode_to_str(adl_node,&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
|
649 |
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
|
650 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
|
651 |
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
|
652 g_free(payload); |
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
|
653 xmlnode_free(adl_node); |
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
|
654 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
655 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
656 display_name = purple_connection_get_display_name(session->account->gc); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
657 if (display_name |
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
658 && 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
|
659 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
|
660 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
|
661 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
662 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
663 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
664 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
665 /*Post FQY to NS,Inform add a Yahoo User*/ |
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
|
666 void |
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
|
667 msn_notification_send_fqy(MsnSession *session, const char *passport) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
668 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
669 MsnTransaction *trans; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
670 MsnCmdProc *cmdproc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
671 char* email,*domain,*payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
672 char **tokens; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
673 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
674 cmdproc = session->notification->cmdproc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
676 tokens = g_strsplit(passport, "@", 2); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
677 email = tokens[0]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
678 domain = tokens[1]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
679 |
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
|
680 payload = g_strdup_printf("<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>", domain, email); |
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
|
681 trans = msn_transaction_new(cmdproc, "FQY","%" G_GSIZE_FORMAT, strlen(payload)); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
682 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
|
683 msn_cmdproc_send_trans(cmdproc, trans); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
684 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
685 g_free(payload); |
20935
1d9d5de48b9e
Fix some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20857
diff
changeset
|
686 g_strfreev(tokens); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
687 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
688 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
689 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
690 blp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
691 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
692 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
693 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
694 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
|
695 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
|
696 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
|
697 { |
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
|
698 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
|
699 |
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
|
700 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
|
701 |
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
|
702 g_return_if_fail(payload != NULL); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
703 |
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
|
704 root = xmlnode_from_str(payload, (gssize) len); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
705 |
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
|
706 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
|
707 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
|
708 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
|
709 } |
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
|
710 for (domain_node = xmlnode_get_child(root, "d"); domain_node; domain_node = xmlnode_get_next_twin(domain_node)) { |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
711 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
|
712 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
|
713 |
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
|
714 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
|
715 |
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
|
716 for (contact_node = xmlnode_get_child(domain_node, "c"); contact_node; contact_node = xmlnode_get_next_twin(contact_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
|
717 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
|
718 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
|
719 |
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
|
720 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
|
721 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
|
722 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
|
723 } |
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
|
724 |
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
|
725 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
|
726 /* someone is adding us */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
727 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
|
728 } |
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
|
729 } |
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
|
730 } |
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
|
731 |
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
|
732 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
|
733 } |
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
|
734 |
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
|
735 static void |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
736 adl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
737 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
738 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 |
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
|
740 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
|
741 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
|
742 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
|
743 g_return_if_fail(cmd != NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
744 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
745 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
746 |
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
|
747 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
|
748 /* ADL ack */ |
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
|
749 msn_session_finish_login(session); |
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
|
750 } 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
|
751 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
|
752 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
|
753 } |
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
|
754 |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
755 return; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
756 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
757 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
758 static void |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
759 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
|
760 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
761 MsnSession *session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
762 PurpleAccount *account; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
763 PurpleConnection *gc; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
764 char *reason = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
765 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
766 session = cmdproc->session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
767 account = session->account; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
768 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 |
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
|
770 purple_debug_error("msn", "ADL error\n"); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
771 reason = g_strdup_printf(_("Unknown error (%d)"), error); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
772 purple_notify_error(gc, NULL, _("Unable to add user"), reason); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
773 g_free(reason); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
774 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
775 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
776 static void |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
777 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
|
778 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
779 { |
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
|
780 purple_debug_info("msn", "FQY payload:\n%s\n", payload); |
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
|
781 g_return_if_fail(cmdproc->session != NULL); |
23521
a0e957b7b923
Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23520
diff
changeset
|
782 /* msn_notification_post_adl(cmdproc, payload, len); */ |
a0e957b7b923
Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23520
diff
changeset
|
783 /* msn_get_address_book(cmdproc->session, MSN_AB_SAVE_CONTACT, NULL, NULL); */ |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
784 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
786 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
787 fqy_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
788 { |
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
|
789 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
|
790 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
|
791 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
|
792 } |
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
|
793 |
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
|
794 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
|
795 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
|
796 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
|
797 { |
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
|
798 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
|
799 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
|
800 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
801 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
802 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
803 rml_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
804 { |
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
|
805 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
|
806 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
|
807 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
|
808 } |
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 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
811 add_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
812 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
813 MsnSession *session; |
15822 | 814 PurpleAccount *account; |
815 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
816 const char *list, *passport; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
817 char *reason = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
818 char *msg = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
819 char **params; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
821 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
822 account = session->account; |
15822 | 823 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
824 params = g_strsplit(trans->params, " ", 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
825 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 list = params[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
827 passport = params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
828 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 if (!strcmp(list, "FL")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
830 msg = g_strdup_printf(_("Unable to add user on %s (%s)"), |
15822 | 831 purple_account_get_username(account), |
832 purple_account_get_protocol_name(account)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
833 else if (!strcmp(list, "BL")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 msg = g_strdup_printf(_("Unable to block user on %s (%s)"), |
15822 | 835 purple_account_get_username(account), |
836 purple_account_get_protocol_name(account)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 else if (!strcmp(list, "AL")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 msg = g_strdup_printf(_("Unable to permit user on %s (%s)"), |
15822 | 839 purple_account_get_username(account), |
840 purple_account_get_protocol_name(account)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
841 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
842 if (!strcmp(list, "FL")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 if (error == 210) |
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 reason = g_strdup_printf(_("%s could not be added because " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
847 "your buddy list is full."), passport); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
849 } |
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 if (reason == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
853 if (error == 208) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 reason = g_strdup_printf(_("%s is not a valid passport account."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 passport); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
858 else if (error == 500) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 reason = g_strdup(_("Service Temporarily Unavailable.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
861 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
862 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 reason = g_strdup(_("Unknown error.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
865 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
867 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 if (msg != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 { |
15822 | 870 purple_notify_error(gc, NULL, msg, reason); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 if (!strcmp(list, "FL")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 { |
15822 | 876 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 |
15822 | 878 buddy = purple_find_buddy(account, passport); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
880 if (buddy != NULL) |
15822 | 881 purple_blist_remove_buddy(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
882 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
883 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 g_free(reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
885 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
886 g_strfreev(params); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
887 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
888 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
889 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
890 adg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
891 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
892 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 gint group_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 const char *group_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
897 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
898 group_id = atoi(cmd->params[3]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 |
15822 | 900 group_name = purple_url_decode(cmd->params[2]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
901 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
902 msn_group_new(session->userlist, cmd->params[3], group_name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 |
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
|
904 /* There is a user that must be moved to this group */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
905 if (cmd->trans->data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 /* msn_userlist_move_buddy(); */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 MsnUserList *userlist = cmdproc->session->userlist; |
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
|
909 MsnCallbackState *data = cmd->trans->data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
910 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
911 if (data->old_group_name != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 { |
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
|
913 msn_userlist_move_buddy(userlist, data->who, data->old_group_name, group_name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 g_free(data->old_group_name); |
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
|
915 } else { |
23521
a0e957b7b923
Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23520
diff
changeset
|
916 /* msn_add_contact_to_group(userlist, data, data->who, group_name); */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
921 static void |
17128
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
922 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
|
923 { |
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
|
924 /* 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
|
925 } |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
926 |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
927 |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
928 static void |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
929 fln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
931 MsnSlpLink *slplink; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 |
23305
27f7fae4a361
Add a few bits of documentation
Mark Doliner <mark@kingant.net>
parents:
23301
diff
changeset
|
934 /* 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
|
935 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
|
936 msn_user_set_state(user, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
937 msn_user_update(user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 |
23305
27f7fae4a361
Add a few bits of documentation
Mark Doliner <mark@kingant.net>
parents:
23301
diff
changeset
|
939 /* 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
|
940 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
|
941 if (slplink != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 msn_slplink_destroy(slplink); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
949 MsnSession *session; |
15822 | 950 PurpleAccount *account; |
951 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
952 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
|
953 MsnObject *msnobj = NULL; |
22570
1168dc635ac1
some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents:
22536
diff
changeset
|
954 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
|
955 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
|
956 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
|
957 char *friendly; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
958 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
959 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
960 account = session->account; |
15822 | 961 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
962 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
963 state = cmd->params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
964 passport = cmd->params[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
965 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 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
|
967 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
|
968 /* 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
|
969 return; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
970 |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
971 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
|
972 /* 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
|
973 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
|
974 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
|
975 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
|
976 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
|
977 } 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
|
978 /* 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
|
979 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
|
980 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
|
981 /* 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
|
982 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
|
983 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
|
984 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
|
985 } else { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
986 /* 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
|
987 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
|
988 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
|
989 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
|
990 } |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
991 } 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
|
992 /* 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
|
993 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
|
994 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
|
995 } else { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
996 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
|
997 return; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
998 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
999 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1000 serv_got_alias(gc, passport, friendly); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1001 msn_user_set_friendly_name(user, friendly); |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1002 g_free(friendly); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1003 |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1004 msn_user_set_object(user, msnobj); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1005 |
22570
1168dc635ac1
some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents:
22536
diff
changeset
|
1006 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
|
1007 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
|
1008 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
|
1009 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1010 msn_user_set_state(user, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1011 msn_user_update(user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1012 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1013 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1014 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 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
|
1016 { |
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
|
1017 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
|
1018 MsnUserList *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
|
1019 char *who = NULL, *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
|
1020 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
|
1021 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
|
1022 |
15822 | 1023 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
|
1024 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1025 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
|
1026 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
|
1027 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1028 /* 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
|
1029 <?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
|
1030 <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
|
1031 <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
|
1032 <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
|
1033 </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
|
1034 <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
|
1035 <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
|
1036 <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
|
1037 <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
|
1038 <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
|
1039 <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
|
1040 <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
|
1041 </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
|
1042 </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
|
1043 </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
|
1044 */ |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1045 |
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
|
1046 /* 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
|
1047 <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
|
1048 <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
|
1049 <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
|
1050 </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
|
1051 <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
|
1052 <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
|
1053 <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
|
1054 <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
|
1055 <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
|
1056 <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
|
1057 <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
|
1058 </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
|
1059 </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
|
1060 </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
|
1061 */ |
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
|
1062 |
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
|
1063 if (!(payloadNode = xmlnode_from_str(payload, len)) || |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1064 !(from = xmlnode_get_child(payloadNode, "FROM")) || |
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
|
1065 !(msg = xmlnode_get_child(payloadNode, "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
|
1066 !(textNode = xmlnode_get_child(msg, "BODY/TEXT"))) |
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
|
1067 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
|
1068 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1069 who = g_strdup(xmlnode_get_attrib(from, "name")); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1070 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
|
1071 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1072 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
|
1073 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1074 /* 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
|
1075 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
|
1076 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
|
1077 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
|
1078 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
|
1079 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1080 if(user && user->passport) { |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1081 g_free(who); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1082 who = g_strdup(user->passport); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1083 } |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1084 } |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1085 |
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
|
1086 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
|
1087 |
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
|
1088 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
|
1089 /* 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
|
1090 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
|
1091 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
|
1092 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
|
1093 */ |
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
|
1094 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
|
1095 _("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
|
1096 |
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
|
1097 } 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
|
1098 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
|
1099 } |
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
|
1100 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1101 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
|
1102 g_free(who); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1103 xmlnode_free(payloadNode); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1104 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1105 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1106 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1107 ipg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1108 { |
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
|
1109 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
|
1110 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
|
1111 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1112 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1113 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1114 nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1115 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1116 MsnSession *session; |
15822 | 1117 PurpleAccount *account; |
1118 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1119 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1120 MsnObject *msnobj; |
22346
382bc33e8824
Patch from Jorge Villase«Ðor, treat the client id as unsigned so 0x80000000
Ka-Hing Cheung <khc@hxbc.us>
parents:
21790
diff
changeset
|
1121 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
|
1122 int networkid; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1123 const char *state, *passport, *friendly, *old_friendly; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1124 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1125 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1126 account = session->account; |
15822 | 1127 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1128 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1129 state = cmd->params[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1130 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
|
1131 networkid = atoi(cmd->params[2]); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1132 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
|
1133 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1134 user = msn_userlist_find_user(session->userlist, passport); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1135 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1136 old_friendly = msn_user_get_friendly_name(user); |
18550
925ba3e6831c
cmd->params[2] could be NULL, or purple_url_decode() could return NULL. Don't pass a potential NULL to strcmp().
Evan Schoenberg <evan.s@dreskin.net>
parents:
17579
diff
changeset
|
1137 if (!old_friendly || (old_friendly && (!friendly || strcmp(old_friendly, friendly)))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1138 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1139 serv_got_alias(gc, passport, friendly); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1140 msn_user_set_friendly_name(user, friendly); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1141 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1142 |
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
|
1143 if (cmd->param_count == 6) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1144 { |
23481
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1145 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
|
1146 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
|
1147 } |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1148 else |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1149 { |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1150 msn_user_set_object(user, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1151 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1152 |
22348
a298447b2d66
Specify the base to convert from to prevent interpreting 0-prefixed client
Stu Tomlinson <stu@nosnilmot.com>
parents:
22346
diff
changeset
|
1153 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
|
1154 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
|
1155 |
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
|
1156 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
|
1157 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
|
1158 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1159 msn_user_set_state(user, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1160 msn_user_update(user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1161 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1163 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1164 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1165 chg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1166 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1167 char *state = cmd->params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1168 int state_id = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1169 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1170 if (!strcmp(state, "NLN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1171 state_id = MSN_ONLINE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 else if (!strcmp(state, "BSY")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1173 state_id = MSN_BUSY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1174 else if (!strcmp(state, "IDL")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1175 state_id = MSN_IDLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1176 else if (!strcmp(state, "BRB")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1177 state_id = MSN_BRB; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1178 else if (!strcmp(state, "AWY")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1179 state_id = MSN_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1180 else if (!strcmp(state, "PHN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1181 state_id = MSN_PHONE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1182 else if (!strcmp(state, "LUN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1183 state_id = MSN_LUNCH; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1184 else if (!strcmp(state, "HDN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1185 state_id = MSN_HIDDEN; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1186 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 cmdproc->session->state = state_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1189 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1190 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1191 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1193 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
|
1194 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1195 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1196 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
|
1197 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
|
1198 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1202 not_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 { |
23680
38c76b5b846b
Correctly save the payload_len of a MSN notification command. Also,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23674
diff
changeset
|
1204 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
|
1205 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
|
1206 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1207 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1208 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1209 prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1210 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1211 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
|
1212 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
|
1213 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1214 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
|
1215 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1216 type = cmd->params[2]; |
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 if (cmd->param_count == 4) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1219 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1220 value = cmd->params[3]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1221 if (!strcmp(type, "PHH")) |
15822 | 1222 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
|
1223 else if (!strcmp(type, "PHW")) |
15822 | 1224 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
|
1225 else if (!strcmp(type, "PHM")) |
15822 | 1226 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
|
1227 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1228 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1230 if (!strcmp(type, "PHH")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1231 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
|
1232 else if (!strcmp(type, "PHW")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1233 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
|
1234 else if (!strcmp(type, "PHM")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 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
|
1236 else { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1237 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
|
1238 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
|
1239 friendlyname = purple_url_decode(cmd->params[2]); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1240 |
23472
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23465
diff
changeset
|
1241 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
|
1242 |
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
|
1243 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
|
1244 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
|
1245 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
|
1246 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1247 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1248 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 reg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1253 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 MsnSession *session; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1255 const char *group_id, *group_name; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1256 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 session = cmdproc->session; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1258 group_id = cmd->params[2]; |
15822 | 1259 group_name = purple_url_decode(cmd->params[3]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1261 msn_userlist_rename_group_id(session->userlist, group_id, group_name); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 reg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1267 const char * group_id; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 char **params; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 params = g_strsplit(trans->params, " ", 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1272 group_id = params[0]; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 group_error_helper(cmdproc->session, _("Unable to rename group"), group_id, error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1275 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 g_strfreev(params); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1278 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1279 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 rmg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
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 MsnSession *session; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1283 const char *group_id; |
15373
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 session = cmdproc->session; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1286 group_id = cmd->params[2]; |
15373
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 msn_userlist_remove_group_id(session->userlist, group_id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1292 rmg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1294 const char *group_id; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 char **params; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1296 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1297 params = g_strsplit(trans->params, " ", 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1298 |
20428
b679b8f36f79
Fix a compile warning, rmg_error had not been fully updated for the
Stu Tomlinson <stu@nosnilmot.com>
parents:
20425
diff
changeset
|
1299 group_id = params[0]; |
15373
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 group_error_helper(cmdproc->session, _("Unable to delete group"), group_id, error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 g_strfreev(params); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1306 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 * Misc commands |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 url_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
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 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
|
1314 PurpleConnection *gc; |
15822 | 1315 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 const char *rru; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 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
|
1318 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
|
1319 gchar creds[33]; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 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
|
1321 |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1322 gulong tmp_timestamp; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 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
|
1326 gc = account->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 rru = cmd->params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 url = cmd->params[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1330 |
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
|
1331 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
|
1332 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
|
1333 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 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
|
1335 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
|
1336 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
|
1337 purple_connection_get_password(gc)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 |
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
|
1339 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
|
1340 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
|
1341 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
|
1342 purple_cipher_context_destroy(cipher); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 |
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
|
1345 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
|
1346 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
|
1347 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
|
1348 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
|
1349 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
|
1350 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
|
1351 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
|
1352 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
|
1353 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
|
1354 rru); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 |
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
|
1356 /* 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
|
1357 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
|
1358 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
|
1359 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 * Switchboards |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1362 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1363 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 rng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 const char *session_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 char *host; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1373 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1374 session_id = cmd->params[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1375 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 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
|
1377 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1378 if (session->http_method) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1379 port = 80; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1380 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1381 swboard = msn_switchboard_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1382 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 msn_switchboard_set_invited(swboard, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1384 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
|
1385 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
|
1386 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
|
1387 /* 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
|
1388 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1389 if (!msn_switchboard_connect(swboard, host, port)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1390 msn_switchboard_destroy(swboard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1391 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1392 g_free(host); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1393 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1394 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1395 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1396 xfr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
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 char *host; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1399 int port; |
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 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
|
1402 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1403 /* Maybe we can have a generic bad command error. */ |
15822 | 1404 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
|
1405 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1406 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1408 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
|
1409 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1410 if (!strcmp(cmd->params[1], "SB")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1411 { |
15822 | 1412 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
|
1413 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1414 else if (!strcmp(cmd->params[1], "NS")) |
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 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1417 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1418 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1419 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1420 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
|
1421 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 msn_notification_connect(session->notification, host, port); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1423 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1424 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1425 g_free(host); |
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 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1428 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1429 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
|
1430 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1431 { |
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
|
1432 /* 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
|
1433 #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
|
1434 xmlnode *root; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1435 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
|
1436 |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1437 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
|
1438 |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1439 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
|
1440 { |
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
|
1441 purple_debug_error("msn", "Unable to parse GCF payload into a XML tree"); |
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
|
1442 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
|
1443 } |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1444 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1445 |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1446 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
|
1447 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
|
1448 |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1449 /* 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
|
1450 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
|
1451 while (policy) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1452 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
|
1453 break; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1454 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
|
1455 } |
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
|
1456 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1457 if (policy) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1458 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
|
1459 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
|
1460 "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
|
1461 while (imtext) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1462 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
|
1463 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
|
1464 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
|
1465 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
|
1466 } |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1467 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1468 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
|
1469 } |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1470 |
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
|
1471 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
|
1472 #endif |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1473 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1474 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1475 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1476 gcf_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1477 { |
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
|
1478 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
|
1479 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1480 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
|
1481 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
|
1482 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1483 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1484 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1485 sbs_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1486 { |
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
|
1487 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
|
1488 /*get the payload content*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1489 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1490 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1491 /* |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1492 * Get the UBX's PSM info |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1493 * Post it to the User status |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1494 * 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
|
1495 */ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1496 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1497 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
|
1498 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1499 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1500 MsnSession *session; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1501 PurpleAccount *account; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1502 MsnUser *user; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1503 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
|
1504 char *psm_str, *str; |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1505 CurrentMedia media = {NULL, NULL, NULL}; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1506 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1507 session = cmdproc->session; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1508 account = session->account; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1509 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1510 passport = cmd->params[0]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1511 user = msn_userlist_find_user(session->userlist, passport); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1512 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1513 psm_str = msn_get_psm(cmd->payload,len); |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1514 msn_user_set_statusline(user, psm_str); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1515 g_free(psm_str); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1516 |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1517 str = msn_get_currentmedia(cmd->payload, len); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1518 if (msn_parse_currentmedia(str, &media)) |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1519 msn_user_set_currentmedia(user, &media); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1520 else |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1521 msn_user_set_currentmedia(user, NULL); |
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
|
1522 g_free(media.title); |
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
|
1523 g_free(media.album); |
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
|
1524 g_free(media.artist); |
20495
7f5564ebde7f
Fix some memory leaks. Free xmlnodes properly using xmlnode_free instead of
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20494
diff
changeset
|
1525 g_free(str); |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
16063
diff
changeset
|
1526 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1527 msn_user_update(user); |
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 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1531 ubx_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1532 { |
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
|
1533 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
|
1534 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
|
1535 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
|
1536 } |
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
|
1537 |
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
|
1538 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
|
1539 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
|
1540 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
|
1541 { |
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
|
1542 /* 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
|
1543 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
|
1544 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
|
1545 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1546 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1547 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1548 uux_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1549 { |
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
|
1550 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
|
1551 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
|
1552 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
|
1553 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1554 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1555 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1556 * Message Types |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1557 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1558 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1559 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1560 profile_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1561 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1562 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1563 const char *value; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1564 const char *clLastChange; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1565 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1566 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1567 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1568 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1569 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1570 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1571 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1572 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
|
1573 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1574 g_free(session->passport_info.kv); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1575 session->passport_info.kv = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1576 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1577 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1578 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
|
1579 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1580 g_free(session->passport_info.sid); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1581 session->passport_info.sid = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1582 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1583 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1584 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
|
1585 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1586 g_free(session->passport_info.mspauth); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1587 session->passport_info.mspauth = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1588 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1589 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1590 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
|
1591 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1592 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
|
1593 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
|
1594 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1595 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1596 if ((value = msn_message_get_attr(msg, "ClientPort")) != NULL) |
20399
6f986caeab59
merge of 'b4911943cba6f29cf0694dfd563cac17612236dc'
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
1597 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1598 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
|
1599 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1600 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1601 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
|
1602 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
|
1603 |
23611
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23570
diff
changeset
|
1604 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
|
1605 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
|
1606 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1607 /*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
|
1608 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
|
1609 #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
|
1610 /* 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
|
1611 msn_userlist_load(session); |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
1612 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
|
1613 #else |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1614 /* always get the full list? */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
1615 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
|
1616 #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
|
1617 #if 0 |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
1618 msn_contact_connect(session); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1619 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1620 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1621 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1622 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1623 initial_email_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1624 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1625 MsnSession *session; |
15822 | 1626 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1627 GHashTable *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1628 const char *unread; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1629 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1630 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1631 gc = session->account->gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1632 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1633 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1634 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1635 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1636 |
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
|
1637 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
|
1638 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1639 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1640 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
|
1641 msn_transaction_queue_cmd(trans, msg->cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1642 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1643 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1644 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1645 return; |
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 |
15822 | 1648 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
|
1649 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1650 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1651 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
|
1652 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1653 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
|
1654 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1655 if (unread != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1656 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1657 int count = atoi(unread); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1658 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1659 if (count > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1660 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1661 const char *passport; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1662 const char *url; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1663 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1664 passport = 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
|
1665 url = session->passport_info.mail_url; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1666 |
21767
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21672
diff
changeset
|
1667 purple_notify_emails(gc, count, FALSE, NULL, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1668 &passport, &url, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1669 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1670 } |
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 g_hash_table_destroy(table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1673 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1674 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1675 /*offline Message notification process*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1676 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1677 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
|
1678 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1679 MsnSession *session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1680 PurpleConnection *gc; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1681 GHashTable *table; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1682 const char *mdata, *unread; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1683 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1684 session = cmdproc->session; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1685 gc = session->account->gc; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1686 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1687 if (strcmp(msg->remote_user, "Hotmail")) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1688 /* This isn't an official message. */ |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1689 return; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1690 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1691 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
|
1692 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1693 mdata = g_hash_table_lookup(table, "Mail-Data"); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1694 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1695 if (mdata != NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1696 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
|
1697 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1698 if (g_hash_table_lookup(table, "Inbox-URL") == NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1699 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1700 g_hash_table_destroy(table); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1701 return; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1702 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1703 |
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
|
1704 if (session->passport_info.mail_url == NULL) |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1705 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1706 MsnTransaction *trans; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1707 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1708 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
|
1709 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1710 msn_cmdproc_send_trans(cmdproc, trans); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1711 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1712 g_hash_table_destroy(table); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1713 return; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1714 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1715 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1716 if (!purple_account_get_check_mail(session->account)) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1717 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1718 g_hash_table_destroy(table); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1719 return; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1720 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1721 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1722 unread = g_hash_table_lookup(table, "Inbox-Unread"); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1723 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1724 if (unread != NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1725 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1726 int count = atoi(unread); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1727 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1728 if (count > 0) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1729 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1730 const char *passport; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1731 const char *url; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1732 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1733 passport = 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
|
1734 url = session->passport_info.mail_url; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1735 |
21767
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21672
diff
changeset
|
1736 purple_notify_emails(gc, count, FALSE, NULL, NULL, |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1737 &passport, &url, NULL, NULL); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1738 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1739 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1740 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1741 g_hash_table_destroy(table); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1742 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1743 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1744 /*offline Message Notification*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1745 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1746 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
|
1747 { |
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
|
1748 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
|
1749 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1750 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1751 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1752 email_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1753 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1754 MsnSession *session; |
15822 | 1755 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1756 GHashTable *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1757 char *from, *subject, *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1758 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1759 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1760 gc = session->account->gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1761 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1762 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1763 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1764 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1765 |
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
|
1766 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
|
1767 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1768 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1769 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
|
1770 msn_transaction_queue_cmd(trans, msg->cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1771 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1772 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1773 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1774 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1775 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1776 |
15822 | 1777 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
|
1778 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1779 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1780 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
|
1781 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 from = subject = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1783 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1784 tmp = g_hash_table_lookup(table, "From"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1785 if (tmp != NULL) |
15822 | 1786 from = purple_mime_decode_field(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1788 tmp = g_hash_table_lookup(table, "Subject"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1789 if (tmp != NULL) |
15822 | 1790 subject = purple_mime_decode_field(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1791 |
15822 | 1792 purple_notify_email(gc, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1793 (subject != NULL ? subject : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1794 (from != NULL ? from : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1795 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
|
1796 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
|
1797 |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1798 g_free(from); |
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1799 g_free(subject); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1800 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1801 g_hash_table_destroy(table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1802 } |
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 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1805 system_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
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 GHashTable *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1808 const char *type_s; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1809 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1810 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1811 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1812 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1813 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1814 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
|
1815 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1816 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
|
1817 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1818 int type = atoi(type_s); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1819 char buf[MSN_BUF_LEN]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1820 int minutes; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1821 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1822 switch (type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1823 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1824 case 1: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1825 minutes = atoi(g_hash_table_lookup(table, "Arg1")); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1826 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
|
1827 "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
|
1828 "in %d minute. You will automatically be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1829 "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
|
1830 "conversations in progress.\n\nAfter the " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1831 "maintenance has been completed, you will be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1832 "able to successfully sign in.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1833 "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
|
1834 "in %d minutes. You will automatically be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1835 "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
|
1836 "conversations in progress.\n\nAfter the " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1837 "maintenance has been completed, you will be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1838 "able to successfully sign in.", minutes), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1839 minutes); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1840 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1841 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1842 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1843 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1844 if (*buf != '\0') |
15822 | 1845 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
|
1846 } |
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 g_hash_table_destroy(table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1849 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1851 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
|
1852 msn_notification_add_buddy_to_list(MsnNotification *notification, MsnListId list_id, |
23300
25a350f5deff
These forward declarations aren't needed
Mark Doliner <mark@kingant.net>
parents:
23298
diff
changeset
|
1853 const char *who) |
15373
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 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
|
1856 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
|
1857 xmlnode *adl_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1858 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1859 int payload_len; |
20488 | 1860 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1861 cmdproc = notification->servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1862 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1863 adl_node = xmlnode_new("ml"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1864 adl_node->child = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1865 |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1866 msn_add_contact_xml(notification->session, adl_node, who, list_op, |
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
|
1867 MSN_NETWORK_PASSPORT); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1868 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1869 payload = xmlnode_to_str(adl_node,&payload_len); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1870 xmlnode_free(adl_node); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1871 |
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
|
1872 msn_notification_post_adl(notification->servconn->cmdproc, |
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
|
1873 payload,payload_len); |
20504
d23c3a5884ee
Make the buddylist sync issue a little less worse.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20495
diff
changeset
|
1874 g_free(payload); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1875 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1876 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1877 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
|
1878 msn_notification_rem_buddy_from_list(MsnNotification *notification, MsnListId list_id, |
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
|
1879 const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1880 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 MsnCmdProc *cmdproc; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1882 MsnTransaction *trans; |
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
|
1883 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
|
1884 xmlnode *rml_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1885 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1886 int payload_len; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1887 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1888 cmdproc = notification->servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1889 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1890 rml_node = xmlnode_new("ml"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1891 rml_node->child = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1892 |
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
|
1893 msn_add_contact_xml(notification->session, rml_node, who, list_op, MSN_NETWORK_PASSPORT); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1894 |
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
|
1895 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
|
1896 xmlnode_free(rml_node); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1897 |
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
|
1898 purple_debug_info("msn", "Send RML with payload:\n%s\n", payload); |
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
|
1899 trans = msn_transaction_new(cmdproc, "RML","%" G_GSIZE_FORMAT, strlen(payload)); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1900 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
|
1901 msn_cmdproc_send_trans(cmdproc, trans); |
20504
d23c3a5884ee
Make the buddylist sync issue a little less worse.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20495
diff
changeset
|
1902 g_free(payload); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1903 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1904 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1905 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1906 * Init |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1907 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1908 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1909 msn_notification_init(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1910 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1911 cbs_table = msn_table_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1912 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1913 /* Synchronous */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1914 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
|
1915 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
|
1916 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
|
1917 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
|
1918 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
|
1919 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
|
1920 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
|
1921 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
|
1922 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
|
1923 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
|
1924 msn_table_add_cmd(cbs_table, "REG", "REG", reg_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1925 msn_table_add_cmd(cbs_table, "ADG", "ADG", adg_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1926 msn_table_add_cmd(cbs_table, "RMG", "RMG", rmg_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1927 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
|
1928 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1929 /* Asynchronous */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1930 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
|
1931 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
|
1932 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
|
1933 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
|
1934 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
|
1935 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
|
1936 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1937 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
|
1938 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
|
1939 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
|
1940 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
|
1941 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 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
|
1943 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
|
1944 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
|
1945 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
|
1946 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
|
1947 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
|
1948 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
|
1949 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1950 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
|
1951 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
|
1952 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1953 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
|
1954 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1955 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
|
1956 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1957 msn_table_add_error(cbs_table, "ADD", add_error); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
1958 msn_table_add_error(cbs_table, "ADL", adl_error); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1959 msn_table_add_error(cbs_table, "REG", reg_error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1960 msn_table_add_error(cbs_table, "RMG", rmg_error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1961 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
|
1962 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1963 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1964 "text/x-msmsgsprofile", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1965 profile_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1966 /*initial OIM notification*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1967 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
|
1968 "text/x-msmsgsinitialmdatanotification", |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1969 initial_mdata_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1970 /*OIM notification when user online*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1971 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
|
1972 "text/x-msmsgsoimnotification", |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1973 initial_mdata_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1975 "text/x-msmsgsinitialemailnotification", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1976 initial_email_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1977 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1978 "text/x-msmsgsemailnotification", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1979 email_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1980 /*delete an offline Message notification*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1981 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
|
1982 "text/x-msmsgsactivemailnotification", |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1983 delete_oim_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1984 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1985 "application/x-msmsgssystemmessage", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1986 system_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1987 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1988 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1989 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1990 msn_notification_end(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1991 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1992 msn_table_destroy(cbs_table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1993 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1994 |