ignore non letters when parsing action from xmpp uri

This commit is contained in:
Daniel Gultsch 2021-09-27 11:15:56 +02:00
parent 3de8147b41
commit e791e19265
1 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,8 @@ import android.net.Uri;
import androidx.annotation.NonNull; 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.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
@ -189,7 +191,10 @@ public class XmppUri {
} }
public boolean isAction(final String action) { 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() { public Jid getJid() {