select presence if necessary when resending file
This commit is contained in:
parent
a3be1e964c
commit
c3dcc74b23
|
@ -763,10 +763,25 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resendMessage(Message message) {
|
private void resendMessage(final Message message) {
|
||||||
if (message.getType() == Message.TYPE_FILE || message.getType() == Message.TYPE_IMAGE) {
|
if (message.isFileOrImage()) {
|
||||||
DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message);
|
DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message);
|
||||||
if (!file.exists()) {
|
if (file.exists()) {
|
||||||
|
final Conversation conversation = message.getConversation();
|
||||||
|
final XmppConnection xmppConnection = conversation.getAccount().getXmppConnection();
|
||||||
|
if (!message.hasFileOnRemoteHost()
|
||||||
|
&& xmppConnection != null
|
||||||
|
&& !xmppConnection.getFeatures().httpUpload(message.getFileParams().size)) {
|
||||||
|
activity.selectPresence(conversation, new OnPresenceSelected() {
|
||||||
|
@Override
|
||||||
|
public void onPresenceSelected() {
|
||||||
|
message.setCounterpart(conversation.getNextCounterpart());
|
||||||
|
activity.xmppConnectionService.resendFailedMessages(message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
Toast.makeText(activity, R.string.file_deleted, Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, R.string.file_deleted, Toast.LENGTH_SHORT).show();
|
||||||
message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_DELETED));
|
message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_DELETED));
|
||||||
activity.updateConversationList();
|
activity.updateConversationList();
|
||||||
|
|
Loading…
Reference in New Issue