summaryrefslogtreecommitdiff
path: root/libpurple/xfer.c
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2017-11-26 02:15:23 -0600
committerGary Kramlich <grim@reaperworld.com>2017-11-26 02:15:23 -0600
commit81222dabf88a15145513d02b5f6bab88646dea52 (patch)
treeddafe30f1b5e28e5dc4f92679a7d4ecfa41a2872 /libpurple/xfer.c
parent83eba989f40241a64357952072d68dfb35a34513 (diff)
downloadpidgin-81222dabf88a15145513d02b5f6bab88646dea52.tar.gz
start implement the _new_xfer test, stopping here as there a lot more auxiliary work that needs to be done to make it work
Diffstat (limited to 'libpurple/xfer.c')
-rw-r--r--libpurple/xfer.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libpurple/xfer.c b/libpurple/xfer.c
index 2115a61099..0fb0f5084d 100644
--- a/libpurple/xfer.c
+++ b/libpurple/xfer.c
@@ -2360,21 +2360,23 @@ purple_xfer_new(PurpleAccount *account, PurpleXferType type, const char *who)
g_return_val_if_fail(who != NULL, NULL);
protocol = purple_protocols_find(purple_account_get_protocol_id(account));
-
- g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL);
-
- if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, FACTORY_IFACE, xfer_new))
- xfer = purple_protocol_factory_iface_xfer_new(protocol, account, type,
- who);
- else
+ if (PURPLE_IS_PROTOCOL_XFER(protocol)) {
+ PurpleConnection *connection = purple_account_get_connection(account);
+
+ xfer = purple_protocol_xfer_new_xfer(
+ PURPLE_PROTOCOL_XFER(protocol),
+ connection,
+ /* TODO: this should support the type */
+ who
+ );
+ } else {
xfer = g_object_new(PURPLE_TYPE_XFER,
"account", account,
"type", type,
"remote-user", who,
NULL
);
-
- g_return_val_if_fail(xfer != NULL, NULL);
+ }
return xfer;
}