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
1 changed files with 6 additions and 1 deletions

View File

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