diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-01-11 14:55:53 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-01-11 14:55:53 +0100 |
commit | 0a9bba28616e594279cd659ec2eb57da2074b3cd (patch) | |
tree | cb643f89080eee8745be1ee6590429488400f6c1 /src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/delete/DeleteRemoteFileService.java | |
parent | 563fcfa77580292a7ff2360eea20553743bd0ae7 (diff) |
Improved error handling for filetransfer:http:delete, Check for httpupload feature available extended to include filetransfer:http as well, method to check if http upload is available moved from data class 'Account' to 'AccountUtil'
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/delete/DeleteRemoteFileService.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/delete/DeleteRemoteFileService.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/delete/DeleteRemoteFileService.java b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/delete/DeleteRemoteFileService.java index eb9f1b04..2085cf4b 100644 --- a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/delete/DeleteRemoteFileService.java +++ b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/delete/DeleteRemoteFileService.java @@ -31,12 +31,16 @@ public class DeleteRemoteFileService implements SimpleUserDecisionCallback { path = this.message.getFileParams().getUrl(); } - DeleteRemoteFile remoteFile = new DeleteRemoteFile(path, this.message); - Account account = this.message.getConversation().getAccount(); - Jid host = account.getXmppConnection().findDiscoItemByFeature(FileTransferHttp.NAMESPACE); - IqPacket request = FileTransferHttpDeleteSlotRequestPacketGenerator.generate(host, path); - MessageUtil.setAndSaveFileStatus(this.message, FileStatus.DELETING); - XmppSendUtil.sendIqPacket(account, request, new DeleteTokenReceived(remoteFile)); + if (null != path) { + DeleteRemoteFile remoteFile = new DeleteRemoteFile(path, this.message); + Account account = this.message.getConversation().getAccount(); + Jid host = account.getXmppConnection().findDiscoItemByFeature(FileTransferHttp.NAMESPACE); + if (null != host) { + IqPacket request = FileTransferHttpDeleteSlotRequestPacketGenerator.generate(host, path); + MessageUtil.setAndSaveFileStatus(this.message, FileStatus.DELETING); + XmppSendUtil.sendIqPacket(account, request, new DeleteTokenReceived(remoteFile)); + } + } } } |