aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/Config.java2
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java2
-rw-r--r--src/main/java/eu/siacs/conversations/utils/XmppUri.java15
3 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index dcfe57e63..1af85eae7 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -56,6 +56,8 @@ public final class Config {
public static final boolean SHOW_DISABLE_FOREGROUND = false; //if set to true the foreground notification has a button to disable it
public static final boolean USE_ALWAYS_FOREGROUND = true; //if set to true the foreground service is always enabled
+ public static final boolean ALWAYS_NOTIFY_BY_DEFAULT = false;
+
public static final int PING_MAX_INTERVAL = 300;
public static final int IDLE_PING_INTERVAL = 600; //540 is minimum according to docs;
public static final int PING_MIN_INTERVAL = 30;
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index a8f809b08..409440345 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -820,7 +820,7 @@ public class Conversation extends AbstractEntity implements Blockable {
}
public boolean alwaysNotify() {
- return mode == MODE_SINGLE || getBooleanAttribute(ATTRIBUTE_ALWAYS_NOTIFY, true);
+ return mode == MODE_SINGLE || getBooleanAttribute(ATTRIBUTE_ALWAYS_NOTIFY, Config.ALWAYS_NOTIFY_BY_DEFAULT || isPnNA());
}
public boolean setAttribute(String key, String value) {
diff --git a/src/main/java/eu/siacs/conversations/utils/XmppUri.java b/src/main/java/eu/siacs/conversations/utils/XmppUri.java
index 079c3b62d..9d42a639b 100644
--- a/src/main/java/eu/siacs/conversations/utils/XmppUri.java
+++ b/src/main/java/eu/siacs/conversations/utils/XmppUri.java
@@ -35,9 +35,18 @@ public class XmppUri {
String scheme = uri.getScheme();
String host = uri.getHost();
List<String> segments = uri.getPathSegments();
- if ("https".equalsIgnoreCase(scheme) && "jabber.pix-art.de".equalsIgnoreCase(host) && segments.size() >= 3) {
- // sample : https://conversations.im/i/foo/bar.com
- jid = segments.get(1)+"@"+segments.get(2);
+ if ("https".equalsIgnoreCase(scheme) && "jabber.pix-art.de".equalsIgnoreCase(host)) {
+ if (segments.size() >= 2 && segments.get(1).contains("@")) {
+ // sample : https://conversations.im/i/foo@bar.com
+ try {
+ jid = Jid.fromString(segments.get(1)).toString();
+ } catch (Exception e) {
+ jid = null;
+ }
+ } else if (segments.size() >= 3) {
+ // sample : https://conversations.im/i/foo/bar.com
+ jid = segments.get(1) + "@" + segments.get(2);
+ }
} else if ("xmpp".equalsIgnoreCase(scheme)) {
// sample: xmpp:foo@bar.com
muc = "join".equalsIgnoreCase(uri.getQuery());