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

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 <georg@op-co.de>
This commit is contained in:
Georg Lukas 2018-11-27 18:33:39 +01:00
parent 229653af30
commit 8b88f9cb20

View file

@ -269,12 +269,12 @@ public class Bookmarks implements PrivateData {
private static BookmarkedConference getConferenceStorage(XmlPullParser parser) throws XmlPullParserException, IOException { private static BookmarkedConference getConferenceStorage(XmlPullParser parser) throws XmlPullParserException, IOException {
String name = parser.getAttributeValue("", "name"); String name = parser.getAttributeValue("", "name");
String autojoin = parser.getAttributeValue("", "autojoin"); boolean autojoin = ParserUtils.getBooleanAttribute(parser, "autojoin", false);
EntityBareJid jid = ParserUtils.getBareJidAttribute(parser); EntityBareJid jid = ParserUtils.getBareJidAttribute(parser);
BookmarkedConference conf = new BookmarkedConference(jid); BookmarkedConference conf = new BookmarkedConference(jid);
conf.setName(name); conf.setName(name);
conf.setAutoJoin(Boolean.valueOf(autojoin)); conf.setAutoJoin(autojoin);
// Check for nickname // Check for nickname
boolean done = false; boolean done = false;