libpurple/protocols/silc/ft.c

Fri, 12 Feb 2021 23:47:53 -0600

author
Arkadiy Illarionov <qarkai@gmail.com>
date
Fri, 12 Feb 2021 23:47:53 -0600
changeset 40769
2214cc7b95ca
parent 40255
42922708e18e
permissions
-rw-r--r--

Fix SILC compilation

* Move `_purple_fstat` to silc and rename to `silcpurple_fstat`
* Replace unknown `g_fchmod` with `fchmod`
* Fix `PurpleProtocol*` prototypes
* Derive `SilcPurpleXfer` from `PurpleXfer`

Testing Done:
Compile.

Bugs closed: PIDGIN-17436

Reviewed at https://reviews.imfreedom.org/r/481/

8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1 /*
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
3 silcpurple_ft.c
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
4
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
5 Author: Pekka Riikonen <priikone@silcnet.org>
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
6
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
7 Copyright (C) 2004 - 2007 Pekka Riikonen
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
8
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
9 This program is free software; you can redistribute it and/or modify
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
11 the Free Software Foundation; version 2 of the License.
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
12
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
13 This program is distributed in the hope that it will be useful,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
16 GNU General Public License for more details.
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
17
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
18 */
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
19
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
20 #include <glib/gi18n-lib.h>
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
21 #include <glib/gstdio.h>
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
22
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
23 #include "silcpurple.h"
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
24 #include "ft.h"
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
25
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
26 /****************************** File Transfer ********************************/
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
27
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
28 /* This implements the secure file transfer protocol (SFTP) using the SILC
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
29 SFTP library implementation. The API we use from the SILC Toolkit is the
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
30 SILC Client file transfer API, as it provides a simple file transfer we
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
31 need in this case. We could use the SILC SFTP API directly, but it would
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
32 be an overkill since we'd effectively re-implement the file transfer what
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
33 the SILC Client's file transfer API already provides.
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
34
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
35 From Purple we do NOT use the FT API to do the transfer as it is very limiting.
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
36 In fact it does not suite to file transfers like SFTP at all. For example,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
37 it assumes that read operations are synchronous what they are not in SFTP.
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
38 It also assumes that the file transfer socket is to be handled by the Purple
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
39 eventloop, and this naturally is something we don't want to do in case of
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
40 SILC Toolkit. The FT API suites well to purely stream based file transfers
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
41 like HTTP GET and similar.
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
42
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
43 For this reason, we directly access the Purple GKT FT API and hack the FT
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
44 API to merely provide the user interface experience and all the magic
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
45 is done in the SILC Toolkit. Ie. we update the statistics information in
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
46 the FT API for user interface, and that's it. A bit dirty but until the
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
47 FT API gets better this is the way to go. Good thing that FT API allowed
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
48 us to do this. */
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
49
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
50 struct _SilcPurpleXfer {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
51 PurpleXfer parent;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
52
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
53 SilcPurple sg;
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
54 SilcClientEntry client_entry;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
55 SilcUInt32 session_id;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
56 char *hostname;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
57 SilcUInt16 port;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
58
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
59 SilcClientFileName completion;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
60 void *completion_context;
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
61 };
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
62
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
63 G_DEFINE_DYNAMIC_TYPE(SilcPurpleXfer, silcpurple_xfer, PURPLE_TYPE_XFER);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
64
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
65 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
66 silcpurple_ftp_monitor(SilcClient client,
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
67 SilcClientConnection conn,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
68 SilcClientMonitorStatus status,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
69 SilcClientFileError error,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
70 SilcUInt64 offset,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
71 SilcUInt64 filesize,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
72 SilcClientEntry client_entry,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
73 SilcUInt32 session_id,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
74 const char *filepath,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
75 void *context)
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
76 {
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
77 PurpleXfer *xfer = context;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
78 SilcPurpleXfer *spx = SILCPURPLE_XFER(xfer);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
79 PurpleConnection *gc = spx->sg->gc;
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
80 char tmp[256];
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
81
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
82 if (status == SILC_CLIENT_FILE_MONITOR_CLOSED) {
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
83 /* All started sessions terminate here */
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
84 g_object_unref(xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
85 return;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
86 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
87
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
88 if (status == SILC_CLIENT_FILE_MONITOR_DISCONNECT) {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
89 purple_notify_error(gc, _("Secure File Transfer"), _("Error "
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
90 "during file transfer"), _("Remote disconnected"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
91 purple_request_cpar_from_connection(gc));
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
92 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_REMOTE);
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
93 silc_client_file_close(client, conn, session_id);
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
94 return;
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
95 }
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
96
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
97 if (status == SILC_CLIENT_FILE_MONITOR_KEY_AGREEMENT)
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
98 return;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
99
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
100 if (status == SILC_CLIENT_FILE_MONITOR_ERROR) {
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
101 if (error == SILC_CLIENT_FILE_NO_SUCH_FILE) {
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
102 g_snprintf(tmp, sizeof(tmp), "No such file %s",
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
103 filepath ? filepath : "[N/A]");
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
104 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
105 _("Error during file transfer"), tmp,
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
106 purple_request_cpar_from_connection(gc));
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
107 } else if (error == SILC_CLIENT_FILE_PERMISSION_DENIED) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
108 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
109 _("Error during file transfer"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
110 _("Permission denied"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
111 purple_request_cpar_from_connection(gc));
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
112 } else if (error == SILC_CLIENT_FILE_KEY_AGREEMENT_FAILED) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
113 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
114 _("Error during file transfer"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
115 _("Key agreement failed"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
116 purple_request_cpar_from_connection(gc));
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
117 } else if (error == SILC_CLIENT_FILE_TIMEOUT) {
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
118 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
119 _("Error during file transfer"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
120 _("Connection timed out"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
121 purple_request_cpar_from_connection(gc));
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
122 } else if (error == SILC_CLIENT_FILE_CONNECT_FAILED) {
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
123 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
124 _("Error during file transfer"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
125 _("Creating connection failed"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
126 purple_request_cpar_from_connection(gc));
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
127 } else if (error == SILC_CLIENT_FILE_UNKNOWN_SESSION) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
128 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
129 _("Error during file transfer"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
130 _("File transfer session does not exist"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
131 purple_request_cpar_from_connection(gc));
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
132 }
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
133 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_REMOTE);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
134 silc_client_file_close(client, conn, session_id);
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
135 return;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
136 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
137
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
138 /* Update file transfer UI */
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
139 if (!offset && filesize) {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
140 purple_xfer_set_size(xfer, filesize);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
141 }
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
142 if (offset && filesize) {
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
143 purple_xfer_set_bytes_sent(xfer, offset);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
144 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
145
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
146 if (status == SILC_CLIENT_FILE_MONITOR_SEND ||
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
147 status == SILC_CLIENT_FILE_MONITOR_RECEIVE) {
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
148 if (offset == filesize) {
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
149 /* Download finished */
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
150 purple_xfer_set_completed(xfer, TRUE);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
151 silc_client_file_close(client, conn, session_id);
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
152 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
153 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
154 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
155
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
156 static void
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
157 silcpurple_ftp_cancel(PurpleXfer *xfer)
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
158 {
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
159 SilcPurpleXfer *spx = SILCPURPLE_XFER(xfer);
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
160
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
161 if (!spx) {
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
162 return;
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
163 }
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
164
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
165 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_LOCAL);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
166 silc_client_file_close(spx->sg->client, spx->sg->conn, spx->session_id);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
167 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
168
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
169 static void
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
170 silcpurple_ftp_ask_name_ok(PurpleXfer *xfer)
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
171 {
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
172 SilcPurpleXfer *spx = SILCPURPLE_XFER(xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
173 const char *name;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
174
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
175 if (!spx) {
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
176 return;
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
177 }
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
178
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
179 name = purple_xfer_get_local_filename(xfer);
10589
4e10236e06d4 [gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents: 10254
diff changeset
180 g_unlink(name);
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
181 spx->completion(name, spx->completion_context);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
182 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
183
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
184 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
185 silcpurple_ftp_ask_name(SilcClient client,
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
186 SilcClientConnection conn,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
187 SilcUInt32 session_id,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
188 const char *remote_filename,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
189 SilcClientFileName completion,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
190 void *completion_context,
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
191 void *context)
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
192 {
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
193 PurpleXfer *xfer = context;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
194 SilcPurpleXfer *spx = SILCPURPLE_XFER(xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
195
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
196 spx->completion = completion;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
197 spx->completion_context = completion_context;
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
198
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
199 /* Request to save the file */
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
200 purple_xfer_set_filename(xfer, remote_filename);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
201 purple_xfer_request(xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
202 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
203
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
204 static void
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
205 silcpurple_ftp_request_result(PurpleXfer *xfer)
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
206 {
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
207 SilcPurpleXfer *spx = SILCPURPLE_XFER(xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
208 SilcClientFileError status;
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
209 PurpleConnection *gc = spx->sg->gc;
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
210 SilcClientConnectionParams params;
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
211 gboolean local = spx->hostname ? FALSE : TRUE;
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
212 char *local_ip = NULL, *remote_ip = NULL;
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
213 SilcSocket sock;
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
214
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
215 if (purple_xfer_get_status(xfer) != PURPLE_XFER_STATUS_ACCEPTED) {
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
216 return;
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
217 }
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
218
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
219 silc_socket_stream_get_info(silc_packet_stream_get_stream(spx->sg->conn->stream),
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
220 &sock, NULL, NULL, NULL);
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
221
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
222 if (local) {
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
223 /* Do the same magic what we do with key agreement (see silcpurple_buddy.c)
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
224 to see if we are behind NAT. */
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
225 if (silc_net_check_local_by_sock(sock, NULL, &local_ip)) {
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
226 /* Check if the IP is private */
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
227 if (silcpurple_ip_is_private(local_ip)) {
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
228 local = TRUE;
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
229 /* Local IP is private, resolve the remote server IP to see whether
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
230 we are talking to Internet or just on LAN. */
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
231 if (silc_net_check_host_by_sock(sock, NULL,
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
232 &remote_ip))
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
233 if (silcpurple_ip_is_private(remote_ip))
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
234 /* We assume we are in LAN. Let's provide the connection point. */
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
235 local = TRUE;
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
236 }
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
237 }
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
238
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
239 if (local && !local_ip)
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
240 local_ip = silc_net_localip();
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
241 }
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
242
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
243 memset(&params, 0, sizeof(params));
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
244 params.timeout_secs = 60;
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
245 if (local)
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
246 /* Provide connection point */
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
247 params.local_ip = local_ip;
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
248
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
249 /* Start the file transfer */
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
250 status = silc_client_file_receive(spx->sg->client, spx->sg->conn,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
251 &params, spx->sg->public_key,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
252 spx->sg->private_key,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
253 silcpurple_ftp_monitor, xfer,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
254 NULL, spx->session_id,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
255 silcpurple_ftp_ask_name, xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
256 switch (status) {
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
257 case SILC_CLIENT_FILE_OK:
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
258 silc_free(local_ip);
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
259 silc_free(remote_ip);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
260 return;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
261 break;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
262
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
263 case SILC_CLIENT_FILE_UNKNOWN_SESSION:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
264 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
265 _("No file transfer session active"), NULL,
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
266 purple_request_cpar_from_connection(gc));
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
267 break;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
268
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
269 case SILC_CLIENT_FILE_ALREADY_STARTED:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
270 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
271 _("File transfer already started"), NULL,
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
272 purple_request_cpar_from_connection(gc));
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
273 break;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
274
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
275 case SILC_CLIENT_FILE_KEY_AGREEMENT_FAILED:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
276 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
277 _("Could not perform key agreement for file transfer"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
278 NULL, purple_request_cpar_from_connection(gc));
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
279 break;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
280
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
281 default:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
282 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
283 _("Could not start the file transfer"), NULL,
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
284 purple_request_cpar_from_connection(gc));
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
285 break;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
286 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
287
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
288 /* Error */
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
289 g_object_unref(xfer);
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
290 silc_free(local_ip);
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
291 silc_free(remote_ip);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
292 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
293
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
294 static void
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
295 silcpurple_ftp_request_init(PurpleXfer *xfer)
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
296 {
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
297 SilcPurpleXfer *spx = SILCPURPLE_XFER(xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
298
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
299 if (spx->completion) {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
300 silcpurple_ftp_ask_name_ok(xfer);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
301 } else {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
302 silcpurple_ftp_request_result(xfer);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
303 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
304 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
305
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
306 static void
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
307 silcpurple_ftp_request_denied(PurpleXfer *xfer)
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
308 {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
309 SilcPurpleXfer *spx = SILCPURPLE_XFER(xfer);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
310
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
311 if (!spx) {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
312 return;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
313 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
314
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
315 /* Cancel the transmission */
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
316 if (spx->completion) {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
317 spx->completion(NULL, spx->completion_context);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
318 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
319 silc_client_file_close(spx->sg->client, spx->sg->conn, spx->session_id);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
320 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
321
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
322 void silcpurple_ftp_request(SilcClient client, SilcClientConnection conn,
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
323 SilcClientEntry client_entry, SilcUInt32 session_id,
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
324 const char *hostname, SilcUInt16 port)
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
325 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
326 PurpleConnection *gc = client->application;
32281
0ef1a6d8ca53 Convert silc prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32270
diff changeset
327 SilcPurple sg = purple_connection_get_protocol_data(gc);
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
328 SilcPurpleXfer *spx;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
329
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
330 spx = g_object_new(SILCPURPLE_TYPE_XFER,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
331 "account", sg->account,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
332 "type", PURPLE_XFER_TYPE_RECEIVE,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
333 "remote-user", client_entry->nickname,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
334 NULL);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
335
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
336 spx->sg = sg;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
337 spx->client_entry = client_entry;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
338 spx->session_id = session_id;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
339 spx->hostname = g_strdup(hostname);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
340 spx->port = port;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
341
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
342 purple_xfer_start(PURPLE_XFER(spx), -1, hostname, port);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
343
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
344 /* File transfer request */
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
345 purple_xfer_request(PURPLE_XFER(spx));
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
346 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
347
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
348 static void
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
349 silcpurple_ftp_send_cancel(PurpleXfer *xfer)
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
350 {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
351 SilcPurpleXfer *spx = SILCPURPLE_XFER(xfer);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
352
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
353 if (!spx) {
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
354 return;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
355 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
356
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
357 /* This call will free all resources */
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
358 silc_client_file_close(spx->sg->client, spx->sg->conn, spx->session_id);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
359 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
360
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
361 static void
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
362 silcpurple_ftp_send(PurpleXfer *xfer)
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
363 {
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
364 SilcPurpleXfer *spx = SILCPURPLE_XFER(xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
365 const char *name;
8910
69e01c130dca [gaim-migrate @ 9680]
Ambrose Li <ambrose.li@gmail.com>
parents: 8849
diff changeset
366 char *local_ip = NULL, *remote_ip = NULL;
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
367 gboolean local = TRUE;
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
368 SilcClientConnectionParams params;
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
369 SilcSocket sock;
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
370
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
371 if (!spx) {
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
372 return;
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
373 }
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
374
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
375 name = purple_xfer_get_local_filename(xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
376
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
377 silc_socket_stream_get_info(silc_packet_stream_get_stream(spx->sg->conn->stream),
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
378 &sock, NULL, NULL, NULL);
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
379
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
380 /* Do the same magic what we do with key agreement (see silcpurple_buddy.c)
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
381 to see if we are behind NAT. */
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
382 if (silc_net_check_local_by_sock(sock, NULL, &local_ip)) {
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
383 /* Check if the IP is private */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
384 if (silcpurple_ip_is_private(local_ip)) {
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
385 local = FALSE;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
386 /* Local IP is private, resolve the remote server IP to see whether
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
387 we are talking to Internet or just on LAN. */
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
388 if (silc_net_check_host_by_sock(sock, NULL,
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
389 &remote_ip))
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
390 if (silcpurple_ip_is_private(remote_ip))
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
391 /* We assume we are in LAN. Let's provide the connection point. */
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
392 local = TRUE;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
393 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
394 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
395
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
396 if (local && !local_ip)
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
397 local_ip = silc_net_localip();
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
398
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
399 memset(&params, 0, sizeof(params));
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
400 params.timeout_secs = 60;
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
401 if (local)
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
402 /* Provide connection point */
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
403 params.local_ip = local_ip;
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
404
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
405 /* Send the file */
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
406 silc_client_file_send(spx->sg->client, spx->sg->conn,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
407 spx->client_entry, &params,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
408 spx->sg->public_key, spx->sg->private_key,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
409 silcpurple_ftp_monitor, xfer,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
410 name, &spx->session_id);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
411
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
412 silc_free(local_ip);
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
413 silc_free(remote_ip);
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
414 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
415
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
416 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
417 silcpurple_ftp_send_file_resolved(SilcClient client,
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
418 SilcClientConnection conn,
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
419 SilcStatus status,
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
420 SilcDList clients,
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
421 void *context)
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
422 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
423 PurpleConnection *gc = client->application;
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
424 char tmp[256];
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
425
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
426 if (!clients) {
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
427 g_snprintf(tmp, sizeof(tmp),
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
428 _("User %s is not present in the network"),
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
429 (const char *)context);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
430 purple_notify_error(gc, _("Secure File Transfer"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
431 _("Cannot send file"), tmp,
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33774
diff changeset
432 purple_request_cpar_from_connection(gc));
22972
2942c1995c22 Cleanup allocations/frees to match and plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 18168
diff changeset
433 g_free(context);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
434 return;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
435 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
436
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
437 silcpurple_ftp_send_file(NULL, client->application, (const char *)context, NULL);
22972
2942c1995c22 Cleanup allocations/frees to match and plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 18168
diff changeset
438 g_free(context);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
439 }
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
440
38841
518362268798 make sure all the PurpleProtocolXfer parameters are named prplxfer
Gary Kramlich <grim@reaperworld.com>
parents: 35681
diff changeset
441 PurpleXfer *silcpurple_ftp_new_xfer(PurpleProtocolXfer *prplxfer, PurpleConnection *gc, const char *name)
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
442 {
32281
0ef1a6d8ca53 Convert silc prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32270
diff changeset
443 SilcPurple sg = purple_connection_get_protocol_data(gc);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
444 SilcClient client = sg->client;
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
445 SilcClientConnection conn = sg->conn;
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
446 SilcDList clients;
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
447 SilcClientEntry client_entry;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
448 SilcPurpleXfer *spx;
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
449
12143
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
450 g_return_val_if_fail(name != NULL, NULL);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
451
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
452 /* Find client entry */
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
453 clients = silc_client_get_clients_local(client, conn, name, FALSE);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
454 if (!clients) {
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
455 silc_client_get_clients(client, conn, name, NULL,
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
456 silcpurple_ftp_send_file_resolved,
22972
2942c1995c22 Cleanup allocations/frees to match and plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 18168
diff changeset
457 g_strdup(name));
12143
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
458 return NULL;
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
459 }
17675
e7069bf1de1a Patch from Pekka Riikonen to update the SILC protocol plugin to work with
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15884
diff changeset
460 silc_dlist_start(clients);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
461
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
462 client_entry = silc_dlist_get(clients);
12143
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
463 silc_free(clients);
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
464
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
465 spx = g_object_new(SILCPURPLE_TYPE_XFER,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
466 "account", sg->account,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
467 "type", PURPLE_XFER_TYPE_SEND,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
468 "remote-user", client_entry->nickname,
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
469 NULL);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
470
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
471 spx->sg = sg;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
472 spx->client_entry = client_entry;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
473
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
474 return PURPLE_XFER(spx);
12143
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
475 }
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
476
38841
518362268798 make sure all the PurpleProtocolXfer parameters are named prplxfer
Gary Kramlich <grim@reaperworld.com>
parents: 35681
diff changeset
477 void silcpurple_ftp_send_file(PurpleProtocolXfer *prplxfer, PurpleConnection *gc, const char *name, const char *file)
12143
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
478 {
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
479 PurpleXfer *xfer = silcpurple_ftp_new_xfer(prplxfer, gc, name);
12143
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
480
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
481 g_return_if_fail(xfer != NULL);
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11015
diff changeset
482
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
483 /* Choose file to send */
9466
b6425eab60ca [gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents: 9353
diff changeset
484 if (file)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
485 purple_xfer_request_accepted(xfer, file);
9466
b6425eab60ca [gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents: 9353
diff changeset
486 else
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
487 purple_xfer_request(xfer);
8849
4385d99b059c [gaim-migrate @ 9616]
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
488 }
40769
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
489
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
490 static void
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
491 silcpurple_ftp_init(PurpleXfer *xfer)
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
492 {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
493 switch(purple_xfer_get_xfer_type(xfer)) {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
494 case PURPLE_XFER_TYPE_SEND:
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
495 silcpurple_ftp_send(xfer);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
496 break;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
497 case PURPLE_XFER_TYPE_RECEIVE:
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
498 silcpurple_ftp_request_init(xfer);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
499 break;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
500 case PURPLE_XFER_TYPE_UNKNOWN:
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
501 g_return_if_reached();
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
502 break;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
503 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
504 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
505
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
506 /******************************************************************************
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
507 * GObject Implementation
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
508 *****************************************************************************/
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
509 static void
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
510 silcpurple_xfer_init(SilcPurpleXfer *spx)
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
511 {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
512 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
513
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
514 static void
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
515 silcpurple_xfer_finalize(GObject *obj) {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
516 SilcPurpleXfer *spx = SILCPURPLE_XFER(obj);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
517
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
518 g_free(spx->hostname);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
519
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
520 G_OBJECT_CLASS(silcpurple_xfer_parent_class)->finalize(obj);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
521 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
522
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
523 static void
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
524 silcpurple_xfer_class_init(SilcPurpleXferClass *klass) {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
525 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
526 PurpleXferClass *xfer_class = PURPLE_XFER_CLASS(klass);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
527
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
528 obj_class->finalize = silcpurple_xfer_finalize;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
529
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
530 xfer_class->init = silcpurple_ftp_init;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
531 xfer_class->request_denied = silcpurple_ftp_request_denied;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
532 xfer_class->cancel_send = silcpurple_ftp_send_cancel;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
533 xfer_class->cancel_recv = silcpurple_ftp_cancel;
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
534 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
535
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
536 static void
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
537 silcpurple_xfer_class_finalize(SilcPurpleXferClass *klass) {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
538 }
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
539
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
540 /******************************************************************************
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
541 * Public API
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
542 *****************************************************************************/
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
543 void
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
544 silcpurple_xfer_register(GTypeModule *module) {
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
545 silcpurple_xfer_register_type(module);
2214cc7b95ca Fix SILC compilation
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40255
diff changeset
546 }

mercurial