From d3dd80eec984b0324cf4a93510fda69eadc6f4d0 Mon Sep 17 00:00:00 2001 From: licaon-kter Date: Sun, 19 Feb 2017 15:47:57 +0200 Subject: [PATCH] Fix a typo in legacy --- .../eu/siacs/conversations/entities/MucOptions.java | 4 ++-- .../eu/siacs/conversations/generator/IqGenerator.java | 4 ++-- .../eu/siacs/conversations/parser/MessageParser.java | 10 +++++----- .../conversations/services/MessageArchiveService.java | 2 +- .../conversations/services/XmppConnectionService.java | 6 +++--- src/main/java/eu/siacs/conversations/utils/Xmlns.java | 2 +- .../eu/siacs/conversations/xmpp/XmppConnection.java | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index 03d491061..efbddcf38 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -374,11 +374,11 @@ public class MucOptions { } public boolean mamSupport() { - return hasFeature(Xmlns.MAM) || hasFeature(Xmlns.MAM_LAGECY); + return hasFeature(Xmlns.MAM) || hasFeature(Xmlns.MAM_LEGACY); } public boolean mamLegacy() { - return hasFeature(Xmlns.MAM_LAGECY) && !hasFeature(Xmlns.MAM); + return hasFeature(Xmlns.MAM_LEGACY) && !hasFeature(Xmlns.MAM); } public boolean nonanonymous() { diff --git a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java index 2d371ab6f..3ad93857c 100644 --- a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java @@ -229,10 +229,10 @@ public class IqGenerator extends AbstractGenerator { public IqPacket queryMessageArchiveManagement(final MessageArchiveService.Query mam) { final IqPacket packet = new IqPacket(IqPacket.TYPE.SET); - final Element query = packet.query(mam.isLegacy() ? Xmlns.MAM_LAGECY : Xmlns.MAM); + final Element query = packet.query(mam.isLegacy() ? Xmlns.MAM_LEGACY : Xmlns.MAM); query.setAttribute("queryid", mam.getQueryId()); final Data data = new Data(); - data.setFormType(mam.isLegacy() ? Xmlns.MAM_LAGECY : Xmlns.MAM); + data.setFormType(mam.isLegacy() ? Xmlns.MAM_LEGACY : Xmlns.MAM); if (mam.muc()) { packet.setTo(mam.getWith()); } else if (mam.getWith()!=null) { diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index c0b29098c..8b0f263b8 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -300,16 +300,16 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece final boolean isForwarded; boolean isCarbon = false; String serverMsgId = null; - final Element fin = original.findChild("fin", Xmlns.MAM_LAGECY); + final Element fin = original.findChild("fin", Xmlns.MAM_LEGACY); if (fin != null) { - mXmppConnectionService.getMessageArchiveService().processFinLagecy(fin,original.getFrom()); + mXmppConnectionService.getMessageArchiveService().processFinLegacy(fin,original.getFrom()); return; } - final boolean mamLagecy = original.hasChild("result",Xmlns.MAM_LAGECY); - final Element result = original.findChild("result",mamLagecy ? Xmlns.MAM_LAGECY : Xmlns.MAM); + final boolean mamLegacy = original.hasChild("result",Xmlns.MAM_LEGACY); + final Element result = original.findChild("result",mamLegacy ? Xmlns.MAM_LEGACY : Xmlns.MAM); final MessageArchiveService.Query query = result == null ? null : mXmppConnectionService.getMessageArchiveService().findQuery(result.getAttribute("queryid")); if (query != null && query.validFrom(original.getFrom())) { - Pair f = original.getForwardedMessagePacket("result", mamLagecy ? Xmlns.MAM_LAGECY : Xmlns.MAM); + Pair f = original.getForwardedMessagePacket("result", mamLegacy ? Xmlns.MAM_LEGACY : Xmlns.MAM); if (f == null) { return; } diff --git a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java index ca6791644..6ba05f56e 100644 --- a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java +++ b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java @@ -221,7 +221,7 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { return queryInProgress(conversation, null); } - public void processFinLagecy(Element fin, Jid from) { + public void processFinLegacy(Element fin, Jid from) { Query query = findQuery(fin.getAttribute("queryid")); if (query != null && query.validFrom(from)) { processFin(fin); diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 009d71d9f..6084701bc 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -3714,13 +3714,13 @@ public class XmppConnectionService extends Service { } public void fetchMamPreferences(Account account, final OnMamPreferencesFetched callback) { - final boolean lagecy = account.getXmppConnection().getFeatures().mamLegacy(); + final boolean legacy = account.getXmppConnection().getFeatures().mamLegacy(); IqPacket request = new IqPacket(IqPacket.TYPE.GET); - request.addChild("prefs",lagecy ? Xmlns.MAM_LAGECY : Xmlns.MAM); + request.addChild("prefs",legacy ? Xmlns.MAM_LEGACY : Xmlns.MAM); sendIqPacket(account, request, new OnIqPacketReceived() { @Override public void onIqPacketReceived(Account account, IqPacket packet) { - Element prefs = packet.findChild("prefs",lagecy ? Xmlns.MAM_LAGECY : Xmlns.MAM); + Element prefs = packet.findChild("prefs",legacy ? Xmlns.MAM_LEGACY : Xmlns.MAM); if (packet.getType() == IqPacket.TYPE.RESULT && prefs != null) { callback.onPreferencesFetched(prefs); } else { diff --git a/src/main/java/eu/siacs/conversations/utils/Xmlns.java b/src/main/java/eu/siacs/conversations/utils/Xmlns.java index e0c501c78..4edd8805c 100644 --- a/src/main/java/eu/siacs/conversations/utils/Xmlns.java +++ b/src/main/java/eu/siacs/conversations/utils/Xmlns.java @@ -8,5 +8,5 @@ public final class Xmlns { public static final String HTTP_UPLOAD = "urn:xmpp:http:upload"; public static final String STANZA_IDS = "urn:xmpp:sid:0"; public static final String MAM = "urn:xmpp:mam:1"; - public static final String MAM_LAGECY = "urn:xmpp:mam:0"; + public static final String MAM_LEGACY = "urn:xmpp:mam:0"; } diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index b5bc0fa0d..bbc3bdbd9 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -1631,12 +1631,12 @@ public class XmppConnection implements Runnable { public boolean mam() { return hasDiscoFeature(account.getJid().toBareJid(), Xmlns.MAM) - || hasDiscoFeature(account.getJid().toBareJid(), Xmlns.MAM_LAGECY); + || hasDiscoFeature(account.getJid().toBareJid(), Xmlns.MAM_LEGACY); } public boolean mamLegacy() { return !hasDiscoFeature(account.getJid().toBareJid(),Xmlns.MAM) - && hasDiscoFeature(account.getJid().toBareJid(),Xmlns.MAM_LAGECY); + && hasDiscoFeature(account.getJid().toBareJid(),Xmlns.MAM_LEGACY); } public boolean push() {