clean up in attachment chooser code. fixed #1168

This commit is contained in:
Daniel Gultsch 2015-05-04 09:54:10 +02:00
parent e388c75452
commit 61fd5d6696
1 changed files with 52 additions and 52 deletions

View File

@ -398,12 +398,7 @@ public class ConversationActivity extends XmppActivity
}
private void selectPresenceToAttachFile(final int attachmentChoice, final int encryption) {
if (attachmentChoice == ATTACHMENT_CHOICE_LOCATION && encryption != Message.ENCRYPTION_OTR) {
getSelectedConversation().setNextCounterpart(null);
Intent intent = new Intent("eu.siacs.conversations.location.request");
startActivityForResult(intent,attachmentChoice);
} else {
selectPresence(getSelectedConversation(), new OnPresenceSelected() {
final OnPresenceSelected callback = new OnPresenceSelected() {
@Override
public void onPresenceSelected() {
@ -452,7 +447,12 @@ public class ConversationActivity extends XmppActivity
startActivity(getInstallApkIntent(fallbackPackageId));
}
}
});
};
if (attachmentChoice == ATTACHMENT_CHOICE_LOCATION && encryption != Message.ENCRYPTION_OTR) {
getSelectedConversation().setNextCounterpart(null);
callback.onPresenceSelected();
} else {
selectPresence(getSelectedConversation(),callback);
}
}