annotate libpurple/protocols/msn/oim.c @ 23298:5cdd93dac7a2

Delete trailing whitespace
author Mark Doliner <mark@kingant.net>
date Fri, 06 Jun 2008 22:46:04 +0000
parents 9b7af052fd6a
children 5c70d953a497 1ac5faa72c8d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1 /**
23298
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 22930
diff changeset
2 * @file oim.c
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
3 * get and send MSN offline Instant Message via SOAP request
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
4 * Author
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
5 * MaYuan<mayuan2006@gmail.com>
20401
4ddc27c18781 Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents: 20394
diff changeset
6 * purple
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
7 *
20401
4ddc27c18781 Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents: 20394
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
10 * source distribution.
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
11 *
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
15 * (at your option) any later version.
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
16 *
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
20 * GNU General Public License for more details.
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
21 *
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
25 */
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
26 #include "msn.h"
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
27 #include "soap2.h"
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
28 #include "oim.h"
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
29 #include "msnutils.h"
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
30
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
31 typedef struct _MsnOimSendReq {
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
32 char *from_member;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
33 char *friendname;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
34 char *to_member;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
35 char *oim_msg;
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
36 } MsnOimSendReq;
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
37
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
38 typedef struct {
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
39 MsnOim *oim;
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
40 char *msg_id;
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
41 } MsnOimRecvData;
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
42
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
43 /*Local Function Prototype*/
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
44 static void msn_oim_post_single_get_msg(MsnOim *oim, char *msgid);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
45 static MsnOimSendReq *msn_oim_new_send_req(const char *from_member,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
46 const char *friendname,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
47 const char* to_member,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
48 const char *msg);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
49 static void msn_oim_free_send_req(MsnOimSendReq *req);
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
50 static void msn_oim_report_to_user(MsnOimRecvData *rdata, const char *msg_str);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
51 static char *msn_oim_msg_to_str(MsnOim *oim, const char *body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
52
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
53 /*new a OIM object*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
54 MsnOim *
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
55 msn_oim_new(MsnSession *session)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
56 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
57 MsnOim *oim;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
58
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
59 oim = g_new0(MsnOim, 1);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
60 oim->session = session;
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: 22828
diff changeset
61 oim->oim_list = NULL;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
62 oim->run_id = rand_guid();
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
63 oim->challenge = NULL;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
64 oim->send_queue = g_queue_new();
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
65 oim->send_seq = 1;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
66 return oim;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
67 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
68
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
69 /*destroy the oim object*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
70 void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
71 msn_oim_destroy(MsnOim *oim)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
72 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
73 MsnOimSendReq *request;
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: 22828
diff changeset
74
f62a4a7fe365 Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22828
diff changeset
75 purple_debug_info("OIM", "destroy the OIM %p\n", oim);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
76 g_free(oim->run_id);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
77 g_free(oim->challenge);
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: 22828
diff changeset
78
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
79 while((request = g_queue_pop_head(oim->send_queue)) != NULL){
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
80 msn_oim_free_send_req(request);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
81 }
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: 22828
diff changeset
82
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
83 g_queue_free(oim->send_queue);
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: 22828
diff changeset
84 g_list_free(oim->oim_list);
f62a4a7fe365 Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22828
diff changeset
85
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
86 g_free(oim);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
87 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
88
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
89 static MsnOimSendReq *
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
90 msn_oim_new_send_req(const char *from_member, const char*friendname,
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
91 const char* to_member, const char *msg)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
92 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
93 MsnOimSendReq *request;
23298
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 22930
diff changeset
94
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
95 request = g_new0(MsnOimSendReq, 1);
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: 22828
diff changeset
96 request->from_member = g_strdup(from_member);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
97 request->friendname = g_strdup(friendname);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
98 request->to_member = g_strdup(to_member);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
99 request->oim_msg = g_strdup(msg);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
100 return request;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
101 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
102
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
103 static void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
104 msn_oim_free_send_req(MsnOimSendReq *req)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
105 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
106 g_return_if_fail(req != NULL);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
107
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
108 g_free(req->from_member);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
109 g_free(req->friendname);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
110 g_free(req->to_member);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
111 g_free(req->oim_msg);
23298
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 22930
diff changeset
112
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
113 g_free(req);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
114 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
115
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
116 /****************************************
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
117 * OIM send SOAP request
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
118 * **************************************/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
119 /*encode the message to OIM Message Format*/
20989
2097b1664fa3 Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20858
diff changeset
120 static gchar *
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
121 msn_oim_msg_to_str(MsnOim *oim, const char *body)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
122 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
123 char *oim_body,*oim_base64;
23298
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 22930
diff changeset
124
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 22930
diff changeset
125 purple_debug_info("MSN OIM","encode OIM Message...\n");
20401
4ddc27c18781 Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents: 20394
diff changeset
126 oim_base64 = purple_base64_encode((const guchar *)body, strlen(body));
23298
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 22930
diff changeset
127 purple_debug_info("MSN OIM","encoded base64 body:{%s}\n",oim_base64);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
128 oim_body = g_strdup_printf(MSN_OIM_MSG_TEMPLATE,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
129 oim->run_id,oim->send_seq,oim_base64);
20989
2097b1664fa3 Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20858
diff changeset
130 g_free(oim_base64);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
131
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
132 return oim_body;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
133 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
134
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
135 /*
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
136 * Process the send return SOAP string
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
137 * If got SOAP Fault,get the lock key,and resend it.
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
138 */
20430
abfb0b366109 Compile warning fixes
Stu Tomlinson <stu@nosnilmot.com>
parents: 20401
diff changeset
139 static void
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
140 msn_oim_send_read_cb(MsnSoapMessage *request, MsnSoapMessage *response,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
141 gpointer data)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
142 {
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
143 MsnOim *oim = data;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
144 MsnOimSendReq *msg = g_queue_pop_head(oim->send_queue);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
145
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
146 g_return_if_fail(msg != NULL);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
147
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
148 if (response == NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
149 purple_debug_info("MSNP14", "cannot send OIM: %s\n", msg->oim_msg);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
150 } else {
20538
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
151 xmlnode *faultNode = msn_soap_xml_get(response->xml, "Body/Fault");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
152
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
153 if (faultNode == NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
154 /*Send OK! return*/
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
155 purple_debug_info("MSNP14", "sent OIM: %s\n", msg->oim_msg);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
156 } else {
20538
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
157 xmlnode *faultcode = xmlnode_get_child(faultNode, "faultcode");
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
158
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
159 if (faultcode) {
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
160 char *faultcode_str = xmlnode_get_data(faultcode);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
161
20538
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
162 if (g_str_equal(faultcode_str, "q0:AuthenticationFailed")) {
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
163 xmlnode *challengeNode = msn_soap_xml_get(faultNode,
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
164 "detail/LockKeyChallenge");
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
165
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
166 if (challengeNode == NULL) {
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
167 if (oim->challenge) {
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
168 g_free(oim->challenge);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
169 oim->challenge = NULL;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
170
20538
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
171 purple_debug_info("msnoim","resending OIM: %s\n",
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
172 msg->oim_msg);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
173 g_queue_push_head(oim->send_queue, msg);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
174 msn_oim_send_msg(oim);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
175 } else {
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
176 purple_debug_info("msnoim",
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
177 "can't find lock key for OIM: %s\n",
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
178 msg->oim_msg);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
179 }
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
180 } else {
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
181 char buf[33];
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
182
20538
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
183 char *challenge = xmlnode_get_data(challengeNode);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
184 msn_handle_chl(challenge, buf);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
185
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
186 g_free(oim->challenge);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
187 oim->challenge = g_strndup(buf, sizeof(buf));
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
188 g_free(challenge);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
189 purple_debug_info("MSNP14","lockkey:{%s}\n",oim->challenge);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
190
20538
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
191 /*repost the send*/
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
192 purple_debug_info("MSNP14","resending OIM: %s\n", msg->oim_msg);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
193 g_queue_push_head(oim->send_queue, msg);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
194 msn_oim_send_msg(oim);
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
195 }
90fd0826c6ce finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents: 20536
diff changeset
196 }
22828
7d3b2c023ad8 This is the way we plug the leaks, plug the leaks, plug the leaks...
Daniel Atallah <daniel.atallah@gmail.com>
parents: 21767
diff changeset
197
7d3b2c023ad8 This is the way we plug the leaks, plug the leaks, plug the leaks...
Daniel Atallah <daniel.atallah@gmail.com>
parents: 21767
diff changeset
198 g_free(faultcode_str);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
199 }
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
200 }
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
201 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
202 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
203
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
204 void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
205 msn_oim_prep_send_msg_info(MsnOim *oim, const char *membername,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
206 const char* friendname, const char *tomember,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
207 const char * msg)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
208 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
209 g_return_if_fail(oim != NULL);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
210
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
211 g_queue_push_tail(oim->send_queue,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
212 msn_oim_new_send_req(membername, friendname, tomember, msg));
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
213 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
214
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
215 /*post send single message request to oim server*/
23298
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 22930
diff changeset
216 void
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
217 msn_oim_send_msg(MsnOim *oim)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
218 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
219 MsnOimSendReq *oim_request;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
220 char *soap_body,*mspauth;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
221 char *msg_body;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
222
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
223 g_return_if_fail(oim != NULL);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
224 oim_request = g_queue_peek_head(oim->send_queue);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
225 g_return_if_fail(oim_request != NULL);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
226
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
227 purple_debug_info("MSNP14","sending OIM: %s\n", oim_request->oim_msg);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
228 mspauth = g_strdup_printf("t=%s&amp;p=%s",
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
229 oim->session->passport_info.t,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
230 oim->session->passport_info.p
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
231 );
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
232
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
233 /* if we got the challenge lock key, we compute it
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
234 * else we go for the SOAP fault and resend it.
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
235 */
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
236 if(oim->challenge == NULL){
20471
530a92d50c5e Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20444
diff changeset
237 purple_debug_info("MSNP14","no lock key challenge,wait for SOAP Fault and Resend\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
238 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
239
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
240 msg_body = msn_oim_msg_to_str(oim, oim_request->oim_msg);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
241 soap_body = g_strdup_printf(MSN_OIM_SEND_TEMPLATE,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
242 oim_request->from_member,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
243 oim_request->friendname,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
244 oim_request->to_member,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
245 mspauth,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
246 MSNP13_WLM_PRODUCT_ID,
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
247 oim->challenge ? oim->challenge : "",
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
248 oim->send_seq,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
249 msg_body);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
250
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
251 msn_soap_message_send(oim->session,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
252 msn_soap_message_new(MSN_OIM_SEND_SOAP_ACTION,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
253 xmlnode_from_str(soap_body, -1)),
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
254 MSN_OIM_SEND_HOST, MSN_OIM_SEND_URL, msn_oim_send_read_cb, oim);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
255
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
256 /*increase the offline Sequence control*/
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
257 if (oim->challenge != NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
258 oim->send_seq++;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
259 }
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
260
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
261 g_free(mspauth);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
262 g_free(msg_body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
263 g_free(soap_body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
264 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
265
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
266 /****************************************
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
267 * OIM delete SOAP request
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
268 * **************************************/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
269 static void
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
270 msn_oim_delete_read_cb(MsnSoapMessage *request, MsnSoapMessage *response,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
271 gpointer data)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
272 {
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
273 MsnOimRecvData *rdata = data;
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
274
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
275 if (response && msn_soap_xml_get(response->xml, "Body/Fault") == NULL) {
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
276 purple_debug_info("msnoim", "delete OIM success\n");
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
277 rdata->oim->oim_list = g_list_remove(rdata->oim->oim_list,
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
278 rdata->msg_id);
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
279 g_free(rdata->msg_id);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
280 } else {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
281 purple_debug_info("msnoim", "delete OIM failed\n");
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
282 }
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
283
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
284 g_free(rdata);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
285 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
286
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
287 /*Post to get the Offline Instant Message*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
288 static void
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
289 msn_oim_post_delete_msg(MsnOimRecvData *rdata)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
290 {
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
291 MsnOim *oim = rdata->oim;
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
292 char *msgid = rdata->msg_id;
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
293 char *soap_body;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
294
20471
530a92d50c5e Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20444
diff changeset
295 purple_debug_info("MSNP14","Delete single OIM Message {%s}\n",msgid);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
296
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
297 soap_body = g_strdup_printf(MSN_OIM_DEL_TEMPLATE,
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
298 oim->session->passport_info.t, oim->session->passport_info.p, msgid);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
299
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
300 msn_soap_message_send(oim->session,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
301 msn_soap_message_new(MSN_OIM_DEL_SOAP_ACTION,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
302 xmlnode_from_str(soap_body, -1)),
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
303 MSN_OIM_RETRIEVE_HOST, MSN_OIM_RETRIEVE_URL,
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
304 msn_oim_delete_read_cb, rdata);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
305
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
306 g_free(soap_body);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
307 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
308
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
309 /****************************************
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
310 * OIM get SOAP request
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
311 * **************************************/
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
312 /* like purple_str_to_time, but different. The format of the timestamp
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
313 * is like this: 5 Sep 2007 21:42:12 -0700 */
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
314 static time_t
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
315 msn_oim_parse_timestamp(const char *timestamp)
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
316 {
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
317 char month_str[4], tz_str[6];
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
318 char *tz_ptr = tz_str;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
319 static const char *months[] = {
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
320 "Jan", "Feb", "Mar", "Apr", "May", "Jun",
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
321 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
322 };
20535
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
323 time_t tval = 0;
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
324 struct tm t;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
325 memset(&t, 0, sizeof(t));
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
326
20535
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
327 time(&tval);
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
328 localtime_r(&tval, &t);
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
329
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
330 if (sscanf(timestamp, "%02d %03s %04d %02d:%02d:%02d %05s",
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
331 &t.tm_mday, month_str, &t.tm_year,
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
332 &t.tm_hour, &t.tm_min, &t.tm_sec, tz_str) == 7) {
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
333 gboolean offset_positive = TRUE;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
334 int tzhrs;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
335 int tzmins;
23298
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 22930
diff changeset
336
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
337 for (t.tm_mon = 0;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
338 months[t.tm_mon] != NULL &&
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
339 strcmp(months[t.tm_mon], month_str) != 0; t.tm_mon++);
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
340 if (months[t.tm_mon] != NULL) {
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
341 if (*tz_str == '-') {
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
342 offset_positive = FALSE;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
343 tz_ptr++;
20496
c32fbef16656 Fixes #2990, apparently I used the wrong #define. Also fix + timezone
Ka-Hing Cheung <khc@hxbc.us>
parents: 20490
diff changeset
344 } else if (*tz_str == '+') {
c32fbef16656 Fixes #2990, apparently I used the wrong #define. Also fix + timezone
Ka-Hing Cheung <khc@hxbc.us>
parents: 20490
diff changeset
345 tz_ptr++;
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
346 }
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
347
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
348 if (sscanf(tz_ptr, "%02d%02d", &tzhrs, &tzmins) == 2) {
20498
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
349 time_t tzoff = tzhrs * 60 * 60 + tzmins * 60;
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
350 #ifdef _WIN32
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
351 long sys_tzoff;
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
352 #endif
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
353
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
354 if (!offset_positive)
20498
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
355 tzoff *= -1;
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
356
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
357 t.tm_year -= 1900;
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
358
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
359 #ifdef _WIN32
20503
905891855710 3rd time the charm? Fixes #2990, maybe
Ka-Hing Cheung <khc@hxbc.us>
parents: 20501
diff changeset
360 if ((sys_tzoff = wpurple_get_tz_offset()) != -1)
20498
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
361 tzoff += sys_tzoff;
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
362 #else
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
363 #ifdef HAVE_TM_GMTOFF
20535
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
364 tzoff -= t.tm_gmtoff;
20498
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
365 #else
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
366 # ifdef HAVE_TIMEZONE
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
367 tzset(); /* making sure */
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
368 tzoff -= timezone;
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
369 # endif
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
370 #endif
20498
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
371 #endif /* _WIN32 */
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
372
6ef43e723595 I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents: 20496
diff changeset
373 return mktime(&t) + tzoff;
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
374 }
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
375 }
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
376 }
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
377
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
378 purple_debug_info("MSNP14:OIM", "Can't parse timestamp %s\n", timestamp);
20535
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
379 return tval;
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
380 }
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
381
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
382 /*Post the Offline Instant Message to User Conversation*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
383 static void
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
384 msn_oim_report_to_user(MsnOimRecvData *rdata, const char *msg_str)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
385 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
386 MsnMessage *message;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
387 char *date,*from,*decode_msg;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
388 gsize body_len;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
389 char **tokens;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
390 char *start,*end;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
391 int has_nick = 0;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
392 char *passport_str, *passport;
20435
f0bc92602072 Parse the message timestamp using purple_str_to_time. I haven't been able
Stu Tomlinson <stu@nosnilmot.com>
parents: 20433
diff changeset
393 time_t stamp;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
395 message = msn_message_new(MSN_MSG_UNKNOWN);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
396
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
397 msn_message_parse_payload(message, msg_str, strlen(msg_str),
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
398 MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM);
20471
530a92d50c5e Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20444
diff changeset
399 purple_debug_info("MSNP14","oim body:{%s}\n",message->body);
20430
abfb0b366109 Compile warning fixes
Stu Tomlinson <stu@nosnilmot.com>
parents: 20401
diff changeset
400 decode_msg = (char *)purple_base64_decode(message->body,&body_len);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
401 date = (char *)g_hash_table_lookup(message->attr_table, "Date");
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
402 from = (char *)g_hash_table_lookup(message->attr_table, "From");
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
403 if(strstr(from," ")){
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
404 has_nick = 1;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
405 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
406 if(has_nick){
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
407 tokens = g_strsplit(from , " " , 2);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
408 passport_str = g_strdup(tokens[1]);
20471
530a92d50c5e Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20444
diff changeset
409 purple_debug_info("MSNP14","oim Date:{%s},nickname:{%s},tokens[1]:{%s} passport{%s}\n",
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
410 date,tokens[0],tokens[1],passport_str);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
411 g_strfreev(tokens);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
412 }else{
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
413 passport_str = g_strdup(from);
20471
530a92d50c5e Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20444
diff changeset
414 purple_debug_info("MSNP14","oim Date:{%s},passport{%s}\n",
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
415 date,passport_str);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
416 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
417 start = strstr(passport_str,"<");
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
418 start += 1;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
419 end = strstr(passport_str,">");
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
420 passport = g_strndup(start,end - start);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
421 g_free(passport_str);
20539
2c8c6d77f12c Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20503
diff changeset
422 purple_debug_info("MSN OIM","oim Date:{%s},passport{%s}\n",date,passport);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
423
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
424 stamp = msn_oim_parse_timestamp(date);
20435
f0bc92602072 Parse the message timestamp using purple_str_to_time. I haven't been able
Stu Tomlinson <stu@nosnilmot.com>
parents: 20433
diff changeset
425
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
426 serv_got_im(rdata->oim->session->account->gc, passport, decode_msg, 0,
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
427 stamp);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
428
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
429 /*Now get the oim message ID from the oim_list.
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
430 * and append to read list to prepare for deleting the Offline Message when sign out
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
431 */
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
432 msn_oim_post_delete_msg(rdata);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
433
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
434 g_free(passport);
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
435 g_free(decode_msg);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
436 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
437
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
438 /* Parse the XML data,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
439 * prepare to report the OIM to user
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
440 */
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
441 static void
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
442 msn_oim_get_read_cb(MsnSoapMessage *request, MsnSoapMessage *response,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
443 gpointer data)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
444 {
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
445 MsnOimRecvData *rdata = data;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20500
diff changeset
446
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
447 if (response != NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
448 xmlnode *msg_node = msn_soap_xml_get(response->xml,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
449 "Body/GetMessageResponse/GetMessageResult");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
450
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
451 if (msg_node) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
452 char *msg_str = xmlnode_get_data(msg_node);
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
453 msn_oim_report_to_user(rdata, msg_str);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
454 g_free(msg_str);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
455 } else {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
456 char *str = xmlnode_to_str(response->xml, NULL);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
457 purple_debug_info("msnoim", "Unknown response: %s\n", str);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
458 g_free(str);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
459 }
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
460 } else {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
461 purple_debug_info("msnoim", "Failed to get OIM\n");
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
462 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
463 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
464
23298
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 22930
diff changeset
465 /* parse the oim XML data
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
466 * and post it to the soap server to get the Offline Message
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
467 * */
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
468 void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
469 msn_parse_oim_msg(MsnOim *oim,const char *xmlmsg)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
470 {
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
471 xmlnode *node, *mNode;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
472 xmlnode *iu_node;
20444
a0d104281002 Compile fix, whoops! Thanks Masca/salinasv.
Stu Tomlinson <stu@nosnilmot.com>
parents: 20443
diff changeset
473 MsnSession *session = oim->session;
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
474
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: 22828
diff changeset
475 purple_debug_info("MSNP14:OIM", "%s\n", xmlmsg);
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
476
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
477 node = xmlnode_from_str(xmlmsg, -1);
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
478 if (strcmp(node->name, "MD") != 0) {
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
479 purple_debug_info("msnoim", "WTF is this? %s\n", xmlmsg);
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
480 xmlnode_free(node);
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
481 return;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
482 }
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
483
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
484 iu_node = msn_soap_xml_get(node, "E/IU");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
485
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
486 if (iu_node != NULL && purple_account_get_check_mail(session->account))
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
487 {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
488 char *unread = xmlnode_get_data(iu_node);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
489 const char *passport = msn_user_get_passport(session->user);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
490 const char *url = session->passport_info.file;
21767
7ac87187bbec Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21103
diff changeset
491 int count = atoi(unread);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
492
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
493 /* XXX/khc: pretty sure this is wrong */
21767
7ac87187bbec Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21103
diff changeset
494 if (count > 0)
7ac87187bbec Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21103
diff changeset
495 purple_notify_emails(session->account->gc, count, FALSE, NULL,
7ac87187bbec Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21103
diff changeset
496 NULL, &passport, &url, NULL, NULL);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
497 g_free(unread);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
498 }
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
499
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
500 for(mNode = xmlnode_get_child(node, "M"); mNode;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
501 mNode = xmlnode_get_next_twin(mNode)){
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
502 char *passport, *msgid, *nickname, *rtime = NULL;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
503 xmlnode *e_node, *i_node, *n_node, *rt_node;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
504
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
505 e_node = xmlnode_get_child(mNode, "E");
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
506 passport = xmlnode_get_data(e_node);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
507
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
508 i_node = xmlnode_get_child(mNode, "I");
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
509 msgid = xmlnode_get_data(i_node);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
510
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
511 n_node = xmlnode_get_child(mNode, "N");
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
512 nickname = xmlnode_get_data(n_node);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
513
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
514 rt_node = xmlnode_get_child(mNode, "RT");
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
515 if (rt_node != NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
516 rtime = xmlnode_get_data(rt_node);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
517 }
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
518 /* purple_debug_info("msnoim","E:{%s},I:{%s},rTime:{%s}\n",passport,msgid,rTime); */
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
519
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
520 if (!g_list_find_custom(oim->oim_list, msgid, (GCompareFunc)strcmp)) {
20535
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
521 oim->oim_list = g_list_append(oim->oim_list, msgid);
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
522 msn_oim_post_single_get_msg(oim, msgid);
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
523 msgid = NULL;
a9ee3fbabf81 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
Ka-Hing Cheung <khc@hxbc.us>
parents: 20534
diff changeset
524 }
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
525
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
526 g_free(passport);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
527 g_free(msgid);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
528 g_free(rtime);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
529 g_free(nickname);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
530 }
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
531
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
532 xmlnode_free(node);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
533 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
534
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
535 /*Post to get the Offline Instant Message*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
536 static void
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
537 msn_oim_post_single_get_msg(MsnOim *oim, char *msgid)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
538 {
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
539 char *soap_body;
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
540 MsnOimRecvData *data = g_new0(MsnOimRecvData, 1);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
541
20471
530a92d50c5e Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20444
diff changeset
542 purple_debug_info("MSNP14","Get single OIM Message\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
543
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
544 data->oim = oim;
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
545 data->msg_id = msgid;
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
546
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
547 soap_body = g_strdup_printf(MSN_OIM_GET_TEMPLATE,
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
548 oim->session->passport_info.t, oim->session->passport_info.p, msgid);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
549
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
550 msn_soap_message_send(oim->session,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
551 msn_soap_message_new(MSN_OIM_GET_SOAP_ACTION,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
552 xmlnode_from_str(soap_body, -1)),
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
553 MSN_OIM_RETRIEVE_HOST, MSN_OIM_RETRIEVE_URL,
20536
d52d299cfde3 seems to fix duplicate oim messages for real. The problem was that MSN tells
Ka-Hing Cheung <khc@hxbc.us>
parents: 20535
diff changeset
554 msn_oim_get_read_cb, data);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
555
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
556 g_free(soap_body);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
557 }