annotate libpurple/protocols/msn/slpmsg_part.c @ 32247:1a2840d2cd02

Fix for previous commit.
author andrew.victor@mxit.com
date Sat, 01 Oct 2011 21:11:11 +0000
parents 9a23c70bdb7a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30969
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
1 /**
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
2 * @file slpmsg_part.c MSNSLP Parts
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
3 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
4 * purple
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
5 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
8 * source distribution.
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
9 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
10 * This program is free software; you can redistribute it and/or modify
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
11 * it under the terms of the GNU General Public License as published by
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
13 * (at your option) any later version.
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
14 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
15 * This program is distributed in the hope that it will be useful,
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
18 * GNU General Public License for more details.
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
19 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
20 * You should have received a copy of the GNU General Public License
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
21 * along with this program; if not, write to the Free Software
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
23 */
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30947
diff changeset
24
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
25 #include "internal.h"
30849
e358e16e527f Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents: 30847
diff changeset
26 #include "debug.h"
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
27
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
28 #include "slpmsg.h"
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
29 #include "slpmsg_part.h"
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
30
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
31 MsnSlpMessagePart *msn_slpmsgpart_new(MsnP2PInfo *info)
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
32 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
33 MsnSlpMessagePart *part;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
34
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
35 part = g_new0(MsnSlpMessagePart, 1);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
36
31319
8cf9270acf4c Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31268
diff changeset
37 part->info = info;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
38
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
39 part->ack_cb = msn_slpmsgpart_ack;
30822
e0dd17804079 Fix typo.
masca@cpw.pidgin.im
parents: 30796
diff changeset
40 part->nak_cb = msn_slpmsgpart_nak;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
41
30847
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
42 return msn_slpmsgpart_ref(part);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
43 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
44
31577
9a23c70bdb7a Get the P2P version based on the user. Still hard-coded as v1 though.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31569
diff changeset
45 MsnSlpMessagePart *
9a23c70bdb7a Get the P2P version based on the user. Still hard-coded as v1 though.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31569
diff changeset
46 msn_slpmsgpart_new_from_data(MsnP2PVersion p2p, const char *data, size_t data_len)
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
47 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
48 MsnSlpMessagePart *part;
31319
8cf9270acf4c Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31268
diff changeset
49 MsnP2PInfo *info;
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
50 size_t len;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
51 int body_len;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
52
31577
9a23c70bdb7a Get the P2P version based on the user. Still hard-coded as v1 though.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31569
diff changeset
53 info = msn_p2p_info_new(p2p);
31319
8cf9270acf4c Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31268
diff changeset
54
8cf9270acf4c Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31268
diff changeset
55 /* Extract the binary SLP header */
8cf9270acf4c Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31268
diff changeset
56 len = msn_p2p_header_from_wire(info, data, data_len);
8cf9270acf4c Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31268
diff changeset
57 if (len == 0) {
8cf9270acf4c Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31268
diff changeset
58 msn_p2p_info_free(info);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
59 return NULL;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
60 }
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
61 data += len;
31319
8cf9270acf4c Add a maximum length when parsing the P2P wire data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31268
diff changeset
62 part = msn_slpmsgpart_new(info);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
63
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
64 /* Extract the body */
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
65 body_len = data_len - len - P2P_PACKET_FOOTER_SIZE;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
66 /* msg->body_len = msg->msnslp_header.length; */
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
67
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
68 if (body_len > 0) {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
69 part->size = body_len;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
70 part->buffer = g_malloc(body_len);
31045
f91501dc406e Remove extra variables, and this sizeof() is wrong.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31044
diff changeset
71 memcpy(part->buffer, data, body_len);
f91501dc406e Remove extra variables, and this sizeof() is wrong.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31044
diff changeset
72 data += body_len;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
73 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
74
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
75 /* Extract the footer */
31086
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 31045
diff changeset
76 if (body_len >= 0)
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
77 msn_p2p_footer_from_wire(part->info, data);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
78
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
79 return part;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
80 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
81
31036
05e05d96ba75 Use the unref functions everywhere, instead of destroy. I also removed
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31031
diff changeset
82 static void msn_slpmsgpart_destroy(MsnSlpMessagePart *part)
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
83 {
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
84 g_free(part->info);
31094
120703c0a0dd Free the buffer with the SlpMsgPart. Should fix a few leaks from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31086
diff changeset
85 g_free(part->buffer);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
86
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
87 g_free(part);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
88
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
89 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
90
30847
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
91 MsnSlpMessagePart *msn_slpmsgpart_ref(MsnSlpMessagePart *part)
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
92 {
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
93 g_return_val_if_fail(part != NULL, NULL);
31031
61db10475bed As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
94 part->ref_count++;
30847
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
95
30849
e358e16e527f Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents: 30847
diff changeset
96 if (purple_debug_is_verbose())
31031
61db10475bed As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
97 purple_debug_info("msn", "part ref (%p)[%u]\n", part, part->ref_count);
30849
e358e16e527f Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents: 30847
diff changeset
98
30847
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
99 return part;
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
100 }
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
101
31031
61db10475bed As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
102 void msn_slpmsgpart_unref(MsnSlpMessagePart *part)
30847
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
103 {
31031
61db10475bed As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
104 g_return_if_fail(part != NULL);
61db10475bed As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
105 g_return_if_fail(part->ref_count > 0);
30847
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
106
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
107 part->ref_count--;
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
108
30849
e358e16e527f Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents: 30847
diff changeset
109 if (purple_debug_is_verbose())
31031
61db10475bed As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
110 purple_debug_info("msn", "part unref (%p)[%u]\n", part, part->ref_count);
30849
e358e16e527f Add a ref to the part at sbconn and add some debug output.
masca@cpw.pidgin.im
parents: 30847
diff changeset
111
30847
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
112 if (part->ref_count == 0) {
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
113 msn_slpmsgpart_destroy(part);
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
114 }
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
115 }
74c4aa38adfc Add support to ref/unref SlpMessageParts.
masca@cpw.pidgin.im
parents: 30843
diff changeset
116
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
117 void msn_slpmsgpart_set_bin_data(MsnSlpMessagePart *part, const void *data, size_t len)
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
118 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
119 g_return_if_fail(part != NULL);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
120
30935
2de522fa534a Fix a lot more leaks, some old, some new.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30934
diff changeset
121 g_free(part->buffer);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
122
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
123 if (data != NULL && len > 0) {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
124 part->buffer = g_malloc(len + 1);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
125 memcpy(part->buffer, data, len);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
126 part->buffer[len] = '\0';
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
127 part->size = len;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
128 } else {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
129 part->buffer = NULL;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
130 part->size = 0;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
131 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
132
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
133 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
134
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
135 char *msn_slpmsgpart_serialize(MsnSlpMessagePart *part, size_t *ret_size)
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
136 {
31044
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31037
diff changeset
137 char *header;
7b771e6f1142 Change SLP P2P functions to use the new buffer access functions
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31037
diff changeset
138 char *footer;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
139 char *base;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
140 char *tmp;
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
141 size_t header_size, footer_size;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
142
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
143 header = msn_p2p_header_to_wire(part->info, &header_size);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
144 footer = msn_p2p_footer_to_wire(part->info, &footer_size);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
145
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
146 base = g_malloc(header_size + part->size + footer_size);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
147 tmp = base;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
148
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
149 /* Copy header */
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
150 memcpy(tmp, header, header_size);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
151 tmp += header_size;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
152
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
153 /* Copy body */
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
154 memcpy(tmp, part->buffer, part->size);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
155 tmp += part->size;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
156
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
157 /* Copy footer */
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
158 memcpy(tmp, footer, footer_size);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
159 tmp += footer_size;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
160
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
161 *ret_size = tmp - base;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
162
30934
4e097dfb7784 Fix some leaks. Header and footer are allocated, copied and not freed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30873
diff changeset
163 g_free(header);
4e097dfb7784 Fix some leaks. Header and footer are allocated, copied and not freed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30873
diff changeset
164 g_free(footer);
4e097dfb7784 Fix some leaks. Header and footer are allocated, copied and not freed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30873
diff changeset
165
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
166 return base;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
167 }
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
168
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
169 /* We have received the message ack */
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
170 void
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
171 msn_slpmsgpart_ack(MsnSlpMessagePart *part, void *data)
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
172 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
173 MsnSlpMessage *slpmsg;
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
174 guint64 offset;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
175 long long real_size;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
176
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
177 slpmsg = data;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
178
31569
eb1bbaae3427 Try to hide msn_p2p_info_get_flags as much as possible, since it may
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31319
diff changeset
179 real_size = msn_p2p_info_is_ack(slpmsg->p2p_info) ? 0 : slpmsg->size;
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
180
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
181 offset = msn_p2p_info_get_offset(slpmsg->p2p_info);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
182 offset += msn_p2p_info_get_length(part->info);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
183 msn_p2p_info_set_offset(slpmsg->p2p_info, offset);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
184
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
185 slpmsg->parts = g_list_remove(slpmsg->parts, part);
31037
0d5e038911a7 Correct the ref counts on the SlpMsgParts. When it's removed from the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31036
diff changeset
186 msn_slpmsgpart_unref(part);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
187
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
188 if (offset < real_size)
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
189 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
190 if (slpmsg->slpcall->xfer && purple_xfer_get_status(slpmsg->slpcall->xfer) == PURPLE_XFER_STATUS_STARTED)
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
191 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
192 slpmsg->slpcall->xfer_msg = slpmsg;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
193 purple_xfer_prpl_ready(slpmsg->slpcall->xfer);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
194 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
195 else
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
196 msn_slplink_send_msgpart(slpmsg->slplink, slpmsg);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
197 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
198 else
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
199 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
200 /* The whole message has been sent */
31569
eb1bbaae3427 Try to hide msn_p2p_info_get_flags as much as possible, since it may
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31319
diff changeset
201 if (msn_p2p_msg_is_data(slpmsg->p2p_info))
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
202 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
203 if (slpmsg->slpcall != NULL)
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
204 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
205 if (slpmsg->slpcall->cb)
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
206 slpmsg->slpcall->cb(slpmsg->slpcall,
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
207 NULL, 0);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
208 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
209 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
210 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
211 }
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
212
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
213 /* We have received the message nak. */
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
214 void
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
215 msn_slpmsgpart_nak(MsnSlpMessagePart *part, void *data)
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
216 {
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
217 MsnSlpMessage *slpmsg;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
218
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
219 slpmsg = data;
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
220
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
221 msn_slplink_send_msgpart(slpmsg->slplink, slpmsg);
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
222
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
223 slpmsg->parts = g_list_remove(slpmsg->parts, part);
31037
0d5e038911a7 Correct the ref counts on the SlpMsgParts. When it's removed from the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31036
diff changeset
224 msn_slpmsgpart_unref(part);
30796
e545b2b6f66a Introduce SlpMessagePart, It will replace MsnMessage in every Slp related code so MsnMessage just get used where it makes sense, in the Switchboard.
masca@cpw.pidgin.im
parents:
diff changeset
225 }
31031
61db10475bed As Mark did before, we probably don't need a return value from these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
226
31151
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
227 void
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
228 msn_slpmsgpart_to_string(MsnSlpMessagePart *part, GString *str)
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
229 {
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
230 msn_p2p_info_to_string(part->info, str);
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
231 }
34da321b60f1 Try to hide all P2P fields away behind accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31143
diff changeset
232