diff options
author | steckbrief <steckbrief@chefmail.de> | 2016-02-28 21:48:09 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2016-02-28 21:48:09 +0100 |
commit | cd0c6ce48e2ac36d9524908acbbc79690b193d9a (patch) | |
tree | e03621214377147d44a13917485baf16b607a11a /src/main/java/eu/siacs/conversations/parser | |
parent | 8fb6204288d55f8af16ae47e32fa6c049284cadd (diff) | |
parent | c393e6089177f31683c4cecfdb359802de1b5e0c (diff) |
Merge tag '1.10.1' into trz/merge_1.10.1
Conflicts:
README.md
build.gradle
src/main/java/eu/siacs/conversations/entities/ListItem.java
src/main/java/eu/siacs/conversations/parser/MessageParser.java
src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
src/main/res/menu/message_context.xml
src/main/res/xml/preferences.xml
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/parser/MessageParser.java | 8 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/parser/PresenceParser.java | 22 |
2 files changed, 17 insertions, 13 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 22446453..480adf25 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -4,7 +4,7 @@ import android.util.Log; import android.util.Pair; import de.tzur.conversations.Settings; -import eu.siacs.conversations.crypto.PgpDecryptionService; + import net.java.otr4j.session.Session; import net.java.otr4j.session.SessionStatus; @@ -351,7 +351,7 @@ public class MessageParser extends AbstractParser implements } } Message message; - if (body != null && body.startsWith("?OTR")) { + if (body != null && body.startsWith("?OTR") && Config.supportOtr()) { if (!isForwarded && !isTypeGroupChat && isProperlyAddressed) { message = parseOtrChat(body, from, remoteMsgId, conversation); if (message == null) { @@ -361,9 +361,9 @@ public class MessageParser extends AbstractParser implements Logging.d(Config.LOGTAG,account.getJid().toBareJid()+": ignoring OTR message from "+from+" isForwarded="+Boolean.toString(isForwarded)+", isProperlyAddressed="+Boolean.valueOf(isProperlyAddressed)); message = new Message(conversation, body, Message.ENCRYPTION_NONE, status); } - } else if (pgpEncrypted != null) { + } else if (pgpEncrypted != null && Config.supportOpenPgp()) { message = new Message(conversation, pgpEncrypted, Message.ENCRYPTION_PGP, status); - } else if (axolotlEncrypted != null) { + } else if (axolotlEncrypted != null && Config.supportOmemo()) { message = parseAxolotlChat(axolotlEncrypted, from, remoteMsgId, conversation, status); if (message == null) { return; diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java index c765dbd0..41e56079 100644 --- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java @@ -69,7 +69,7 @@ public class PresenceParser extends AbstractParser implements if (x != null) { Element item = x.findChild("item"); if (item != null && !from.isBareJid()) { - mucOptions.setError(MucOptions.ERROR_NO_ERROR); + mucOptions.setError(MucOptions.Error.NONE); MucOptions.User user = new MucOptions.User(mucOptions,from); user.setAffiliation(item.getAttribute("affiliation")); user.setRole(item.getAttribute("role")); @@ -115,13 +115,17 @@ public class PresenceParser extends AbstractParser implements if (codes.contains(MucOptions.STATUS_CODE_CHANGED_NICK)) { mucOptions.mNickChangingInProgress = true; } else if (codes.contains(MucOptions.STATUS_CODE_KICKED)) { - mucOptions.setError(MucOptions.KICKED_FROM_ROOM); + mucOptions.setError(MucOptions.Error.KICKED); } else if (codes.contains(MucOptions.STATUS_CODE_BANNED)) { - mucOptions.setError(MucOptions.ERROR_BANNED); + mucOptions.setError(MucOptions.Error.BANNED); } else if (codes.contains(MucOptions.STATUS_CODE_LOST_MEMBERSHIP)) { - mucOptions.setError(MucOptions.ERROR_MEMBERS_ONLY); + mucOptions.setError(MucOptions.Error.MEMBERS_ONLY); + } else if (codes.contains(MucOptions.STATUS_CODE_AFFILIATION_CHANGE)) { + mucOptions.setError(MucOptions.Error.MEMBERS_ONLY); + } else if (codes.contains(MucOptions.STATUS_CODE_SHUTDOWN)) { + mucOptions.setError(MucOptions.Error.SHUTDOWN); } else { - mucOptions.setError(MucOptions.ERROR_UNKNOWN); + mucOptions.setError(MucOptions.Error.UNKNOWN); Log.d(Config.LOGTAG, "unknown error in conference: " + packet); } } else if (!from.isBareJid()){ @@ -138,14 +142,14 @@ public class PresenceParser extends AbstractParser implements mucOptions.onRenameListener.onFailure(); } } else { - mucOptions.setError(MucOptions.ERROR_NICK_IN_USE); + mucOptions.setError(MucOptions.Error.NICK_IN_USE); } } else if (error != null && error.hasChild("not-authorized")) { - mucOptions.setError(MucOptions.ERROR_PASSWORD_REQUIRED); + mucOptions.setError(MucOptions.Error.PASSWORD_REQUIRED); } else if (error != null && error.hasChild("forbidden")) { - mucOptions.setError(MucOptions.ERROR_BANNED); + mucOptions.setError(MucOptions.Error.BANNED); } else if (error != null && error.hasChild("registration-required")) { - mucOptions.setError(MucOptions.ERROR_MEMBERS_ONLY); + mucOptions.setError(MucOptions.Error.BANNED); } } } |