1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-24 03:27:59 +01:00

Do net set a default language when parsing Message stanzas

the fallback is (usually) not needed, as most XMPP XML streams have a default
xml:lang set (See RFC 6120 § 4.7.4.).
This commit is contained in:
Florian Schmaus 2018-05-09 16:50:19 +02:00
parent 93c2b2be26
commit cd5daa6fd7

View file

@ -231,16 +231,7 @@ public class PacketParserUtils {
message.setType(Message.Type.fromString(typeString));
}
String language = getLanguageAttribute(parser);
// determine message's default language
String defaultLanguage;
if (language != null && !"".equals(language.trim())) {
message.setLanguage(language);
defaultLanguage = language;
}
else {
defaultLanguage = Stanza.getDefaultLanguage();
}
message.setLanguage(language);
// Parse sub-elements. We include extra logic to make sure the values
// are only read once. This is because it's possible for the names to appear