stricter bind 2 inline feature parsing

This commit is contained in:
Daniel Gultsch 2023-11-21 15:24:31 +01:00
parent acef5dbd3b
commit 5bb8f3f9aa
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -1,5 +1,6 @@
package eu.siacs.conversations.xmpp.bind;
import com.google.common.base.Predicates;
import com.google.common.collect.Collections2;
import java.util.Arrays;
@ -27,7 +28,12 @@ public class Bind2 {
if (inlineBind2Inline == null) {
return Collections.emptyList();
}
return Collections2.transform(
inlineBind2Inline.getChildren(), c -> c == null ? null : c.getAttribute("var"));
return Collections2.filter(
Collections2.transform(
Collections2.filter(
inlineBind2Inline.getChildren(),
c -> "feature".equals(c.getName())),
c -> c.getAttribute("var")),
Predicates.notNull());
}
}