diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-10-03 21:04:10 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-10-03 21:04:10 +0200 |
commit | 5ac0e9267d8ff98dcb6a28d1837e81b4572e8b03 (patch) | |
tree | 0b46d6e4862dc81d8b05fb830b43fef6e71b2f61 /src/main/java/eu | |
parent | cea52b0722bc352815e3c3e1c1982ddd13f54984 (diff) |
fixed omemo shown as unavailable in 1:1 chats
Diffstat (limited to 'src/main/java/eu')
4 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java index ddfe2d8e..508168c8 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -660,7 +660,8 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { } public Pair<AxolotlCapability,Jid> isConversationAxolotlCapableDetailed(Conversation conversation) { - if (conversation.getMucOptions().membersOnly() && conversation.getMucOptions().nonanonymous()) { + if (conversation.getMode() == Conversation.MODE_SINGLE + || (conversation.getMucOptions().membersOnly() && conversation.getMucOptions().nonanonymous())) { final List<Jid> jids = getCryptoTargets(conversation); for(Jid jid : jids) { if (!hasAny(jid) && (!deviceIds.containsKey(jid) || deviceIds.get(jid).isEmpty())) { diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 32d38c1f..bc919788 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -59,6 +59,8 @@ import eu.siacs.conversations.xmpp.pep.Avatar; public class FileBackend { private static final SimpleDateFormat IMAGE_DATE_FORMAT = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US); + public static final String CONVERSATIONS_FILE_PROVIDER = "eu.siacs.conversations.files"; + private XmppConnectionService mXmppConnectionService; public FileBackend(XmppConnectionService service) { @@ -439,7 +441,7 @@ public class FileBackend { File file = new File(getTakePhotoPath()+"IMG_" + this.IMAGE_DATE_FORMAT.format(new Date()) + ".jpg"); file.getParentFile().mkdirs(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - return FileProvider.getUriForFile(mXmppConnectionService, "eu.siacs.conversations.files", file); + return FileProvider.getUriForFile(mXmppConnectionService, CONVERSATIONS_FILE_PROVIDER, file); } else { return Uri.fromFile(file); } diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index b45d9d70..82b59dfc 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -451,14 +451,15 @@ public class ConversationActivity extends XmppActivity private boolean quickOmemoDebugger(Conversation c) { if (c != null) { + boolean single = c.getMode() == Conversation.MODE_SINGLE; AxolotlService axolotlService = c.getAccount().getAxolotlService(); Pair<AxolotlService.AxolotlCapability,Jid> capabilityJidPair = axolotlService.isConversationAxolotlCapableDetailed(c); switch (capabilityJidPair.first) { case MISSING_PRESENCE: - Toast.makeText(ConversationActivity.this,getString(R.string.missing_presence_subscription_with_x,capabilityJidPair.second.toBareJid().toString()),Toast.LENGTH_SHORT).show(); + Toast.makeText(ConversationActivity.this,single ? getString(R.string.missing_presence_subscription) : getString(R.string.missing_presence_subscription_with_x,capabilityJidPair.second.toBareJid().toString()),Toast.LENGTH_SHORT).show(); return true; case MISSING_KEYS: - Toast.makeText(ConversationActivity.this,getString(R.string.missing_keys_from_x,capabilityJidPair.second.toBareJid().toString()),Toast.LENGTH_SHORT).show(); + Toast.makeText(ConversationActivity.this,single ? getString(R.string.missing_omemo_keys) : getString(R.string.missing_keys_from_x,capabilityJidPair.second.toBareJid().toString()),Toast.LENGTH_SHORT).show(); return true; case WRONG_CONFIGURATION: Toast.makeText(ConversationActivity.this,R.string.wrong_conference_configuration, Toast.LENGTH_SHORT).show(); diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index 9e2b3ba7..496d8ab5 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -51,6 +51,7 @@ import eu.siacs.conversations.entities.DownloadableFile; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.entities.Message.FileParams; import eu.siacs.conversations.entities.Transferable; +import eu.siacs.conversations.persistance.FileBackend; import eu.siacs.conversations.ui.ConversationActivity; import eu.siacs.conversations.ui.widget.ClickableMovementMethod; import eu.siacs.conversations.utils.CryptoHelper; @@ -698,7 +699,7 @@ public class MessageAdapter extends ArrayAdapter<Message> { Uri uri; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { try { - uri = FileProvider.getUriForFile(activity, "eu.siacs.conversations.files", file); + uri = FileProvider.getUriForFile(activity, FileBackend.CONVERSATIONS_FILE_PROVIDER, file); } catch (IllegalArgumentException e) { Toast.makeText(activity,activity.getString(R.string.no_permission_to_access_x,file.getAbsolutePath()), Toast.LENGTH_SHORT).show(); return; |