From 8b88f9cb20b86f302c91684d8cd73823599b703d Mon Sep 17 00:00:00 2001 From: Georg Lukas Date: Tue, 27 Nov 2018 18:33:39 +0100 Subject: [PATCH] Bookmarks: use proper boolean parser for `autojoin` Some clients (read: Gajim) store boolean values as `0` and `1` instead of `false` and `true`, which is legal for the XML boolean type. Signed-off-by: Georg Lukas --- .../java/org/jivesoftware/smackx/bookmarks/Bookmarks.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/Bookmarks.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/Bookmarks.java index 322d0c8bb..f89e40f49 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/Bookmarks.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/Bookmarks.java @@ -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;