diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-01-11 15:50:13 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-01-11 15:50:13 +0100 |
commit | 44d01d933c0434b0e9b6ce7a1ff888f1b0f2ef3d (patch) | |
tree | 1f0ebdcab4824b53a7f0507d69088efd9456db84 /src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/delete/DeleteRemoteFileService.java | |
parent | c76d0968b8874c0e4466b4e315688a7d003d52f6 (diff) | |
parent | cd633f13b8d7327e47994bb5a000f0c0b7089e7f (diff) |
Merge branch 'trz/rename' into trz/rebase
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 f60efb56..038369ca 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 @@ -29,12 +29,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)); + } + } } } |