From c564c89c40a776d54f8e8252cb15f2cae3d315c3 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 14 Mar 2021 17:52:12 +0100 Subject: [PATCH] [extensions] Add OutgoingFileTransfer.setCallback() Some methods of OutgoingFileTransfer take already the NegotiationProgress callback as argument, some do not. The API is not ideal, and adding a setter for the callback at least makes it possible to always have the callback. --- .../smackx/filetransfer/OutgoingFileTransfer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java index 3e33208e6..6553f1cdf 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java @@ -324,6 +324,10 @@ public class OutgoingFileTransfer extends FileTransfer { transferThread.start(); } + public void setCallback(NegotiationProgress negotiationProcess) { + this.callback = negotiationProcess; + } + private void handleXMPPException(XMPPErrorException e) { StanzaError error = e.getStanzaError(); if (error != null) {