1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 22:32:06 +01:00

Fix BytestreamsProvider: Mode is optional

and defaults to TCP.
This commit is contained in:
Florian Schmaus 2015-03-07 20:51:23 +01:00
parent 9c5b7d263e
commit 2db5ebb4b7

View file

@ -20,6 +20,7 @@ import java.io.IOException;
import org.jivesoftware.smack.provider.IQProvider; import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream; import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.Mode;
import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserException;
@ -81,7 +82,11 @@ public class BytestreamsProvider extends IQProvider<Bytestream> {
} }
} }
if (mode == null) {
toReturn.setMode(Mode.tcp);
} else {
toReturn.setMode((Bytestream.Mode.fromName(mode))); toReturn.setMode((Bytestream.Mode.fromName(mode)));
}
toReturn.setSessionID(id); toReturn.setSessionID(id);
return toReturn; return toReturn;
} }