aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-10-05 21:22:58 +0200
committerChristian Schneppe <christian@pix-art.de>2016-10-05 21:22:58 +0200
commit28a47fcc2f67e2385a90237e9bdf2d360ee96f75 (patch)
treee1fe4ec5a3b5620d6c2c4b8b0399f7ca34b7d67c /src/main/java
parente7d59858ae3354ca3945496bd297351e71b3c9d2 (diff)
fixed omemo shown as unavailable in 1:1 chats
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java2
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java7
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java3
4 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
index 4179c6f07..e3ea8955a 100644
--- a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
@@ -660,7 +660,7 @@ 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/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index 135f6aef3..00bae3983 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -59,6 +59,8 @@ import de.pixart.messenger.xmpp.pep.Avatar;
public class FileBackend {
private static final SimpleDateFormat fileDateFormat = new SimpleDateFormat("yyyyMMdd_HHmmssSSS", Locale.US);
+ public static final String CONVERSATIONS_FILE_PROVIDER = "de.pixart.messenger.files";
+
private XmppConnectionService mXmppConnectionService;
public FileBackend(XmppConnectionService service) {
@@ -465,7 +467,7 @@ public class FileBackend {
File file = new File(getTakePhotoPath()+"IMG_" + fileDateFormat.format(new Date()) + ".jpg");
file.getParentFile().mkdirs();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- return FileProvider.getUriForFile(mXmppConnectionService,"de.pixart.messenger.files",file);
+ return FileProvider.getUriForFile(mXmppConnectionService, CONVERSATIONS_FILE_PROVIDER, file);
} else {
return Uri.fromFile(file);
}
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index cafd18f00..478156bea 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -623,15 +623,16 @@ 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();
- return true;
+ 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();
return true;
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index 4ac0c3ed9..f0db05626 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -53,6 +53,7 @@ import de.pixart.messenger.entities.DownloadableFile;
import de.pixart.messenger.entities.Message;
import de.pixart.messenger.entities.Message.FileParams;
import de.pixart.messenger.entities.Transferable;
+import de.pixart.messenger.persistance.FileBackend;
import de.pixart.messenger.ui.ConversationActivity;
import de.pixart.messenger.ui.ShowFullscreenMessageActivity;
import de.pixart.messenger.ui.widget.ClickableMovementMethod;
@@ -786,7 +787,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
Uri uri;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
try {
- uri = FileProvider.getUriForFile(activity, "de.pixart.messenger.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;