aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-06-28 20:11:28 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-06-28 20:11:28 +0200
commit46595b6d43679f17cb8e374b2120ab7889423555 (patch)
treec6a48a9eff210924bf37635a8035f2f71855de97 /src/main
parent35782636864f4567729b99b4a1c96d9495fcdab1 (diff)
fixed parsing of muc status messages in new message parser
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index 96568fbd..946e4b6f 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -364,13 +364,25 @@ public class MessageParser extends AbstractParser implements
mXmppConnectionService.getNotificationService().push(message);
}
} else { //no body
- if (packet.hasChild("subject") && isTypeGroupChat) {
+ if (isTypeGroupChat) {
Conversation conversation = mXmppConnectionService.find(account, from.toBareJid());
- if (conversation != null && conversation.getMode() == Conversation.MODE_MULTI) {
- conversation.setHasMessagesLeftOnServer(conversation.countMessages() > 0);
- conversation.getMucOptions().setSubject(packet.findChildContent("subject"));
- mXmppConnectionService.updateConversationUi();
- return;
+ if (packet.hasChild("subject")) {
+ if (conversation != null && conversation.getMode() == Conversation.MODE_MULTI) {
+ conversation.setHasMessagesLeftOnServer(conversation.countMessages() > 0);
+ conversation.getMucOptions().setSubject(packet.findChildContent("subject"));
+ mXmppConnectionService.updateConversationUi();
+ return;
+ }
+ }
+
+ final Element x = packet.findChild("x", "http://jabber.org/protocol/muc#user");
+ if (conversation != null && x != null && from.isBareJid()) {
+ for (Element child : x.getChildren()) {
+ if (child.getName().equals("status")
+ && MucOptions.STATUS_CODE_ROOM_CONFIG_CHANGED.equals(child.getAttribute("code"))) {
+ mXmppConnectionService.fetchConferenceConfiguration(conversation);
+ }
+ }
}
}
}