From e791e1926579cea262396d1786b45675aced8c9f Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 27 Sep 2021 11:15:56 +0200 Subject: [PATCH] ignore non letters when parsing action from xmpp uri --- src/main/java/eu/siacs/conversations/utils/XmppUri.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/utils/XmppUri.java b/src/main/java/eu/siacs/conversations/utils/XmppUri.java index d0f4cf421..ebd596d6c 100644 --- a/src/main/java/eu/siacs/conversations/utils/XmppUri.java +++ b/src/main/java/eu/siacs/conversations/utils/XmppUri.java @@ -4,6 +4,8 @@ import android.net.Uri; import androidx.annotation.NonNull; +import com.google.common.base.CharMatcher; +import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -189,7 +191,10 @@ public class XmppUri { } public boolean isAction(final String action) { - return parameters.containsKey(action); + return Collections2.transform( + parameters.keySet(), + s -> CharMatcher.inRange('a', 'z').or(CharMatcher.inRange('A', 'z')).retainFrom(s) + ).contains(action); } public Jid getJid() {