annotate libpurple/protocols/msn/xfer.c @ 30969:72e6fa6caecc

These new files are missing GPL headers. And fix a couple incorrect names in there.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 27 Nov 2010 07:56:27 +0000
parents eabeba9c823f
children b4064198e017
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: 30832
diff changeset
1 /**
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
2 * @file xfer.c MSN File Transfer functions
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
3 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
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: 30832
diff changeset
5 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
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: 30832
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: 30832
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: 30832
diff changeset
9 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
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: 30832
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: 30832
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: 30832
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: 30832
diff changeset
14 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
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: 30832
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: 30832
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: 30832
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: 30832
diff changeset
19 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
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: 30832
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: 30832
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: 30832
diff changeset
23 */
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
24
30832
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
25 #include "internal.h"
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
26 #include "debug.h"
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
27
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
28 #include "sbconn.h"
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
29 #include "xfer.h"
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
30
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
31 /**************************************************************************
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
32 * Xfer
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
33 **************************************************************************/
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
34
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
35 void
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
36 msn_xfer_init(PurpleXfer *xfer)
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
37 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
38 MsnSlpCall *slpcall;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
39 /* MsnSlpLink *slplink; */
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
40 char *content;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
41
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
42 purple_debug_info("msn", "xfer_init\n");
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
43
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
44 slpcall = xfer->data;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
45
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
46 /* Send Ok */
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
47 content = g_strdup_printf("SessionID: %lu\r\n\r\n",
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
48 slpcall->session_id);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
49
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
50 msn_slp_send_ok(slpcall, slpcall->branch, "application/x-msnmsgr-sessionreqbody",
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
51 content);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
52
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
53 g_free(content);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
54 msn_slplink_send_queued_slpmsgs(slpcall->slplink);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
55 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
56
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
57 void
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
58 msn_xfer_cancel(PurpleXfer *xfer)
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
59 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
60 MsnSlpCall *slpcall;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
61 char *content;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
62
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
63 g_return_if_fail(xfer != NULL);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
64 g_return_if_fail(xfer->data != NULL);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
65
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
66 slpcall = xfer->data;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
67
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
68 if (purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL)
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
69 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
70 if (slpcall->started)
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
71 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
72 msn_slpcall_close(slpcall);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
73 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
74 else
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
75 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
76 content = g_strdup_printf("SessionID: %lu\r\n\r\n",
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
77 slpcall->session_id);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
78
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
79 msn_slp_send_decline(slpcall, slpcall->branch, "application/x-msnmsgr-sessionreqbody",
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
80 content);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
81
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
82 g_free(content);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
83 msn_slplink_send_queued_slpmsgs(slpcall->slplink);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
84
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
85 if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND)
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
86 slpcall->wasted = TRUE;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
87 else
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
88 msn_slpcall_destroy(slpcall);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
89 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
90 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
91 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
92
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
93 gssize
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
94 msn_xfer_write(const guchar *data, gsize len, PurpleXfer *xfer)
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
95 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
96 MsnSlpCall *slpcall;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
97
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
98 g_return_val_if_fail(xfer != NULL, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
99 g_return_val_if_fail(data != NULL, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
100 g_return_val_if_fail(len > 0, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
101
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
102 g_return_val_if_fail(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
103
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
104 slpcall = xfer->data;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
105 /* Not sure I trust it'll be there */
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
106 g_return_val_if_fail(slpcall != NULL, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
107
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
108 g_return_val_if_fail(slpcall->xfer_msg != NULL, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
109
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
110 slpcall->u.outgoing.len = len;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
111 slpcall->u.outgoing.data = data;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
112 msn_slplink_send_msgpart(slpcall->slplink, slpcall->xfer_msg);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
113
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
114 return MIN(MSN_SBCONN_MAX_SIZE, len);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
115 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
116
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
117 gssize
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
118 msn_xfer_read(guchar **data, PurpleXfer *xfer)
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
119 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
120 MsnSlpCall *slpcall;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
121 gsize len;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
122
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
123 g_return_val_if_fail(xfer != NULL, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
124 g_return_val_if_fail(data != NULL, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
125
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
126 g_return_val_if_fail(purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
127
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
128 slpcall = xfer->data;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
129 /* Not sure I trust it'll be there */
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
130 g_return_val_if_fail(slpcall != NULL, -1);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
131
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
132 /* Just pass up the whole GByteArray. We'll make another. */
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
133 *data = slpcall->u.incoming_data->data;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
134 len = slpcall->u.incoming_data->len;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
135
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
136 g_byte_array_free(slpcall->u.incoming_data, FALSE);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
137 slpcall->u.incoming_data = g_byte_array_new();
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
138
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
139 return len;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
140 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
141
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
142 void
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
143 msn_xfer_end_cb(MsnSlpCall *slpcall, MsnSession *session)
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
144 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
145 if ((purple_xfer_get_status(slpcall->xfer) != PURPLE_XFER_STATUS_DONE) &&
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
146 (purple_xfer_get_status(slpcall->xfer) != PURPLE_XFER_STATUS_CANCEL_REMOTE) &&
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
147 (purple_xfer_get_status(slpcall->xfer) != PURPLE_XFER_STATUS_CANCEL_LOCAL))
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
148 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
149 purple_xfer_cancel_remote(slpcall->xfer);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
150 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
151 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
152
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
153 void
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
154 msn_xfer_completed_cb(MsnSlpCall *slpcall, const guchar *body,
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
155 gsize size)
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
156 {
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
157 PurpleXfer *xfer = slpcall->xfer;
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
158
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
159 purple_xfer_set_completed(xfer, TRUE);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
160 purple_xfer_end(xfer);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
161 }
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
162