Mercurial > pidgin.yaz
annotate libpurple/protocols/msn/slpcall.c @ 31469:78dccab9824c
Add the session user to the userlist. This reduces the amount of
special-casing needed and corrects the buddy icon if you have yourself
on your list.
Fixes #12973.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 10 Dec 2010 06:38:17 +0000 |
parents | f26e961e1274 |
children | b4064198e017 |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file slpcall.c SLP Call Functions |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15823 | 4 * purple |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * |
15823 | 6 * Purple is the legal property of its developers, whose names are too numerous |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17137
diff
changeset
|
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 */ |
31180
a99b6dcdb60d
Remove unnecesary includes from msn.h.
masca@cpw.pidgin.im
parents:
29466
diff
changeset
|
24 |
31196
230caecf5435
Include internal.h on each c file to avoid windows breakage as recommended by Daniel.
masca@cpw.pidgin.im
parents:
31180
diff
changeset
|
25 #include "internal.h" |
31180
a99b6dcdb60d
Remove unnecesary includes from msn.h.
masca@cpw.pidgin.im
parents:
29466
diff
changeset
|
26 #include "debug.h" |
31271
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
27 #include "smiley.h" |
31180
a99b6dcdb60d
Remove unnecesary includes from msn.h.
masca@cpw.pidgin.im
parents:
29466
diff
changeset
|
28 |
19797
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
29 #include "msnutils.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 #include "slpcall.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "slp.h" |
31200
e03f912141dd
Start moving p2p specific code to its own module.
masca@cpw.pidgin.im
parents:
31198
diff
changeset
|
33 #include "p2p.h" |
31271
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
34 #include "xfer.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 * Main |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 |
24337
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
40 static gboolean |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
41 msn_slpcall_timeout(gpointer data) |
24337
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
42 { |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
43 MsnSlpCall *slpcall; |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
44 |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
45 slpcall = data; |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
46 |
27509
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27374
diff
changeset
|
47 if (purple_debug_is_verbose()) |
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27374
diff
changeset
|
48 purple_debug_info("msn", "slpcall_timeout: slpcall(%p)\n", slpcall); |
24337
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
49 |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
50 if (!slpcall->pending && !slpcall->progress) |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
51 { |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
52 msn_slpcall_destroy(slpcall); |
25169
14b927f45ec5
We just freed slpcall, so don't set slpcall->timer to 0. And return
Mark Doliner <mark@kingant.net>
parents:
25072
diff
changeset
|
53 return TRUE; |
24337
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
54 } |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
55 |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
56 slpcall->progress = FALSE; |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
57 |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
58 return TRUE; |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
59 } |
f0160066b58b
Make msn_slp_call_timeout static
Mark Doliner <mark@kingant.net>
parents:
23737
diff
changeset
|
60 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 MsnSlpCall * |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
62 msn_slpcall_new(MsnSlpLink *slplink) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 MsnSlpCall *slpcall; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 g_return_val_if_fail(slplink != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 slpcall = g_new0(MsnSlpCall, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 |
27509
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27374
diff
changeset
|
70 if (purple_debug_is_verbose()) |
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27374
diff
changeset
|
71 purple_debug_info("msn", "slpcall_new: slpcall(%p)\n", slpcall); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 slpcall->slplink = slplink; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 msn_slplink_add_slpcall(slplink, slpcall); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 |
24342
9bdaf273c0ff
Use purple_timeout_add_seconds() instead of purple_timeout_add() in a
Mark Doliner <mark@kingant.net>
parents:
24341
diff
changeset
|
77 slpcall->timer = purple_timeout_add_seconds(MSN_SLPCALL_TIMEOUT, msn_slpcall_timeout, slpcall); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 return slpcall; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 void |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
83 msn_slpcall_destroy(MsnSlpCall *slpcall) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 GList *e; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 |
27509
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27374
diff
changeset
|
87 if (purple_debug_is_verbose()) |
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27374
diff
changeset
|
88 purple_debug_info("msn", "slpcall_destroy: slpcall(%p)\n", slpcall); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 g_return_if_fail(slpcall != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 if (slpcall->timer) |
15823 | 93 purple_timeout_remove(slpcall->timer); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 for (e = slpcall->slplink->slp_msgs; e != NULL; ) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 MsnSlpMessage *slpmsg = e->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 e = e->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
99 |
27509
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27374
diff
changeset
|
100 if (purple_debug_is_verbose()) |
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27374
diff
changeset
|
101 purple_debug_info("msn", "slpcall_destroy: trying slpmsg(%p)\n", |
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27374
diff
changeset
|
102 slpmsg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 if (slpmsg->slpcall == slpcall) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 msn_slpmsg_destroy(slpmsg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 if (slpcall->end_cb != NULL) |
24340
33697964e62b
There's no need for this variable anymore
Mark Doliner <mark@kingant.net>
parents:
24338
diff
changeset
|
111 slpcall->end_cb(slpcall, slpcall->slplink->session); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 |
23719
7b2fdeb078cd
take an extra reference to PurpleXfer so we can check whether the whole
Ka-Hing Cheung <khc@hxbc.us>
parents:
23671
diff
changeset
|
113 if (slpcall->xfer != NULL) { |
29073
59b0c556f787
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <paul@darkrain42.org>
parents:
28431
diff
changeset
|
114 if (purple_xfer_get_type(slpcall->xfer) == PURPLE_XFER_RECEIVE) |
59b0c556f787
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <paul@darkrain42.org>
parents:
28431
diff
changeset
|
115 g_byte_array_free(slpcall->u.incoming_data, TRUE); |
23719
7b2fdeb078cd
take an extra reference to PurpleXfer so we can check whether the whole
Ka-Hing Cheung <khc@hxbc.us>
parents:
23671
diff
changeset
|
116 slpcall->xfer->data = NULL; |
17137
8ed7b2d32ad1
slpcall now explicitlt references its xfer and unreferences it when it is destroyed. While it *looks* like this should *probably* have happened anyways due to the interactins between xfer_init, xfer_end, and xfer_cancel_remote, having the xfer's owner make this explicit makes the process less fragile and more obvious, and it may fix a crash as the slp is destroyed. Fixes #1070
Evan Schoenberg <evan.s@dreskin.net>
parents:
17136
diff
changeset
|
117 purple_xfer_unref(slpcall->xfer); |
23719
7b2fdeb078cd
take an extra reference to PurpleXfer so we can check whether the whole
Ka-Hing Cheung <khc@hxbc.us>
parents:
23671
diff
changeset
|
118 } |
17137
8ed7b2d32ad1
slpcall now explicitlt references its xfer and unreferences it when it is destroyed. While it *looks* like this should *probably* have happened anyways due to the interactins between xfer_init, xfer_end, and xfer_cancel_remote, having the xfer's owner make this explicit makes the process less fragile and more obvious, and it may fix a crash as the slp is destroyed. Fixes #1070
Evan Schoenberg <evan.s@dreskin.net>
parents:
17136
diff
changeset
|
119 |
29073
59b0c556f787
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <paul@darkrain42.org>
parents:
28431
diff
changeset
|
120 |
24338
9b253ce969d0
msn_slplink_remove_slpcall() shouldn't be responsible for setting
Mark Doliner <mark@kingant.net>
parents:
24337
diff
changeset
|
121 msn_slplink_remove_slpcall(slpcall->slplink, slpcall); |
9b253ce969d0
msn_slplink_remove_slpcall() shouldn't be responsible for setting
Mark Doliner <mark@kingant.net>
parents:
24337
diff
changeset
|
122 |
23735
331effbd1cc8
Re-arrange msn_slplink_destroy and msn_slp_call_destroy. Might help
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23671
diff
changeset
|
123 g_free(slpcall->id); |
331effbd1cc8
Re-arrange msn_slplink_destroy and msn_slp_call_destroy. Might help
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23671
diff
changeset
|
124 g_free(slpcall->branch); |
331effbd1cc8
Re-arrange msn_slplink_destroy and msn_slp_call_destroy. Might help
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23671
diff
changeset
|
125 g_free(slpcall->data_info); |
331effbd1cc8
Re-arrange msn_slplink_destroy and msn_slp_call_destroy. Might help
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23671
diff
changeset
|
126 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 g_free(slpcall); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 void |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
131 msn_slpcall_init(MsnSlpCall *slpcall, MsnSlpCallType type) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
132 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 slpcall->session_id = rand() % 0xFFFFFF00 + 4; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 slpcall->id = rand_guid(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 slpcall->type = type; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 void |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
139 msn_slpcall_session_init(MsnSlpCall *slpcall) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 if (slpcall->session_init_cb) |
23671
96e78c0fa32b
Get rid of MsnSlpSession entirely. It only seems to link to MsnSlpCall
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22808
diff
changeset
|
142 slpcall->session_init_cb(slpcall); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 slpcall->started = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 void |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
148 msn_slpcall_invite(MsnSlpCall *slpcall, const char *euf_guid, |
31282
7b1b7a4e0bb4
Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
masca@cpw.pidgin.im
parents:
31272
diff
changeset
|
149 MsnP2PAppId app_id, const char *context) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 MsnSlpLink *slplink; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 MsnSlpMessage *slpmsg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 char *header; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 char *content; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 g_return_if_fail(slpcall != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 g_return_if_fail(context != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 slplink = slpcall->slplink; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 slpcall->branch = rand_guid(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 content = g_strdup_printf( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
164 "EUF-GUID: {%s}\r\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 "SessionID: %lu\r\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 "AppID: %d\r\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 "Context: %s\r\n\r\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 euf_guid, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 slpcall->session_id, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 app_id, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 context); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 header = g_strdup_printf("INVITE MSNMSGR:%s MSNSLP/1.0", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 slplink->remote_user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 slpmsg = msn_slpmsg_sip_new(slpcall, 0, header, slpcall->branch, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 "application/x-msnmsgr-sessionreqbody", content); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
178 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
179 slpmsg->info = "SLP INVITE"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 slpmsg->text_body = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 msn_slplink_send_slpmsg(slplink, slpmsg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 g_free(header); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 g_free(content); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 void |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
189 msn_slpcall_close(MsnSlpCall *slpcall) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 g_return_if_fail(slpcall != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 g_return_if_fail(slpcall->slplink != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 send_bye(slpcall, "application/x-msnmsgr-sessionclosebody"); |
24344
bceefbae1ca6
Reame msn_slplink_unleash to msn_slplink_send_queued_slpmsgs, which I
Mark Doliner <mark@kingant.net>
parents:
24342
diff
changeset
|
195 msn_slplink_send_queued_slpmsgs(slpcall->slplink); |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
196 msn_slpcall_destroy(slpcall); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 |
31271
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
199 /***************************************************************************** |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
200 * Parse received SLP messages |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
201 ****************************************************************************/ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
202 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
203 /************************************************************************** |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
204 *** Util |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
205 **************************************************************************/ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
206 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
207 static char * |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
208 get_token(const char *str, const char *start, const char *end) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
209 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
210 const char *c, *c2; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
211 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
212 if ((c = strstr(str, start)) == NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
213 return NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
214 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
215 c += strlen(start); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
216 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
217 if (end != NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
218 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
219 if ((c2 = strstr(c, end)) == NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
220 return NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
221 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
222 return g_strndup(c, c2 - c); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
223 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
224 else |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
225 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
226 /* This has to be changed */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
227 return g_strdup(c); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
228 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
229 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
230 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
231 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
232 /* XXX: this could be improved if we tracked custom smileys |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
233 * per-protocol, per-account, per-session or (ideally) per-conversation |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
234 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
235 static PurpleStoredImage * |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
236 find_valid_emoticon(PurpleAccount *account, const char *path) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
237 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
238 GList *smileys; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
239 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
240 if (!purple_account_get_bool(account, "custom_smileys", TRUE)) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
241 return NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
242 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
243 smileys = purple_smileys_get_all(); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
244 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
245 for (; smileys; smileys = g_list_delete_link(smileys, smileys)) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
246 PurpleSmiley *smiley; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
247 PurpleStoredImage *img; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
248 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
249 smiley = smileys->data; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
250 img = purple_smiley_get_stored_image(smiley); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
251 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
252 if (purple_strequal(path, purple_imgstore_get_filename(img))) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
253 g_list_free(smileys); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
254 return img; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
255 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
256 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
257 purple_imgstore_unref(img); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
258 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
259 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
260 purple_debug_error("msn", "Received illegal request for file %s\n", path); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
261 return NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
262 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
263 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
264 static char * |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
265 parse_dc_nonce(const char *content, MsnDirectConnNonceType *ntype) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
266 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
267 char *nonce; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
268 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
269 *ntype = DC_NONCE_UNKNOWN; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
270 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
271 nonce = get_token(content, "Hashed-Nonce: {", "}\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
272 if (nonce) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
273 *ntype = DC_NONCE_SHA1; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
274 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
275 guint32 n1, n6; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
276 guint16 n2, n3, n4, n5; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
277 nonce = get_token(content, "Nonce: {", "}\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
278 if (nonce |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
279 && sscanf(nonce, "%08x-%04hx-%04hx-%04hx-%04hx%08x", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
280 &n1, &n2, &n3, &n4, &n5, &n6) == 6) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
281 *ntype = DC_NONCE_PLAIN; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
282 g_free(nonce); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
283 nonce = g_malloc(16); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
284 *(guint32 *)(nonce + 0) = GUINT32_TO_LE(n1); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
285 *(guint16 *)(nonce + 4) = GUINT16_TO_LE(n2); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
286 *(guint16 *)(nonce + 6) = GUINT16_TO_LE(n3); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
287 *(guint16 *)(nonce + 8) = GUINT16_TO_BE(n4); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
288 *(guint16 *)(nonce + 10) = GUINT16_TO_BE(n5); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
289 *(guint32 *)(nonce + 12) = GUINT32_TO_BE(n6); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
290 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
291 /* Invalid nonce, so ignore request */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
292 g_free(nonce); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
293 nonce = NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
294 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
295 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
296 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
297 return nonce; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
298 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
299 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
300 static void |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
301 msn_slp_process_transresp(MsnSlpCall *slpcall, const char *content) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
302 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
303 /* A direct connection negotiation response */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
304 char *bridge; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
305 char *nonce; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
306 char *listening; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
307 MsnDirectConn *dc = slpcall->slplink->dc; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
308 MsnDirectConnNonceType ntype; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
309 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
310 purple_debug_info("msn", "process_transresp\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
311 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
312 /* Direct connections are disabled. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
313 if (!purple_account_get_bool(slpcall->slplink->session->account, "direct_connect", TRUE)) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
314 return; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
315 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
316 g_return_if_fail(dc != NULL); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
317 g_return_if_fail(dc->state == DC_STATE_CLOSED); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
318 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
319 bridge = get_token(content, "Bridge: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
320 nonce = parse_dc_nonce(content, &ntype); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
321 listening = get_token(content, "Listening: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
322 if (listening && bridge && !strcmp(bridge, "TCPv1")) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
323 /* Ok, the client supports direct TCP connection */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
324 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
325 /* We always need this. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
326 if (ntype == DC_NONCE_SHA1) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
327 strncpy(dc->remote_nonce, nonce, 36); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
328 dc->remote_nonce[36] = '\0'; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
329 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
330 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
331 if (!strcasecmp(listening, "false")) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
332 if (dc->listen_data != NULL) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
333 /* |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
334 * We'll listen for incoming connections but |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
335 * the listening socket isn't ready yet so we cannot |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
336 * send the INVITE packet now. Put the slpcall into waiting mode |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
337 * and let the callback send the invite. |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
338 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
339 slpcall->wait_for_socket = TRUE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
340 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
341 } else if (dc->listenfd != -1) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
342 /* The listening socket is ready. Send the INVITE here. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
343 msn_dc_send_invite(dc); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
344 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
345 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
346 /* We weren't able to create a listener either. Use SB. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
347 msn_dc_fallback_to_sb(dc); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
348 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
349 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
350 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
351 /* |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
352 * We should connect to the client so parse |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
353 * IP/port from response. |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
354 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
355 char *ip, *port_str; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
356 int port = 0; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
357 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
358 if (ntype == DC_NONCE_PLAIN) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
359 /* Only needed for listening side. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
360 memcpy(dc->nonce, nonce, 16); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
361 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
362 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
363 /* Cancel any listen attempts because we don't need them. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
364 if (dc->listenfd_handle != 0) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
365 purple_input_remove(dc->listenfd_handle); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
366 dc->listenfd_handle = 0; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
367 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
368 if (dc->connect_timeout_handle != 0) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
369 purple_timeout_remove(dc->connect_timeout_handle); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
370 dc->connect_timeout_handle = 0; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
371 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
372 if (dc->listenfd != -1) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
373 purple_network_remove_port_mapping(dc->listenfd); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
374 close(dc->listenfd); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
375 dc->listenfd = -1; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
376 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
377 if (dc->listen_data != NULL) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
378 purple_network_listen_cancel(dc->listen_data); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
379 dc->listen_data = NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
380 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
381 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
382 /* Save external IP/port for later use. We'll try local connection first. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
383 dc->ext_ip = get_token(content, "IPv4External-Addrs: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
384 port_str = get_token(content, "IPv4External-Port: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
385 if (port_str) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
386 dc->ext_port = atoi(port_str); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
387 g_free(port_str); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
388 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
389 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
390 ip = get_token(content, "IPv4Internal-Addrs: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
391 port_str = get_token(content, "IPv4Internal-Port: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
392 if (port_str) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
393 port = atoi(port_str); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
394 g_free(port_str); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
395 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
396 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
397 if (ip && port) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
398 /* Try internal address first */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
399 dc->connect_data = purple_proxy_connect( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
400 NULL, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
401 slpcall->slplink->session->account, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
402 ip, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
403 port, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
404 msn_dc_connected_to_peer_cb, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
405 dc |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
406 ); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
407 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
408 if (dc->connect_data) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
409 /* Add connect timeout handle */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
410 dc->connect_timeout_handle = purple_timeout_add_seconds( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
411 DC_OUTGOING_TIMEOUT, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
412 msn_dc_outgoing_connection_timeout_cb, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
413 dc |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
414 ); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
415 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
416 /* |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
417 * Connection failed |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
418 * Try external IP/port (if specified) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
419 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
420 msn_dc_outgoing_connection_timeout_cb(dc); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
421 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
422 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
423 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
424 /* |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
425 * Omitted or invalid internal IP address / port |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
426 * Try external IP/port (if specified) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
427 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
428 msn_dc_outgoing_connection_timeout_cb(dc); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
429 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
430 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
431 g_free(ip); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
432 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
433 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
434 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
435 /* |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
436 * Invalid direct connect invitation or |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
437 * TCP connection is not supported |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
438 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
439 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
440 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
441 g_free(listening); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
442 g_free(nonce); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
443 g_free(bridge); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
444 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
445 return; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
446 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
447 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
448 static void |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
449 got_sessionreq(MsnSlpCall *slpcall, const char *branch, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
450 const char *euf_guid, const char *context) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
451 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
452 gboolean accepted = FALSE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
453 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
454 if (!strcmp(euf_guid, MSN_OBJ_GUID)) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
455 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
456 /* Emoticon or UserDisplay */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
457 char *content; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
458 gsize len; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
459 MsnSlpLink *slplink; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
460 MsnSlpMessage *slpmsg; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
461 MsnObject *obj; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
462 char *msnobj_data; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
463 PurpleStoredImage *img = NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
464 int type; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
465 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
466 /* Send Ok */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
467 content = g_strdup_printf("SessionID: %lu\r\n\r\n", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
468 slpcall->session_id); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
469 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
470 msn_slp_send_ok(slpcall, branch, "application/x-msnmsgr-sessionreqbody", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
471 content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
472 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
473 g_free(content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
474 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
475 slplink = slpcall->slplink; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
476 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
477 msnobj_data = (char *)purple_base64_decode(context, &len); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
478 obj = msn_object_new_from_string(msnobj_data); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
479 type = msn_object_get_type(obj); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
480 g_free(msnobj_data); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
481 if (type == MSN_OBJECT_EMOTICON) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
482 img = find_valid_emoticon(slplink->session->account, obj->location); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
483 } else if (type == MSN_OBJECT_USERTILE) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
484 img = msn_object_get_image(obj); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
485 if (img) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
486 purple_imgstore_ref(img); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
487 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
488 msn_object_destroy(obj); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
489 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
490 if (img != NULL) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
491 /* DATA PREP */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
492 slpmsg = msn_slpmsg_dataprep_new(slpcall); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
493 msn_slpmsg_set_slplink(slpmsg, slplink); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
494 msn_slplink_queue_slpmsg(slplink, slpmsg); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
495 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
496 /* DATA */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
497 slpmsg = msn_slpmsg_obj_new(slpcall, img); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
498 msn_slpmsg_set_slplink(slpmsg, slplink); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
499 msn_slplink_queue_slpmsg(slplink, slpmsg); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
500 purple_imgstore_unref(img); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
501 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
502 accepted = TRUE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
503 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
504 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
505 purple_debug_error("msn", "Wrong object.\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
506 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
507 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
508 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
509 else if (!strcmp(euf_guid, MSN_FT_GUID)) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
510 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
511 /* File Transfer */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
512 PurpleAccount *account; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
513 PurpleXfer *xfer; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
514 MsnFileContext *header; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
515 gsize bin_len; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
516 guint32 file_size; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
517 char *file_name; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
518 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
519 account = slpcall->slplink->session->account; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
520 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
521 slpcall->end_cb = msn_xfer_end_cb; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
522 slpcall->branch = g_strdup(branch); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
523 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
524 slpcall->pending = TRUE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
525 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
526 xfer = purple_xfer_new(account, PURPLE_XFER_RECEIVE, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
527 slpcall->slplink->remote_user); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
528 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
529 header = (MsnFileContext *)purple_base64_decode(context, &bin_len); |
31323
555862567b38
Manually propagate the fix for CVE-2010-3711.
masca@cpw.pidgin.im
parents:
31310
diff
changeset
|
530 if (header != NULL && bin_len >= sizeof(MsnFileContext) - 1 && |
31271
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
531 (header->version == 2 || |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
532 (header->version == 3 && header->length == sizeof(MsnFileContext) + 63))) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
533 file_size = GUINT64_FROM_LE(header->file_size); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
534 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
535 file_name = g_convert((const gchar *)&header->file_name, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
536 MAX_FILE_NAME_LEN * 2, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
537 "UTF-8", "UTF-16LE", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
538 NULL, NULL, NULL); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
539 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
540 purple_xfer_set_filename(xfer, file_name ? file_name : ""); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
541 g_free(file_name); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
542 purple_xfer_set_size(xfer, file_size); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
543 purple_xfer_set_init_fnc(xfer, msn_xfer_init); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
544 purple_xfer_set_request_denied_fnc(xfer, msn_xfer_cancel); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
545 purple_xfer_set_cancel_recv_fnc(xfer, msn_xfer_cancel); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
546 purple_xfer_set_read_fnc(xfer, msn_xfer_read); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
547 purple_xfer_set_write_fnc(xfer, msn_xfer_write); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
548 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
549 slpcall->u.incoming_data = g_byte_array_new(); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
550 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
551 slpcall->xfer = xfer; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
552 purple_xfer_ref(slpcall->xfer); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
553 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
554 xfer->data = slpcall; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
555 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
556 if (header->type == 0 && bin_len >= sizeof(MsnFileContext)) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
557 purple_xfer_set_thumbnail(xfer, &header->preview, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
558 bin_len - sizeof(MsnFileContext), |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
559 "image/png"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
560 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
561 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
562 purple_xfer_request(xfer); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
563 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
564 g_free(header); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
565 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
566 accepted = TRUE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
567 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
568 } else if (!strcmp(euf_guid, MSN_CAM_REQUEST_GUID)) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
569 purple_debug_info("msn", "Cam request.\n"); |
31348
b09ec659a9f5
slpcall is never NULL here.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31323
diff
changeset
|
570 if (slpcall->slplink && slpcall->slplink->session) { |
31271
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
571 PurpleConversation *conv; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
572 gchar *from = slpcall->slplink->remote_user; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
573 conv = purple_find_conversation_with_account( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
574 PURPLE_CONV_TYPE_IM, from, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
575 slpcall->slplink->session->account); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
576 if (conv) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
577 char *buf; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
578 buf = g_strdup_printf( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
579 _("%s requests to view your " |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
580 "webcam, but this request is " |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
581 "not yet supported."), from); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
582 purple_conversation_write(conv, NULL, buf, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
583 PURPLE_MESSAGE_SYSTEM | |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
584 PURPLE_MESSAGE_NOTIFY, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
585 time(NULL)); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
586 g_free(buf); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
587 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
588 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
589 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
590 } else if (!strcmp(euf_guid, MSN_CAM_GUID)) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
591 purple_debug_info("msn", "Cam invite.\n"); |
31348
b09ec659a9f5
slpcall is never NULL here.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31323
diff
changeset
|
592 if (slpcall->slplink && slpcall->slplink->session) { |
31271
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
593 PurpleConversation *conv; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
594 gchar *from = slpcall->slplink->remote_user; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
595 conv = purple_find_conversation_with_account( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
596 PURPLE_CONV_TYPE_IM, from, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
597 slpcall->slplink->session->account); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
598 if (conv) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
599 char *buf; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
600 buf = g_strdup_printf( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
601 _("%s invited you to view his/her webcam, but " |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
602 "this is not yet supported."), from); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
603 purple_conversation_write(conv, NULL, buf, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
604 PURPLE_MESSAGE_SYSTEM | |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
605 PURPLE_MESSAGE_NOTIFY, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
606 time(NULL)); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
607 g_free(buf); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
608 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
609 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
610 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
611 } else |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
612 purple_debug_warning("msn", "SLP SessionReq with unknown EUF-GUID: %s\n", euf_guid); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
613 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
614 if (!accepted) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
615 char *content = g_strdup_printf("SessionID: %lu\r\n\r\n", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
616 slpcall->session_id); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
617 msn_slp_send_decline(slpcall, branch, "application/x-msnmsgr-sessionreqbody", content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
618 g_free(content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
619 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
620 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
621 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
622 void |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
623 send_bye(MsnSlpCall *slpcall, const char *type) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
624 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
625 MsnSlpLink *slplink; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
626 PurpleAccount *account; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
627 MsnSlpMessage *slpmsg; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
628 char *header; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
629 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
630 slplink = slpcall->slplink; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
631 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
632 g_return_if_fail(slplink != NULL); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
633 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
634 account = slplink->session->account; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
635 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
636 header = g_strdup_printf("BYE MSNMSGR:%s MSNSLP/1.0", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
637 purple_account_get_username(account)); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
638 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
639 slpmsg = msn_slpmsg_sip_new(slpcall, 0, header, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
640 "A0D624A6-6C0C-4283-A9E0-BC97B4B46D32", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
641 type, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
642 "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
643 g_free(header); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
644 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
645 slpmsg->info = "SLP BYE"; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
646 slpmsg->text_body = TRUE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
647 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
648 msn_slplink_queue_slpmsg(slplink, slpmsg); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
649 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
650 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
651 static void |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
652 got_invite(MsnSlpCall *slpcall, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
653 const char *branch, const char *type, const char *content) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
654 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
655 MsnSlpLink *slplink; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
656 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
657 slplink = slpcall->slplink; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
658 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
659 if (!strcmp(type, "application/x-msnmsgr-sessionreqbody")) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
660 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
661 char *euf_guid, *context; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
662 char *temp; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
663 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
664 euf_guid = get_token(content, "EUF-GUID: {", "}\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
665 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
666 temp = get_token(content, "SessionID: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
667 if (temp != NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
668 slpcall->session_id = atoi(temp); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
669 g_free(temp); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
670 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
671 temp = get_token(content, "AppID: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
672 if (temp != NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
673 slpcall->app_id = atoi(temp); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
674 g_free(temp); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
675 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
676 context = get_token(content, "Context: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
677 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
678 if (context != NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
679 got_sessionreq(slpcall, branch, euf_guid, context); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
680 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
681 g_free(context); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
682 g_free(euf_guid); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
683 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
684 else if (!strcmp(type, "application/x-msnmsgr-transreqbody")) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
685 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
686 /* A direct connection negotiation request */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
687 char *bridges; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
688 char *nonce; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
689 MsnDirectConnNonceType ntype; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
690 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
691 purple_debug_info("msn", "got_invite: transreqbody received\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
692 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
693 /* Direct connections may be disabled. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
694 if (!purple_account_get_bool(slplink->session->account, "direct_connect", TRUE)) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
695 msn_slp_send_ok(slpcall, branch, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
696 "application/x-msnmsgr-transrespbody", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
697 "Bridge: TCPv1\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
698 "Listening: false\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
699 "Nonce: {00000000-0000-0000-0000-000000000000}\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
700 "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
701 msn_slpcall_session_init(slpcall); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
702 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
703 return; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
704 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
705 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
706 /* Don't do anything if we already have a direct connection */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
707 if (slplink->dc != NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
708 return; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
709 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
710 bridges = get_token(content, "Bridges: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
711 nonce = parse_dc_nonce(content, &ntype); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
712 if (bridges && strstr(bridges, "TCPv1") != NULL) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
713 /* |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
714 * Ok, the client supports direct TCP connection |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
715 * Try to create a listening port |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
716 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
717 MsnDirectConn *dc; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
718 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
719 dc = msn_dc_new(slpcall); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
720 if (ntype == DC_NONCE_PLAIN) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
721 /* There is only one nonce for plain auth. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
722 dc->nonce_type = ntype; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
723 memcpy(dc->nonce, nonce, 16); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
724 } else if (ntype == DC_NONCE_SHA1) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
725 /* Each side has a nonce in SHA1 auth. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
726 dc->nonce_type = ntype; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
727 strncpy(dc->remote_nonce, nonce, 36); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
728 dc->remote_nonce[36] = '\0'; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
729 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
730 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
731 dc->listen_data = purple_network_listen_range( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
732 0, 0, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
733 SOCK_STREAM, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
734 msn_dc_listen_socket_created_cb, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
735 dc |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
736 ); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
737 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
738 if (dc->listen_data == NULL) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
739 /* Listen socket creation failed */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
740 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
741 purple_debug_info("msn", "got_invite: listening failed\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
742 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
743 if (dc->nonce_type != DC_NONCE_PLAIN) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
744 msn_slp_send_ok(slpcall, branch, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
745 "application/x-msnmsgr-transrespbody", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
746 "Bridge: TCPv1\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
747 "Listening: false\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
748 "Hashed-Nonce: {00000000-0000-0000-0000-000000000000}\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
749 "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
750 else |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
751 msn_slp_send_ok(slpcall, branch, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
752 "application/x-msnmsgr-transrespbody", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
753 "Bridge: TCPv1\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
754 "Listening: false\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
755 "Nonce: {00000000-0000-0000-0000-000000000000}\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
756 "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
757 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
758 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
759 /* |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
760 * Listen socket created successfully. |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
761 * Don't send anything here because we don't know the parameters |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
762 * of the created socket yet. msn_dc_send_ok will be called from |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
763 * the callback function: dc_listen_socket_created_cb |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
764 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
765 purple_debug_info("msn", "got_invite: listening socket created\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
766 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
767 dc->send_connection_info_msg_cb = msn_dc_send_ok; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
768 slpcall->wait_for_socket = TRUE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
769 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
770 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
771 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
772 /* |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
773 * Invalid direct connect invitation or |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
774 * TCP connection is not supported. |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
775 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
776 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
777 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
778 g_free(nonce); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
779 g_free(bridges); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
780 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
781 else if (!strcmp(type, "application/x-msnmsgr-transrespbody")) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
782 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
783 /* A direct connection negotiation response */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
784 msn_slp_process_transresp(slpcall, content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
785 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
786 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
787 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
788 static void |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
789 got_ok(MsnSlpCall *slpcall, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
790 const char *type, const char *content) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
791 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
792 g_return_if_fail(slpcall != NULL); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
793 g_return_if_fail(type != NULL); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
794 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
795 if (!strcmp(type, "application/x-msnmsgr-sessionreqbody")) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
796 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
797 char *content; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
798 char *header; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
799 char *nonce = NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
800 MsnSession *session = slpcall->slplink->session; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
801 MsnSlpMessage *msg; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
802 MsnDirectConn *dc; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
803 MsnUser *user; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
804 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
805 if (!purple_account_get_bool(session->account, "direct_connect", TRUE)) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
806 /* Don't attempt a direct connection if disabled. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
807 msn_slpcall_session_init(slpcall); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
808 return; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
809 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
810 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
811 if (slpcall->slplink->dc != NULL) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
812 /* If we already have an established direct connection |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
813 * then just start the transfer. |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
814 */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
815 msn_slpcall_session_init(slpcall); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
816 return; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
817 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
818 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
819 user = msn_userlist_find_user(session->userlist, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
820 slpcall->slplink->remote_user); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
821 if (!user || !(user->clientid & 0xF0000000)) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
822 /* Just start a normal SB transfer. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
823 msn_slpcall_session_init(slpcall); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
824 return; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
825 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
826 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
827 /* Try direct file transfer by sending a second INVITE */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
828 dc = msn_dc_new(slpcall); |
31376
2de522fa534a
Fix a lot more leaks, some old, some new.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31348
diff
changeset
|
829 g_free(slpcall->branch); |
31271
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
830 slpcall->branch = rand_guid(); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
831 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
832 dc->listen_data = purple_network_listen_range( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
833 0, 0, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
834 SOCK_STREAM, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
835 msn_dc_listen_socket_created_cb, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
836 dc |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
837 ); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
838 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
839 header = g_strdup_printf( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
840 "INVITE MSNMSGR:%s MSNSLP/1.0", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
841 slpcall->slplink->remote_user |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
842 ); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
843 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
844 if (dc->nonce_type == DC_NONCE_SHA1) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
845 nonce = g_strdup_printf("Hashed-Nonce: {%s}\r\n", dc->nonce_hash); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
846 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
847 if (dc->listen_data == NULL) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
848 /* Listen socket creation failed */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
849 purple_debug_info("msn", "got_ok: listening failed\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
850 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
851 content = g_strdup_printf( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
852 "Bridges: TCPv1\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
853 "NetID: %u\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
854 "Conn-Type: IP-Restrict-NAT\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
855 "UPnPNat: false\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
856 "ICF: false\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
857 "%s" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
858 "\r\n", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
859 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
860 rand() % G_MAXUINT32, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
861 nonce ? nonce : "" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
862 ); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
863 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
864 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
865 /* Listen socket created successfully. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
866 purple_debug_info("msn", "got_ok: listening socket created\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
867 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
868 content = g_strdup_printf( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
869 "Bridges: TCPv1\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
870 "NetID: 0\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
871 "Conn-Type: Direct-Connect\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
872 "UPnPNat: false\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
873 "ICF: false\r\n" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
874 "%s" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
875 "\r\n", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
876 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
877 nonce ? nonce : "" |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
878 ); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
879 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
880 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
881 msg = msn_slpmsg_sip_new( |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
882 slpcall, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
883 0, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
884 header, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
885 slpcall->branch, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
886 "application/x-msnmsgr-transreqbody", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
887 content |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
888 ); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
889 msg->info = "DC INVITE"; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
890 msg->text_body = TRUE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
891 g_free(nonce); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
892 g_free(header); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
893 g_free(content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
894 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
895 msn_slplink_queue_slpmsg(slpcall->slplink, msg); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
896 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
897 else if (!strcmp(type, "application/x-msnmsgr-transreqbody")) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
898 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
899 /* Do we get this? */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
900 purple_debug_info("msn", "OK with transreqbody\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
901 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
902 else if (!strcmp(type, "application/x-msnmsgr-transrespbody")) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
903 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
904 msn_slp_process_transresp(slpcall, content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
905 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
906 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
907 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
908 static void |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
909 got_error(MsnSlpCall *slpcall, |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
910 const char *error, const char *type, const char *content) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
911 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
912 /* It's not valid. Kill this off. */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
913 purple_debug_error("msn", "Received non-OK result: %s\n", |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
914 error ? error : "Unknown"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
915 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
916 if (type && !strcmp(type, "application/x-msnmsgr-transreqbody")) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
917 MsnDirectConn *dc = slpcall->slplink->dc; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
918 if (dc) { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
919 msn_dc_fallback_to_sb(dc); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
920 return; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
921 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
922 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
923 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
924 slpcall->wasted = TRUE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
925 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
926 |
31272
25a8e3ad7e30
Remove this prototipe and make the function static since it is not exposed anymore.
masca@cpw.pidgin.im
parents:
31271
diff
changeset
|
927 static MsnSlpCall * |
31271
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
928 msn_slp_sip_recv(MsnSlpLink *slplink, const char *body) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
929 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
930 MsnSlpCall *slpcall; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
931 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
932 if (body == NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
933 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
934 purple_debug_warning("msn", "received bogus message\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
935 return NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
936 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
937 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
938 if (!strncmp(body, "INVITE", strlen("INVITE"))) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
939 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
940 /* This is an INVITE request */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
941 char *branch; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
942 char *call_id; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
943 char *content; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
944 char *content_type; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
945 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
946 /* From: <msnmsgr:buddy@hotmail.com> */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
947 #if 0 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
948 slpcall->remote_user = get_token(body, "From: <msnmsgr:", ">\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
949 #endif |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
950 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
951 branch = get_token(body, ";branch={", "}"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
952 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
953 call_id = get_token(body, "Call-ID: {", "}"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
954 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
955 #if 0 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
956 long content_len = -1; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
957 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
958 temp = get_token(body, "Content-Length: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
959 if (temp != NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
960 content_len = atoi(temp); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
961 g_free(temp); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
962 #endif |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
963 content_type = get_token(body, "Content-Type: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
964 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
965 content = get_token(body, "\r\n\r\n", NULL); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
966 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
967 slpcall = NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
968 if (branch && call_id) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
969 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
970 slpcall = msn_slplink_find_slp_call(slplink, call_id); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
971 if (slpcall) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
972 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
973 g_free(slpcall->branch); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
974 slpcall->branch = g_strdup(branch); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
975 got_invite(slpcall, branch, content_type, content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
976 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
977 else if (content_type && content) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
978 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
979 slpcall = msn_slpcall_new(slplink); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
980 slpcall->id = g_strdup(call_id); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
981 got_invite(slpcall, branch, content_type, content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
982 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
983 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
984 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
985 g_free(call_id); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
986 g_free(branch); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
987 g_free(content_type); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
988 g_free(content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
989 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
990 else if (!strncmp(body, "MSNSLP/1.0 ", strlen("MSNSLP/1.0 "))) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
991 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
992 /* This is a response */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
993 char *content; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
994 char *content_type; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
995 /* Make sure this is "OK" */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
996 const char *status = body + strlen("MSNSLP/1.0 "); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
997 char *call_id; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
998 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
999 call_id = get_token(body, "Call-ID: {", "}"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1000 slpcall = msn_slplink_find_slp_call(slplink, call_id); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1001 g_free(call_id); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1002 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1003 g_return_val_if_fail(slpcall != NULL, NULL); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1004 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1005 content_type = get_token(body, "Content-Type: ", "\r\n"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1006 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1007 content = get_token(body, "\r\n\r\n", NULL); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1008 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1009 if (strncmp(status, "200 OK", 6)) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1010 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1011 char *error = NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1012 const char *c; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1013 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1014 /* Eww */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1015 if ((c = strchr(status, '\r')) || (c = strchr(status, '\n')) || |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1016 (c = strchr(status, '\0'))) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1017 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1018 size_t len = c - status; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1019 error = g_strndup(status, len); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1020 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1021 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1022 got_error(slpcall, error, content_type, content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1023 g_free(error); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1024 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1025 } else { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1026 /* Everything's just dandy */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1027 got_ok(slpcall, content_type, content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1028 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1029 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1030 g_free(content_type); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1031 g_free(content); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1032 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1033 else if (!strncmp(body, "BYE", strlen("BYE"))) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1034 { |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1035 /* This is a BYE request */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1036 char *call_id; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1037 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1038 call_id = get_token(body, "Call-ID: {", "}"); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1039 slpcall = msn_slplink_find_slp_call(slplink, call_id); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1040 g_free(call_id); |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1041 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1042 if (slpcall != NULL) |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1043 slpcall->wasted = TRUE; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1044 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1045 /* msn_slpcall_destroy(slpcall); */ |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1046 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1047 else |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1048 slpcall = NULL; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1049 |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1050 return slpcall; |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1051 } |
b0c8b85265b4
Move slp parsing and answering code down the stack to SlpCall. This simplify a lot slp.c.
masca@cpw.pidgin.im
parents:
31214
diff
changeset
|
1052 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1053 MsnSlpCall * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1054 msn_slp_process_msg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1055 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1056 MsnSlpCall *slpcall; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1057 const guchar *body; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1058 gsize body_len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1059 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1060 slpcall = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1061 body = slpmsg->buffer; |
31301
16ab805406d1
Get rid of the offset field in the SlpMessage in favor of the one in the Header.
masca@cpw.pidgin.im
parents:
31293
diff
changeset
|
1062 body_len = slpmsg->header->offset; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1063 |
31417
f26e961e1274
Fix the name of this flag.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31376
diff
changeset
|
1064 if (slpmsg->header->flags == P2P_NO_FLAG || slpmsg->header->flags == P2P_WLM2009_COMP) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1065 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1066 char *body_str; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1067 |
31293
6814678f3c63
Remove session_id from SlpMsg and use the one from the header.
masca@cpw.pidgin.im
parents:
31282
diff
changeset
|
1068 if (slpmsg->header->session_id == 64) |
27374
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1069 { |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1070 /* This is for handwritten messages (Ink) */ |
28431
500d1e806264
So apparently, I messed up the name of this charset. But I wonder why it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28156
diff
changeset
|
1071 GError *error = NULL; |
28093
4362f871369c
Using g_convert instead of g_utf16_to_utf8 so that we can explicitly set
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27509
diff
changeset
|
1072 gsize bytes_read, bytes_written; |
27374
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1073 |
28094
a82fec14ac0f
Fix the warnings.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28093
diff
changeset
|
1074 body_str = g_convert((const gchar *)body, body_len / 2, |
28156
0cd438c47ab3
THis conversion specifier is incorrect.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28099
diff
changeset
|
1075 "UTF-8", "UTF-16LE", |
28093
4362f871369c
Using g_convert instead of g_utf16_to_utf8 so that we can explicitly set
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27509
diff
changeset
|
1076 &bytes_read, &bytes_written, &error); |
4362f871369c
Using g_convert instead of g_utf16_to_utf8 so that we can explicitly set
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27509
diff
changeset
|
1077 body_len -= bytes_read + 2; |
4362f871369c
Using g_convert instead of g_utf16_to_utf8 so that we can explicitly set
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27509
diff
changeset
|
1078 body += bytes_read + 2; |
27374
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1079 if (body_str == NULL |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1080 || body_len <= 0 |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1081 || strstr(body_str, "image/gif") == NULL) |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1082 { |
28099
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1083 if (error != NULL) { |
27374
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1084 purple_debug_error("msn", |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1085 "Unable to convert Ink header from UTF-16 to UTF-8: %s\n", |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1086 error->message); |
28099
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1087 g_error_free(error); |
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1088 } |
27374
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1089 else |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1090 purple_debug_error("msn", |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1091 "Received Ink in unknown format\n"); |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1092 g_free(body_str); |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1093 return NULL; |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1094 } |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1095 g_free(body_str); |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1096 |
28094
a82fec14ac0f
Fix the warnings.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28093
diff
changeset
|
1097 body_str = g_convert((const gchar *)body, body_len / 2, |
28431
500d1e806264
So apparently, I messed up the name of this charset. But I wonder why it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28156
diff
changeset
|
1098 "UTF-8", "UTF-16LE", |
28093
4362f871369c
Using g_convert instead of g_utf16_to_utf8 so that we can explicitly set
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27509
diff
changeset
|
1099 &bytes_read, &bytes_written, &error); |
27374
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1100 if (!body_str) |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1101 { |
28099
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1102 if (error != NULL) { |
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1103 purple_debug_error("msn", |
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1104 "Unable to convert Ink body from UTF-16 to UTF-8: %s\n", |
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1105 error->message); |
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1106 g_error_free(error); |
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1107 } |
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1108 else |
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1109 purple_debug_error("msn", |
080cfd84038c
Don't leak the GError from g_convert.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28095
diff
changeset
|
1110 "Received Ink in unknown format\n"); |
27374
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1111 return NULL; |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1112 } |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1113 |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1114 msn_switchboard_show_ink(slpmsg->slplink->swboard, |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1115 slplink->remote_user, |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1116 body_str); |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1117 } |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1118 else |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1119 { |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1120 body_str = g_strndup((const char *)body, body_len); |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1121 slpcall = msn_slp_sip_recv(slplink, body_str); |
a6d84d9de605
Add support for receiving handwritten (Ink) messages from MSN buddies.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25169
diff
changeset
|
1122 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1123 g_free(body_str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1124 } |
31308
d9ca3798faa5
Get rid of the Flags field in the SlpMessage in favor of the one in the Header.
masca@cpw.pidgin.im
parents:
31306
diff
changeset
|
1125 else if (msn_p2p_msg_is_data(slpmsg->header->flags)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1126 { |
31293
6814678f3c63
Remove session_id from SlpMsg and use the one from the header.
masca@cpw.pidgin.im
parents:
31282
diff
changeset
|
1127 slpcall = msn_slplink_find_slp_call_with_session_id(slplink, slpmsg->header->session_id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1128 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1129 if (slpcall != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1130 { |
25072
5fd2102643d5
Avoid canceling this timer twice
Mark Doliner <mark@kingant.net>
parents:
24971
diff
changeset
|
1131 if (slpcall->timer) { |
15823 | 1132 purple_timeout_remove(slpcall->timer); |
25072
5fd2102643d5
Avoid canceling this timer twice
Mark Doliner <mark@kingant.net>
parents:
24971
diff
changeset
|
1133 slpcall->timer = 0; |
5fd2102643d5
Avoid canceling this timer twice
Mark Doliner <mark@kingant.net>
parents:
24971
diff
changeset
|
1134 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1135 |
29073
59b0c556f787
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <paul@darkrain42.org>
parents:
28431
diff
changeset
|
1136 if (slpcall->cb) |
59b0c556f787
A quick and dirty hack to make MSN use the in-core code to perform FT.
Paul Aurich <paul@darkrain42.org>
parents:
28431
diff
changeset
|
1137 slpcall->cb(slpcall, body, body_len); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1138 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1139 slpcall->wasted = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1140 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1141 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1142 #if 0 |
31308
d9ca3798faa5
Get rid of the Flags field in the SlpMessage in favor of the one in the Header.
masca@cpw.pidgin.im
parents:
31306
diff
changeset
|
1143 else if (slpmsg->header->flags == 0x100) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1144 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1145 slpcall = slplink->directconn->initial_call; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1146 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1147 if (slpcall != NULL) |
24341
b27908701f66
For some reason the slpmsg and slplink functions don't have underscores
Mark Doliner <mark@kingant.net>
parents:
24340
diff
changeset
|
1148 msn_slpcall_session_init(slpcall); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1149 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1150 #endif |
31308
d9ca3798faa5
Get rid of the Flags field in the SlpMessage in favor of the one in the Header.
masca@cpw.pidgin.im
parents:
31306
diff
changeset
|
1151 else if (slpmsg->header->flags == P2P_ACK) |
24971
859e5b3f5c47
On MSN, don't print an "unknown" message for SLP acknowledgement messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24967
diff
changeset
|
1152 { |
859e5b3f5c47
On MSN, don't print an "unknown" message for SLP acknowledgement messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24967
diff
changeset
|
1153 /* Acknowledgement of previous message. Don't do anything currently. */ |
859e5b3f5c47
On MSN, don't print an "unknown" message for SLP acknowledgement messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24967
diff
changeset
|
1154 } |
24967
5e77f8512f5b
Report a debug warning if a SLP MSG is not processed because it has unknown
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24965
diff
changeset
|
1155 else |
31310
c209701a3152
Fix a warning about the size of the flags and avoi displaying trialing 0 that will not be used.
masca@cpw.pidgin.im
parents:
31308
diff
changeset
|
1156 purple_debug_warning("msn", "Unprocessed SLP message with flags 0x%04x\n", |
31308
d9ca3798faa5
Get rid of the Flags field in the SlpMessage in favor of the one in the Header.
masca@cpw.pidgin.im
parents:
31306
diff
changeset
|
1157 slpmsg->header->flags); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1158 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1159 return slpcall; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1160 } |