annotate libpurple/protocols/msn/oim.c @ 20538:90fd0826c6ce

finish converting the rest of stuff to the new soap api, signing on, getting address book seems to work, other blist management stuff not tested yet
author Ka-Hing Cheung <khc@hxbc.us>
date Wed, 24 Oct 2007 06:35:54 +0000
parents d52d299cfde3
children aa875e77e5ce e64e6fbd1351
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 /**
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
2 * @file oim.c
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;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
61 oim->oim_list = NULL;
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;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
74
20401
4ddc27c18781 Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents: 20394
diff changeset
75 purple_debug_info("OIM","destroy the OIM \n");
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);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
78
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 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
82 g_queue_free(oim->send_queue);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
83
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
84 g_free(oim);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
85 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
86
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
87 static MsnOimSendReq *
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
88 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
89 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
90 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
91 MsnOimSendReq *request;
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 request = g_new0(MsnOimSendReq, 1);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
94 request->from_member =g_strdup(from_member);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
95 request->friendname = g_strdup(friendname);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
96 request->to_member = g_strdup(to_member);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
97 request->oim_msg = g_strdup(msg);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
98 return request;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
99 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
100
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
101 static void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
102 msn_oim_free_send_req(MsnOimSendReq *req)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
103 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
104 g_return_if_fail(req != NULL);
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_free(req->from_member);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
107 g_free(req->friendname);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
108 g_free(req->to_member);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
109 g_free(req->oim_msg);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
110
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
111 g_free(req);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
112 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
113
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 * OIM send SOAP request
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 /*encode the message to OIM Message Format*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
118 static char *
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
119 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
120 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
121 char *oim_body,*oim_base64;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
122
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
123 purple_debug_info("MSNP14","encode OIM Message...\n");
20401
4ddc27c18781 Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents: 20394
diff changeset
124 oim_base64 = purple_base64_encode((const guchar *)body, strlen(body));
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
125 purple_debug_info("MSNP14","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
126 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
127 oim->run_id,oim->send_seq,oim_base64);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
128
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
129 return oim_body;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
130 }
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 /*
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
133 * Process the send return SOAP string
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
134 * 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
135 */
20430
abfb0b366109 Compile warning fixes
Stu Tomlinson <stu@nosnilmot.com>
parents: 20401
diff changeset
136 static void
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
137 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
138 gpointer data)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
139 {
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
140 MsnOim *oim = data;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
141 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
142
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
143 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
144
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
145 if (response == NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
146 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
147 } 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
148 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
149
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
150 if (faultNode == NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
151 /*Send OK! return*/
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
152 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
153 } 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
154 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
155
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
156 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
157 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
158
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
159 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
160 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
161 "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
162
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 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
164 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
165 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
166 oim->challenge = NULL;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
167
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
168 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
169 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
170 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
171 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
172 return;
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 } 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
174 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
175 "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
176 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
177 }
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 } 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
179 char buf[33];
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
180
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
181 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
182 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
183
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 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
185 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
186 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
187 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
188
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
189 /*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
190 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
191 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
192 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
193 return;
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 }
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 }
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
196 }
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
197 }
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
198 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
199
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
200 msn_oim_free_send_req(msg);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
201 }
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 void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
204 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
205 const char* friendname, const char *tomember,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
206 const char * msg)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
207 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
208 g_return_if_fail(oim != NULL);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
209
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
210 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
211 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
212 }
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 /*post send single message request to oim server*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
215 void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
216 msn_oim_send_msg(MsnOim *oim)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
217 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
218 MsnOimSendReq *oim_request;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
219 char *soap_body,*mspauth;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
220 char *msg_body;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
221
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
222 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
223 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
224 g_return_if_fail(oim_request != NULL);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
225
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
226 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
227 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
228 oim->session->passport_info.t,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
229 oim->session->passport_info.p
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
230 );
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 /* 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
233 * 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
234 */
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
235 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
236 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
237 }
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 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
240 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
241 oim_request->from_member,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
242 oim_request->friendname,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
243 oim_request->to_member,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
244 mspauth,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
245 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
246 oim->challenge ? oim->challenge : "",
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
247 oim->send_seq,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
248 msg_body);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
249
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
250 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
251 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
252 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
253 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
254
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
255 /*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
256 if (oim->challenge != NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
257 oim->send_seq++;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
258 }
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
259
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
260 g_free(mspauth);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
261 g_free(msg_body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
262 g_free(soap_body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
263 }
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 * OIM delete SOAP request
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
267 * **************************************/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
268 static void
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
269 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
270 gpointer data)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
271 {
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
272 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
273
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 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
275 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
276 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
277 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
278 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
279 } else {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
280 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
281 }
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
282
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 g_free(rdata);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
284 }
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 /*Post to get the Offline Instant Message*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
287 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
288 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
289 {
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
290 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
291 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
292 char *soap_body;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
293
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
294 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
295
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
296 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
297 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
298
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
299 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
300 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
301 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
302 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
303 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
304
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
305 g_free(soap_body);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
306 }
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 * OIM get SOAP request
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
310 * **************************************/
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
311 /* 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
312 * 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
313 static time_t
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
314 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
315 {
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
316 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
317 char *tz_ptr = tz_str;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
318 static const char *months[] = {
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
319 "Jan", "Feb", "Mar", "Apr", "May", "Jun",
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
320 "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
321 };
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
322 time_t tval = 0;
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
323 struct tm t;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
324 memset(&t, 0, sizeof(t));
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
325
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
326 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
327 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
328
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
329 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
330 &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
331 &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
332 gboolean offset_positive = TRUE;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
333 int tzhrs;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
334 int tzmins;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
335
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
336 for (t.tm_mon = 0;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
337 months[t.tm_mon] != NULL &&
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
338 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
339 if (months[t.tm_mon] != NULL) {
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
340 if (*tz_str == '-') {
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
341 offset_positive = FALSE;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
342 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
343 } 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
344 tz_ptr++;
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
345 }
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 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
348 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
349 #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
350 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
351 #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
352
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
353 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
354 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
355
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 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
357
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 #ifdef _WIN32
20503
905891855710 3rd time the charm? Fixes #2990, maybe
Ka-Hing Cheung <khc@hxbc.us>
parents: 20501
diff changeset
359 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
360 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
361 #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
362 #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
363 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
364 #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
365 # 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
366 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
367 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
368 # endif
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
369 #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
370 #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
371
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 return mktime(&t) + tzoff;
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
373 }
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 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
378 return tval;
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
379 }
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
380
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
381 /*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
382 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
383 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
384 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
385 MsnMessage *message;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
386 char *date,*from,*decode_msg;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
387 gsize body_len;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
388 char **tokens;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
389 char *start,*end;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
390 int has_nick = 0;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
391 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
392 time_t stamp;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
393
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
394 message = msn_message_new(MSN_MSG_UNKNOWN);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
395
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
396 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
397 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
398 purple_debug_info("MSNP14","oim body:{%s}\n",message->body);
20430
abfb0b366109 Compile warning fixes
Stu Tomlinson <stu@nosnilmot.com>
parents: 20401
diff changeset
399 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
400 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
401 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
402 if(strstr(from," ")){
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
403 has_nick = 1;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
404 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
405 if(has_nick){
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
406 tokens = g_strsplit(from , " " , 2);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
407 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
408 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
409 date,tokens[0],tokens[1],passport_str);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
410 g_strfreev(tokens);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
411 }else{
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
412 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
413 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
414 date,passport_str);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
415 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
416 start = strstr(passport_str,"<");
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
417 start += 1;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
418 end = strstr(passport_str,">");
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
419 passport = g_strndup(start,end - start);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
420 g_free(passport_str);
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
421 purple_debug_info("MSNP14","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
422
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
423 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
424
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
425 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
426 stamp);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
427
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
428 /*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
429 * 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
430 */
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
431 msn_oim_post_delete_msg(rdata);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
432
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
433 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
434 g_free(decode_msg);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
435 }
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 static void
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
438 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
439 gpointer data)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
440 {
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
441 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
442
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
443 if (response != NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
444 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
445 "Body/GetMessageResponse/GetMessageResult");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
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 (msg_node) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
448 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
449 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
450 g_free(msg_str);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
451 } else {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
452 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
453 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
454 g_free(str);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
455 }
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
456 } else {
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", "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
458 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
459 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
460
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
461 /* parse the oim XML data
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
462 * 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
463 * */
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
464 void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
465 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
466 {
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
467 xmlnode *node, *mNode;
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
468 xmlnode *iu_node;
20444
a0d104281002 Compile fix, whoops! Thanks Masca/salinasv.
Stu Tomlinson <stu@nosnilmot.com>
parents: 20443
diff changeset
469 MsnSession *session = oim->session;
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
470
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
471 purple_debug_info("MSNP14:OIM", "%s", xmlmsg);
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
472
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
473 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
474 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
475 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
476 xmlnode_free(node);
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
477 return;
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
478 }
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
479
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
480 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
481
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
482 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
483 {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
484 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
485 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
486 const char *url = session->passport_info.file;
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
487
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
488 /* XXX/khc: pretty sure this is wrong */
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
489 purple_notify_emails(session->account->gc, atoi(unread), FALSE, NULL,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
490 NULL, &passport, &url, NULL, NULL);
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
491 g_free(unread);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
492 }
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
493
20490
2d8999540239 mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents: 20481
diff changeset
494 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
495 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
496 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
497 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
498
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
499 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
500 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
501
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
502 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
503 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
504
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
505 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
506 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
507
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
508 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
509 if (rt_node != NULL) {
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
510 rtime = xmlnode_get_data(rt_node);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
511 }
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
512 /* 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
513
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
514 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
515 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
516 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
517 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
518 }
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
519
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
520 g_free(passport);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
521 g_free(msgid);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
522 g_free(rtime);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
523 g_free(nickname);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
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
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20435
diff changeset
526 xmlnode_free(node);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
527 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
528
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
529 /*Post to get the Offline Instant Message*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
530 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
531 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
532 {
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
533 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
534 MsnOimRecvData *data = g_new0(MsnOimRecvData, 1);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
535
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
536 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
537
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
538 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
539 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
540
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
541 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
542 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
543
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20503
diff changeset
544 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
545 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
546 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
547 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
548 msn_oim_get_read_cb, data);
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 g_free(soap_body);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
551 }