mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
add support for localized Message subjects (fixes SMACK-310)
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@11825 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
cb5310c984
commit
7a3818783b
3 changed files with 492 additions and 12 deletions
|
@ -83,7 +83,6 @@ public class PacketParserUtils {
|
|||
// are only read once. This is because it's possible for the names to appear
|
||||
// in arbitrary sub-elements.
|
||||
boolean done = false;
|
||||
String subject = null;
|
||||
String thread = null;
|
||||
Map<String, Object> properties = null;
|
||||
while (!done) {
|
||||
|
@ -92,8 +91,15 @@ public class PacketParserUtils {
|
|||
String elementName = parser.getName();
|
||||
String namespace = parser.getNamespace();
|
||||
if (elementName.equals("subject")) {
|
||||
if (subject == null) {
|
||||
subject = parser.nextText();
|
||||
String xmlLang = getLanguageAttribute(parser);
|
||||
if (xmlLang == null) {
|
||||
xmlLang = defaultLanguage;
|
||||
}
|
||||
|
||||
String subject = parseContent(parser);
|
||||
|
||||
if (message.getSubject(xmlLang) == null) {
|
||||
message.addSubject(xmlLang, subject);
|
||||
}
|
||||
}
|
||||
else if (elementName.equals("body")) {
|
||||
|
@ -133,7 +139,7 @@ public class PacketParserUtils {
|
|||
}
|
||||
}
|
||||
}
|
||||
message.setSubject(subject);
|
||||
|
||||
message.setThread(thread);
|
||||
// Set packet properties.
|
||||
if (properties != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue