aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-10-08 18:53:09 +0200
committerChristian Schneppe <christian@pix-art.de>2016-10-08 18:53:09 +0200
commit0449a20665af917bb1f14d91f0dc5b9a0fb93f69 (patch)
treed22e3faad5acf23bbf4a2c250f88c85d63a1595a /src/main
parentda3ce3f265be8da595b72f6d4777095cda4e71bc (diff)
fetch new conference configuration on every conf update
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/entities/MucOptions.java1
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java37
2 files changed, 18 insertions, 20 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java
index 51e502deb..7b341c916 100644
--- a/src/main/java/de/pixart/messenger/entities/MucOptions.java
+++ b/src/main/java/de/pixart/messenger/entities/MucOptions.java
@@ -126,7 +126,6 @@ public class MucOptions {
UNKNOWN
}
- public static final String STATUS_CODE_ROOM_CONFIG_CHANGED = "104";
public static final String STATUS_CODE_SELF_PRESENCE = "110";
public static final String STATUS_CODE_ROOM_CREATED = "201";
public static final String STATUS_CODE_BANNED = "301";
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index f91fcf977..4b6428514 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -583,26 +583,25 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
}
if (conversation != null && mucUserElement != null && from.isBareJid()) {
- if (mucUserElement.hasChild("status")) {
- for (Element child : mucUserElement.getChildren()) {
- if (child.getName().equals("status")
- && MucOptions.STATUS_CODE_ROOM_CONFIG_CHANGED.equals(child.getAttribute("code"))) {
- mXmppConnectionService.fetchConferenceConfiguration(conversation);
- }
- }
- } else if (mucUserElement.hasChild("item")) {
- for(Element child : mucUserElement.getChildren()) {
- if ("item".equals(child.getName())) {
- MucOptions.User user = AbstractParser.parseItem(conversation,child);
- Log.d(Config.LOGTAG,account.getJid()+": changing affiliation for "
- +user.getRealJid()+" to "+user.getAffiliation()+" in "
- +conversation.getJid().toBareJid());
- if (!user.realJidMatchesAccount()) {
- conversation.getMucOptions().addUser(user);
- mXmppConnectionService.getAvatarService().clear(conversation);
- mXmppConnectionService.updateMucRosterUi();
- mXmppConnectionService.updateConversationUi();
+ for (Element child : mucUserElement.getChildren()) {
+ if ("status".equals(child.getName())) {
+ try {
+ int code = Integer.parseInt(child.getAttribute("code"));
+ if ((code >= 170 && code <= 174) || (code >= 102 && code <= 104)) {
+ mXmppConnectionService.fetchConferenceConfiguration(conversation);
+ break;
}
+ } catch (Exception e) {
+ //ignored
+ }
+ } else if ("item".equals(child.getName())) {
+ MucOptions.User user = AbstractParser.parseItem(conversation,child);
+ Log.d(Config.LOGTAG,account.getJid()+": changing affiliation for " + user.getRealJid()+" to " + user.getAffiliation() + " in " + conversation.getJid().toBareJid());
+ if (!user.realJidMatchesAccount()) {
+ conversation.getMucOptions().addUser(user);
+ mXmppConnectionService.getAvatarService().clear(conversation);
+ mXmppConnectionService.updateMucRosterUi();
+ mXmppConnectionService.updateConversationUi();
}
}
}