aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-29 21:31:15 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-29 21:31:15 +0200
commit1fcc2f3cb1f219c25080bdcbb8f4d9fb6af10ea7 (patch)
tree6dce7a9fe869b1c95fa7bc5bc524f0938ccc59c2 /src
parent7b625e72eaa751bd1b57612af05bc84ad78fd910 (diff)
do not use omemo by default for own server
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Contact.java6
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java5
2 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Contact.java b/src/main/java/de/pixart/messenger/entities/Contact.java
index 3872ceecb..8112c4a3c 100644
--- a/src/main/java/de/pixart/messenger/entities/Contact.java
+++ b/src/main/java/de/pixart/messenger/entities/Contact.java
@@ -515,7 +515,11 @@ public class Contact implements ListItem, Blockable {
}
public boolean isSelf() {
- return account.getJid().asBareJid().equals(getJid().asBareJid());
+ return account.getJid().asBareJid().equals(jid.asBareJid());
+ }
+
+ public boolean isOwnServer() {
+ return account.getJid().getDomain().equals(jid.getDomain());
}
public void setCommonName(String cn) {
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index 6f995b2be..d2d081a90 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -782,6 +782,9 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
if (conversation.getJid().asBareJid().equals(Config.BUG_REPORTS)) {
return false;
}
+ if (conversation.getContact().isOwnServer()) {
+ return false;
+ }
final String contact = conversation.getJid().getDomain();
final String account = conversation.getAccount().getServer();
if (Config.OMEMO_EXCEPTIONS.CONTACT_DOMAINS.contains(contact) || Config.OMEMO_EXCEPTIONS.ACCOUNT_DOMAINS.contains(account)) {
@@ -1109,7 +1112,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
public boolean isWithStranger() {
final Contact contact = getContact();
return mode == MODE_SINGLE
- && !contactJid.equals(Jid.ofDomain(account.getJid().getDomain()))
+ && !contact.isOwnServer()
&& !contact.showInRoster()
&& !contact.isSelf()
&& sentMessagesCount() == 0;