Thu, 07 Aug 2025 21:32:18 -0500
Clean up and modernize PurpleImage
Testing Done:
Ran the tests under valgrind and called in the turtles.
Reviewed at https://reviews.imfreedom.org/r/4074/
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
12 | * any later version. |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
17 | * more details. |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42387
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | # error "only <purple.h> may be included directly" |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #endif |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #ifndef PURPLE_PROTOCOL_FILE_TRANSFER_H |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #define PURPLE_PROTOCOL_FILE_TRANSFER_H |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | #include <glib.h> |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | #include <glib-object.h> |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | #include "purplefiletransfer.h" |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | #include "purpleprotocol.h" |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42375
diff
changeset
|
35 | #include "purpleversion.h" |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | #define PURPLE_TYPE_PROTOCOL_FILE_TRANSFER (purple_protocol_file_transfer_get_type()) |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42375
diff
changeset
|
38 | |
|
42821
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
39 | /** |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
40 | * PURPLE_PROTOCOL_FILE_TRANSFER_ERROR: |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
41 | * |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
42 | * A constant for protocol file transfer errors. |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
43 | * |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
44 | * Since: 3.0 |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
45 | */ |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
46 | #define PURPLE_PROTOCOL_FILE_TRANSFER_ERROR \ |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
47 | (g_quark_from_static_string("purple-protocol-file-transfer")) \ |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
48 | PURPLE_AVAILABLE_MACRO_IN_3_0 |
|
4032fe617b2a
Use GTask.report_new_error in Purple.ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
42656
diff
changeset
|
49 | |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42375
diff
changeset
|
50 | PURPLE_AVAILABLE_IN_3_0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | G_DECLARE_INTERFACE(PurpleProtocolFileTransfer, |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | purple_protocol_file_transfer, PURPLE, |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | PROTOCOL_FILE_TRANSFER, PurpleProtocol) |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | /** |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | * PurpleProtocolFileTransfer: |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | * #PurpleProtocolFileTransfer provides methods for sending and receiving |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | * files. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | * |
|
42615
2f3308794a8f
Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
61 | * Since: 3.0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | */ |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | struct _PurpleProtocolFileTransferInterface { |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | /*< private >*/ |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | GTypeInterface parent; |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | /*< public >*/ |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | void (*send_async)(PurpleProtocolFileTransfer *protocol, PurpleFileTransfer *transfer, GAsyncReadyCallback callback, gpointer data); |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | gboolean (*send_finish)(PurpleProtocolFileTransfer *protocol, GAsyncResult *result, GError **error); |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | void (*receive_async)(PurpleProtocolFileTransfer *protocol, PurpleFileTransfer *transfer, GAsyncReadyCallback callback, gpointer data); |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | gboolean (*receive_finish)(PurpleProtocolFileTransfer *protocol, GAsyncResult *result, GError **error); |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | /*< private >*/ |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | gpointer reserved[4]; |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | }; |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | G_BEGIN_DECLS |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | /** |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | * purple_protocol_file_transfer_send_async: |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | * @protocol: The instance. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | * @transfer: The file transfer to send. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | * @callback: (scope async): a #GAsyncReadyCallback to call when the request is |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | * satisfied. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | * @data: User data to pass to @callback. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | * Starts the process of sending @transfer. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | * > Note: This function does not take a cancellable as the protocol should be |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | * using [property@FileTransfer:cancellable] from @transfer. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | * |
|
42615
2f3308794a8f
Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
94 | * Since: 3.0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | */ |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42375
diff
changeset
|
96 | PURPLE_AVAILABLE_IN_3_0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | void purple_protocol_file_transfer_send_async(PurpleProtocolFileTransfer *protocol, PurpleFileTransfer *transfer, GAsyncReadyCallback callback, gpointer data); |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | /** |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | * purple_protocol_file_transfer_send_finish: |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | * @protocol: The instance. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | * @result: The [iface@Gio.AsyncResult] from the previous |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | * [method@ProtocolFileTransfer.send_async] call. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | * @error: Return address for a #GError, or %NULL. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | * Finishes a previous call to [method@ProtocolFileTransfer.send_async] and |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | * gets the result. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | * Returns: %TRUE if the transfer was started successfully, otherwise %FALSE |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | * with @error possibly set. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | * |
|
42615
2f3308794a8f
Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
112 | * Since: 3.0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | */ |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42375
diff
changeset
|
114 | PURPLE_AVAILABLE_IN_3_0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | gboolean purple_protocol_file_transfer_send_finish(PurpleProtocolFileTransfer *protocol, GAsyncResult *result, GError **error); |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
117 | /** |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | * purple_protocol_file_transfer_receive_async: |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | * @protocol: The instance. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | * @transfer: The file transfer to send. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | * @callback: (scope async): a #GAsyncReadyCallback to call when the request is |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | * satisfied. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | * @data: User data to pass to @callback. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | * Starts the process of receiving @transfer. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 | * > Note: This function does not take a cancellable as the protocol should be |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | * using [property@FileTransfer:cancellable] from @transfer. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
129 | * |
|
42615
2f3308794a8f
Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
130 | * Since: 3.0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
131 | */ |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42375
diff
changeset
|
132 | PURPLE_AVAILABLE_IN_3_0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | void purple_protocol_file_transfer_receive_async(PurpleProtocolFileTransfer *protocol, PurpleFileTransfer *transfer, GAsyncReadyCallback callback, gpointer data); |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 | /** |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 | * purple_protocol_file_transfer_receive_finish: |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | * @protocol: The instance. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
138 | * @result: The [iface@Gio.AsyncResult] from the previous |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 | * [method@ProtocolFileTransfer.receive_async] call. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | * @error: Return address for a #GError, or %NULL. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | * Finishes a previous call to [method@ProtocolFileTransfer.receive_async] and |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | * gets the result. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | * |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | * Returns: %TRUE if the transfer was started successfully, otherwise %FALSE |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | * with @error possibly set. |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | * |
|
42615
2f3308794a8f
Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
148 | * Since: 3.0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | */ |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42375
diff
changeset
|
150 | PURPLE_AVAILABLE_IN_3_0 |
|
42375
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | gboolean purple_protocol_file_transfer_receive_finish(PurpleProtocolFileTransfer *protocol, GAsyncResult *result, GError **error); |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | G_END_DECLS |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
154 | |
|
8e61249e9b10
Implement ProtocolFileTransfer
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | #endif /* PURPLE_PROTOCOL_FILE_TRANSFER_H */ |