1package eu.siacs.conversations.xmpp.jingle;
2
3import im.conversations.android.xmpp.model.disco.external.Services;
4import im.conversations.android.xmpp.model.stanza.Iq;
5import java.util.Collection;
6import java.util.Collections;
7import org.webrtc.PeerConnection;
8
9public final class IceServers {
10
11 public static Collection<PeerConnection.IceServer> parse(final Iq response) {
12 if (response.getType() != Iq.Type.RESULT) {
13 return Collections.emptySet();
14 }
15 final var services = response.getExtension(Services.class);
16 if (services == null) {
17 return Collections.emptySet();
18 }
19 return services.getIceServers();
20 }
21}