Mercurial > pidgin
annotate libpurple/protocols/msn/oim.c @ 23450:b82a17934604
fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
code as well
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Wed, 26 Dec 2007 02:30:07 +0000 |
parents | 72aa2ccad28d |
children | b268fc2c9121 |
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*/ |
20989
2097b1664fa3
Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20858
diff
changeset
|
118 static gchar * |
20394
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 |
20539
2c8c6d77f12c
Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents:
20503
diff
changeset
|
123 purple_debug_info("MSN OIM","encode OIM Message...\n"); |
20401
4ddc27c18781
Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents:
20394
diff
changeset
|
124 oim_base64 = purple_base64_encode((const guchar *)body, strlen(body)); |
20539
2c8c6d77f12c
Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents:
20503
diff
changeset
|
125 purple_debug_info("MSN OIM","encoded base64 body:{%s}\n",oim_base64); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
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); |
20989
2097b1664fa3
Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20858
diff
changeset
|
128 g_free(oim_base64); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
129 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
130 return oim_body; |
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 /* |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
134 * Process the send return SOAP string |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
135 * 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
|
136 */ |
20430 | 137 static void |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
138 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
|
139 gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
140 { |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
141 MsnOim *oim = data; |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
142 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
|
143 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
144 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
|
145 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
146 if (response == NULL) { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
147 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
|
148 } 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
|
149 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
|
150 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
151 if (faultNode == NULL) { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
152 /*Send OK! return*/ |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
153 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
|
154 } 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
|
155 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
|
156 |
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 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
|
158 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
|
159 |
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
|
160 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
|
161 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
|
162 "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
|
163 |
23450
b82a17934604
fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@hxbc.us>
parents:
23447
diff
changeset
|
164 g_free(faultcode_str); |
b82a17934604
fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@hxbc.us>
parents:
23447
diff
changeset
|
165 |
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
|
166 if (challengeNode == NULL) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20536
diff
changeset
|
167 if (oim->challenge) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20536
diff
changeset
|
168 g_free(oim->challenge); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20536
diff
changeset
|
169 oim->challenge = NULL; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
170 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20536
diff
changeset
|
171 purple_debug_info("msnoim","resending OIM: %s\n", |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20536
diff
changeset
|
172 msg->oim_msg); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20536
diff
changeset
|
173 g_queue_push_head(oim->send_queue, msg); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20536
diff
changeset
|
174 msn_oim_send_msg(oim); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20536
diff
changeset
|
175 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
|
176 } 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
|
177 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
|
178 "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
|
179 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
|
180 } |
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 } 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
|
182 char buf[33]; |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
183 |
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
|
184 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
|
185 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
|
186 |
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 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
|
188 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
|
189 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
|
190 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
|
191 |
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
|
192 /*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
|
193 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
|
194 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
|
195 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
|
196 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
|
197 } |
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
|
198 } |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
199 } |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
200 } |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20435
diff
changeset
|
201 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
202 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
203 msn_oim_free_send_req(msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
204 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
205 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
206 void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
207 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
|
208 const char* friendname, const char *tomember, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
209 const char * msg) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
210 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
211 g_return_if_fail(oim != NULL); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
212 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
213 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
|
214 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
|
215 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
216 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
217 /*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
|
218 void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
219 msn_oim_send_msg(MsnOim *oim) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
220 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
221 MsnOimSendReq *oim_request; |
23447
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23443
diff
changeset
|
222 char *soap_body; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
223 char *msg_body; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
224 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
225 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
|
226 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
|
227 g_return_if_fail(oim_request != NULL); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
228 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
229 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
|
230 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
231 /* 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
|
232 * 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
|
233 */ |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
234 if(oim->challenge == NULL){ |
23447
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23443
diff
changeset
|
235 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
|
236 } |
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 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
|
239 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
|
240 oim_request->from_member, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
241 oim_request->friendname, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
242 oim_request->to_member, |
23447
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23443
diff
changeset
|
243 msn_nexus_get_token_str(oim->session->nexus, MSN_AUTH_LIVE_SECURE), |
23443
75be80ddeca5
Patch 1 from Qulogic, this one mostly updates the version sent by pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
21767
diff
changeset
|
244 MSNP15_WLM_PRODUCT_ID, |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
245 oim->challenge ? oim->challenge : "", |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
246 oim->send_seq, |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
247 msg_body); |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
248 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
249 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
|
250 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
|
251 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
|
252 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
|
253 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
254 /*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
|
255 if (oim->challenge != NULL) { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
256 oim->send_seq++; |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
257 } |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
258 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
259 g_free(msg_body); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
260 g_free(soap_body); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
261 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
262 |
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 * OIM delete SOAP request |
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 static void |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
267 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
|
268 gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
269 { |
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
|
270 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
|
271 |
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 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
|
273 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
|
274 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
|
275 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
|
276 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
|
277 } else { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
278 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
|
279 } |
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
|
280 |
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
|
281 g_free(rdata); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
282 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
283 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
284 /*Post to get the Offline Instant Message*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
285 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
|
286 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
|
287 { |
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 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
|
289 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
|
290 char *soap_body; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
291 |
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
|
292 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
|
293 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
294 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
|
295 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
|
296 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
297 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
|
298 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
|
299 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
|
300 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
|
301 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
|
302 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
303 g_free(soap_body); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
304 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
305 |
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 * OIM get SOAP request |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
308 * **************************************/ |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
309 /* 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
|
310 * 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
|
311 static time_t |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
312 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
|
313 { |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
314 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
|
315 char *tz_ptr = tz_str; |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
316 static const char *months[] = { |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
317 "Jan", "Feb", "Mar", "Apr", "May", "Jun", |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
318 "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
|
319 }; |
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
|
320 time_t tval = 0; |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
321 struct tm t; |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
322 memset(&t, 0, sizeof(t)); |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
323 |
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
|
324 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
|
325 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
|
326 |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
327 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
|
328 &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
|
329 &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
|
330 gboolean offset_positive = TRUE; |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
331 int tzhrs; |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
332 int tzmins; |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
333 |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
334 for (t.tm_mon = 0; |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
335 months[t.tm_mon] != NULL && |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
336 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
|
337 if (months[t.tm_mon] != NULL) { |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
338 if (*tz_str == '-') { |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
339 offset_positive = FALSE; |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
340 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
|
341 } 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
|
342 tz_ptr++; |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
343 } |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
344 |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
345 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
|
346 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
|
347 #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
|
348 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
|
349 #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
|
350 |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
351 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
|
352 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
|
353 |
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 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
|
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 #ifdef _WIN32 |
20503
905891855710
3rd time the charm? Fixes #2990, maybe
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
357 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
|
358 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
|
359 #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
|
360 #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
|
361 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
|
362 #else |
6ef43e723595
I think this is the right way to fix timezone. People on Win32 _and_
Ka-Hing Cheung <khc@hxbc.us>
parents:
20496
diff
changeset
|
363 # ifdef HAVE_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
|
364 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
|
365 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
|
366 # endif |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
367 #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
|
368 #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
|
369 |
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 return mktime(&t) + tzoff; |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
371 } |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
372 } |
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 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
|
376 return tval; |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
377 } |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
378 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
379 /*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
|
380 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
|
381 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
|
382 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
383 MsnMessage *message; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
384 char *date,*from,*decode_msg; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
385 gsize body_len; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
386 char **tokens; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
387 char *start,*end; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
388 int has_nick = 0; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
389 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
|
390 time_t stamp; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
391 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
392 message = msn_message_new(MSN_MSG_UNKNOWN); |
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 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
|
395 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
|
396 purple_debug_info("MSNP14","oim body:{%s}\n",message->body); |
20430 | 397 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
|
398 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
|
399 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
|
400 if(strstr(from," ")){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
401 has_nick = 1; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
402 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
403 if(has_nick){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
404 tokens = g_strsplit(from , " " , 2); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
405 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
|
406 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
|
407 date,tokens[0],tokens[1],passport_str); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
408 g_strfreev(tokens); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
409 }else{ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
410 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
|
411 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
|
412 date,passport_str); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
413 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
414 start = strstr(passport_str,"<"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
415 start += 1; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
416 end = strstr(passport_str,">"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
417 passport = g_strndup(start,end - start); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
418 g_free(passport_str); |
20539
2c8c6d77f12c
Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents:
20503
diff
changeset
|
419 purple_debug_info("MSN OIM","oim Date:{%s},passport{%s}\n",date,passport); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
420 |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
421 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
|
422 |
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
|
423 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
|
424 stamp); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
425 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
426 /*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
|
427 * 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
|
428 */ |
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
|
429 msn_oim_post_delete_msg(rdata); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
430 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
431 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
|
432 g_free(decode_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
433 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
434 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
435 /* Parse the XML data, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
436 * prepare to report the OIM to user |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
437 */ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
438 static void |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
439 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
|
440 gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
441 { |
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
|
442 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
|
443 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
444 if (response != NULL) { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
445 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
|
446 "Body/GetMessageResponse/GetMessageResult"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
447 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
448 if (msg_node) { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
449 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
|
450 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
|
451 g_free(msg_str); |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
452 } else { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
453 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
|
454 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
|
455 g_free(str); |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
456 } |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
457 } else { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
458 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
|
459 } |
20394
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 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
462 /* parse the oim XML data |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
463 * 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
|
464 * */ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
465 void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
466 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
|
467 { |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
468 xmlnode *node, *mNode; |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
469 xmlnode *iu_node; |
20444
a0d104281002
Compile fix, whoops! Thanks Masca/salinasv.
Stu Tomlinson <stu@nosnilmot.com>
parents:
20443
diff
changeset
|
470 MsnSession *session = oim->session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20435
diff
changeset
|
471 |
23443
75be80ddeca5
Patch 1 from Qulogic, this one mostly updates the version sent by pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
21767
diff
changeset
|
472 purple_debug_info("MSNP14:OIM", "%s\n", xmlmsg); |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
473 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
474 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
|
475 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
|
476 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
|
477 xmlnode_free(node); |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
478 return; |
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
479 } |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20435
diff
changeset
|
480 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
481 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
|
482 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
483 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
|
484 { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
485 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
|
486 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
|
487 const char *url = session->passport_info.file; |
21767
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21103
diff
changeset
|
488 int count = atoi(unread); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20435
diff
changeset
|
489 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
490 /* XXX/khc: pretty sure this is wrong */ |
21767
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21103
diff
changeset
|
491 if (count > 0) |
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21103
diff
changeset
|
492 purple_notify_emails(session->account->gc, count, FALSE, NULL, |
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21103
diff
changeset
|
493 NULL, &passport, &url, NULL, NULL); |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
494 g_free(unread); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20435
diff
changeset
|
495 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20435
diff
changeset
|
496 |
20490
2d8999540239
mostly fixed offline messaging, still 2 bugs:
Ka-Hing Cheung <khc@hxbc.us>
parents:
20481
diff
changeset
|
497 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
|
498 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
|
499 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
|
500 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
|
501 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
502 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
|
503 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
|
504 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
505 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
|
506 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
|
507 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
508 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
|
509 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
|
510 |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
511 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
|
512 if (rt_node != NULL) { |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
513 rtime = xmlnode_get_data(rt_node); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20435
diff
changeset
|
514 } |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
515 /* 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
|
516 |
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
|
517 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
|
518 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
|
519 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
|
520 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
|
521 } |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
522 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
523 g_free(passport); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20435
diff
changeset
|
524 g_free(msgid); |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
525 g_free(rtime); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
526 g_free(nickname); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
527 } |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
528 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20435
diff
changeset
|
529 xmlnode_free(node); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
530 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
531 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
532 /*Post to get the Offline Instant Message*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
533 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
|
534 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
|
535 { |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
536 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
|
537 MsnOimRecvData *data = g_new0(MsnOimRecvData, 1); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
538 |
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
|
539 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
|
540 |
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
|
541 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
|
542 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
|
543 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
544 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
|
545 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
|
546 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
547 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
|
548 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
|
549 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
|
550 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
|
551 msn_oim_get_read_cb, data); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
552 |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20503
diff
changeset
|
553 g_free(soap_body); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
554 } |