diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java index a9c245ed..1b4c7802 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ResizePictureUserDecisionListener.java @@ -13,19 +13,19 @@ import java.io.InputStream; import de.thedevstack.android.logcat.Logging; import de.thedevstack.conversationsplus.ConversationsPlusApplication; import de.thedevstack.conversationsplus.ConversationsPlusPreferences; +import de.thedevstack.conversationsplus.enums.UserDecision; +import de.thedevstack.conversationsplus.exceptions.UiException; +import de.thedevstack.conversationsplus.utils.FileHelper; +import de.thedevstack.conversationsplus.utils.ImageUtil; +import de.thedevstack.conversationsplus.utils.MessageUtil; import de.thedevstack.conversationsplus.R; import de.thedevstack.conversationsplus.entities.Conversation; import de.thedevstack.conversationsplus.entities.DownloadableFile; import de.thedevstack.conversationsplus.entities.Message; -import de.thedevstack.conversationsplus.enums.UserDecision; -import de.thedevstack.conversationsplus.exceptions.UiException; import de.thedevstack.conversationsplus.persistance.FileBackend; import de.thedevstack.conversationsplus.services.XmppConnectionService; import de.thedevstack.conversationsplus.ui.UiCallback; import de.thedevstack.conversationsplus.ui.XmppActivity; -import de.thedevstack.conversationsplus.utils.FileHelper; -import de.thedevstack.conversationsplus.utils.ImageUtil; -import de.thedevstack.conversationsplus.utils.MessageUtil; /** * Created by tzur on 31.10.2015. @@ -59,6 +59,7 @@ public class ResizePictureUserDecisionListener implements UserDecisionListener { @Override public void error(int error, Message message) { hidePrepareFileToast(); + //TODO Find another way to display an error dialog ResizePictureUserDecisionListener.this.activity.displayErrorDialog(error); } @@ -96,10 +97,10 @@ public class ResizePictureUserDecisionListener implements UserDecisionListener { this.showPrepareFileToast(); final Message message; final boolean forceEncryption = ConversationsPlusPreferences.forceEncryption(); - if (conversation.getNextEncryption(forceEncryption) == Message.ENCRYPTION_PGP) { + if (conversation.getNextEncryption() == Message.ENCRYPTION_PGP) { message = new Message(conversation, "", Message.ENCRYPTION_DECRYPTED); } else { - message = new Message(conversation, "", conversation.getNextEncryption(forceEncryption)); + message = new Message(conversation, "", conversation.getNextEncryption()); } message.setCounterpart(conversation.getNextCounterpart()); message.setType(Message.TYPE_IMAGE); @@ -115,7 +116,7 @@ public class ResizePictureUserDecisionListener implements UserDecisionListener { int imageWidth = resizedAndRotatedImage.getWidth(); int imageHeight = resizedAndRotatedImage.getHeight(); MessageUtil.updateMessageWithImageDetails(message, filePath, imageSize, imageWidth, imageHeight); - if (conversation.getNextEncryption(forceEncryption) == Message.ENCRYPTION_PGP) { + if (conversation.getNextEncryption() == Message.ENCRYPTION_PGP) { xmppConnectionService.getPgpEngine().encrypt(message, callback); } else { callback.success(message); @@ -133,10 +134,10 @@ public class ResizePictureUserDecisionListener implements UserDecisionListener { this.showPrepareFileToast(); final Message message; final boolean forceEncryption = ConversationsPlusPreferences.forceEncryption(); - if (conversation.getNextEncryption(forceEncryption) == Message.ENCRYPTION_PGP) { + if (conversation.getNextEncryption() == Message.ENCRYPTION_PGP) { message = new Message(conversation, "", Message.ENCRYPTION_DECRYPTED); } else { - message = new Message(conversation, "", conversation.getNextEncryption(forceEncryption)); + message = new Message(conversation, "", conversation.getNextEncryption()); } message.setCounterpart(conversation.getNextCounterpart()); message.setType(Message.TYPE_IMAGE); @@ -154,7 +155,7 @@ public class ResizePictureUserDecisionListener implements UserDecisionListener { int imageWidth = options.outWidth; String filePath = FileHelper.getRealPathFromUri(uri); MessageUtil.updateMessageWithImageDetails(message, filePath, imageSize, imageWidth, imageHeight); - if (conversation.getNextEncryption(forceEncryption) == Message.ENCRYPTION_PGP) { + if (conversation.getNextEncryption() == Message.ENCRYPTION_PGP) { xmppConnectionService.getPgpEngine().encrypt(message, callback); } else { callback.success(message); |