mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 10:37:59 +01:00
Merge pull request #287 from ge0rg/4.3
Partially fix boolean parser, 4.3 branch
This commit is contained in:
commit
b675f49b3d
3 changed files with 5 additions and 4 deletions
|
@ -141,7 +141,7 @@ public class ParserUtils {
|
|||
if (valueString == null)
|
||||
return null;
|
||||
valueString = valueString.toLowerCase(Locale.US);
|
||||
return valueString.equals("true") || valueString.equals("0");
|
||||
return valueString.equals("true") || valueString.equals("1");
|
||||
}
|
||||
|
||||
public static boolean getBooleanAttribute(XmlPullParser parser, String name,
|
||||
|
|
|
@ -269,12 +269,12 @@ public class Bookmarks implements PrivateData {
|
|||
|
||||
private static BookmarkedConference getConferenceStorage(XmlPullParser parser) throws XmlPullParserException, IOException {
|
||||
String name = parser.getAttributeValue("", "name");
|
||||
String autojoin = parser.getAttributeValue("", "autojoin");
|
||||
boolean autojoin = ParserUtils.getBooleanAttribute(parser, "autojoin", false);
|
||||
EntityBareJid jid = ParserUtils.getBareJidAttribute(parser);
|
||||
|
||||
BookmarkedConference conf = new BookmarkedConference(jid);
|
||||
conf.setName(name);
|
||||
conf.setAutoJoin(Boolean.valueOf(autojoin));
|
||||
conf.setAutoJoin(autojoin);
|
||||
|
||||
// Check for nickname
|
||||
boolean done = false;
|
||||
|
|
|
@ -207,7 +207,8 @@ public class RoomInfo {
|
|||
|
||||
FormField subjectmodField = form.getField("muc#roominfo_subjectmod");
|
||||
if (subjectmodField != null && !subjectmodField.getValues().isEmpty()) {
|
||||
subjectmod = Boolean.valueOf(subjectmodField.getFirstValue());
|
||||
String firstValue = subjectmodField.getFirstValue();
|
||||
subjectmod = ("true".equals(firstValue) || "1".equals(firstValue));
|
||||
}
|
||||
|
||||
FormField urlField = form.getField("muc#roominfo_logs");
|
||||
|
|
Loading…
Reference in a new issue