diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-03-04 17:05:47 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-03-04 17:05:47 +0100 |
commit | cedc4305c20aa76aa6ffa9a5443578e57023e1ca (patch) | |
tree | 62ffe4ed374e029385659d64919b144ea64626a7 /src | |
parent | a2a9ce1caeabed2e29f702933f1fd18d949b75ec (diff) |
rename the Xmlns class to Namespace
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/MucOptions.java | 6 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/generator/IqGenerator.java | 16 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/http/HttpUploadConnection.java | 6 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/parser/IqParser.java | 14 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/parser/MessageParser.java | 14 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/services/MessageArchiveService.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 13 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/Namespace.java (renamed from src/main/java/de/pixart/messenger/utils/Xmlns.java) | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 24 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java | 8 |
10 files changed, 53 insertions, 54 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java index d9b6f9c92..068e2f95b 100644 --- a/src/main/java/de/pixart/messenger/entities/MucOptions.java +++ b/src/main/java/de/pixart/messenger/entities/MucOptions.java @@ -8,7 +8,7 @@ import java.util.List; import java.util.Set; import de.pixart.messenger.R; -import de.pixart.messenger.utils.Xmlns; +import de.pixart.messenger.utils.Namespace; import de.pixart.messenger.xmpp.forms.Data; import de.pixart.messenger.xmpp.forms.Field; import de.pixart.messenger.xmpp.jid.InvalidJidException; @@ -374,11 +374,11 @@ public class MucOptions { } public boolean mamSupport() { - return hasFeature(Xmlns.MAM) || hasFeature(Xmlns.MAM_LEGACY); + return hasFeature(Namespace.MAM) || hasFeature(Namespace.MAM_LEGACY); } public boolean mamLegacy() { - return hasFeature(Xmlns.MAM_LEGACY) && !hasFeature(Xmlns.MAM); + return hasFeature(Namespace.MAM_LEGACY) && !hasFeature(Namespace.MAM); } public boolean nonanonymous() { diff --git a/src/main/java/de/pixart/messenger/generator/IqGenerator.java b/src/main/java/de/pixart/messenger/generator/IqGenerator.java index f93e3e071..6658f1a21 100644 --- a/src/main/java/de/pixart/messenger/generator/IqGenerator.java +++ b/src/main/java/de/pixart/messenger/generator/IqGenerator.java @@ -27,7 +27,7 @@ import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.entities.DownloadableFile; import de.pixart.messenger.services.MessageArchiveService; import de.pixart.messenger.services.XmppConnectionService; -import de.pixart.messenger.utils.Xmlns; +import de.pixart.messenger.utils.Namespace; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xmpp.forms.Data; import de.pixart.messenger.xmpp.jid.Jid; @@ -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_LEGACY : Xmlns.MAM); + final Element query = packet.query(mam.isLegacy() ? Namespace.MAM_LEGACY : Namespace.MAM); query.setAttribute("queryid", mam.getQueryId()); final Data data = new Data(); - data.setFormType(mam.isLegacy() ? Xmlns.MAM_LEGACY : Xmlns.MAM); + data.setFormType(mam.isLegacy() ? Namespace.MAM_LEGACY : Namespace.MAM); if (mam.muc()) { packet.setTo(mam.getWith()); } else if (mam.getWith() != null) { @@ -252,14 +252,14 @@ public class IqGenerator extends AbstractGenerator { public IqPacket generateGetBlockList() { final IqPacket iq = new IqPacket(IqPacket.TYPE.GET); - iq.addChild("blocklist", Xmlns.BLOCKING); + iq.addChild("blocklist", Namespace.BLOCKING); return iq; } public IqPacket generateSetBlockRequest(final Jid jid, boolean reportSpam) { final IqPacket iq = new IqPacket(IqPacket.TYPE.SET); - final Element block = iq.addChild("block", Xmlns.BLOCKING); + final Element block = iq.addChild("block", Namespace.BLOCKING); final Element item = block.addChild("item").setAttribute("jid", jid.toBareJid().toString()); if (reportSpam) { item.addChild("report", "urn:xmpp:reporting:0").addChild("spam"); @@ -270,7 +270,7 @@ public class IqGenerator extends AbstractGenerator { public IqPacket generateSetUnblockRequest(final Jid jid) { final IqPacket iq = new IqPacket(IqPacket.TYPE.SET); - final Element block = iq.addChild("unblock", Xmlns.BLOCKING); + final Element block = iq.addChild("unblock", Namespace.BLOCKING); block.addChild("item").setAttribute("jid", jid.toBareJid().toString()); return iq; } @@ -278,7 +278,7 @@ public class IqGenerator extends AbstractGenerator { public IqPacket generateSetPassword(final Account account, final String newPassword) { final IqPacket packet = new IqPacket(IqPacket.TYPE.SET); packet.setTo(account.getServer()); - final Element query = packet.addChild("query", Xmlns.REGISTER); + final Element query = packet.addChild("query", Namespace.REGISTER); final Jid jid = account.getJid(); query.addChild("username").setContent(jid.getLocalpart()); query.addChild("password").setContent(newPassword); @@ -317,7 +317,7 @@ public class IqGenerator extends AbstractGenerator { public IqPacket requestHttpUploadSlot(Jid host, DownloadableFile file, String mime) { IqPacket packet = new IqPacket(IqPacket.TYPE.GET); packet.setTo(host); - Element request = packet.addChild("request", Xmlns.HTTP_UPLOAD); + Element request = packet.addChild("request", Namespace.HTTP_UPLOAD); request.addChild("filename").setContent(convertFilename(file.getName())); request.addChild("size").setContent(String.valueOf(file.getExpectedSize())); if (mime != null) { diff --git a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java index 19d92b353..15262e1a8 100644 --- a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java +++ b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java @@ -26,7 +26,7 @@ import de.pixart.messenger.services.AbstractConnectionManager; import de.pixart.messenger.services.XmppConnectionService; import de.pixart.messenger.ui.UiCallback; import de.pixart.messenger.utils.CryptoHelper; -import de.pixart.messenger.utils.Xmlns; +import de.pixart.messenger.utils.Namespace; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xmpp.OnIqPacketReceived; import de.pixart.messenger.xmpp.jid.Jid; @@ -119,13 +119,13 @@ public class HttpUploadConnection implements Transferable { this.file.setExpectedSize(pair.second); this.mFileInputStream = pair.first; } - Jid host = account.getXmppConnection().findDiscoItemByFeature(Xmlns.HTTP_UPLOAD); + Jid host = account.getXmppConnection().findDiscoItemByFeature(Namespace.HTTP_UPLOAD); IqPacket request = mXmppConnectionService.getIqGenerator().requestHttpUploadSlot(host, file, mime); mXmppConnectionService.sendIqPacket(account, request, new OnIqPacketReceived() { @Override public void onIqPacketReceived(Account account, IqPacket packet) { if (packet.getType() == IqPacket.TYPE.RESULT) { - Element slot = packet.findChild("slot", Xmlns.HTTP_UPLOAD); + Element slot = packet.findChild("slot", Namespace.HTTP_UPLOAD); if (slot != null) { try { mGetUrl = new URL(slot.findChildContent("get")); diff --git a/src/main/java/de/pixart/messenger/parser/IqParser.java b/src/main/java/de/pixart/messenger/parser/IqParser.java index 2e45db32a..073a36170 100644 --- a/src/main/java/de/pixart/messenger/parser/IqParser.java +++ b/src/main/java/de/pixart/messenger/parser/IqParser.java @@ -28,7 +28,7 @@ import de.pixart.messenger.entities.Account; import de.pixart.messenger.entities.Contact; import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.services.XmppConnectionService; -import de.pixart.messenger.utils.Xmlns; +import de.pixart.messenger.utils.Namespace; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xmpp.OnIqPacketReceived; import de.pixart.messenger.xmpp.OnUpdateBlocklist; @@ -287,19 +287,19 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { final boolean isGet = packet.getType() == IqPacket.TYPE.GET; if (packet.getType() == IqPacket.TYPE.ERROR || packet.getType() == IqPacket.TYPE.TIMEOUT) { return; - } else if (packet.hasChild("query", Xmlns.ROSTER) && packet.fromServer(account)) { + } else if (packet.hasChild("query", Namespace.ROSTER) && packet.fromServer(account)) { final Element query = packet.findChild("query"); // If this is in response to a query for the whole roster: if (packet.getType() == IqPacket.TYPE.RESULT) { account.getRoster().markAllAsNotInRoster(); } this.rosterItems(account, query); - } else if ((packet.hasChild("block", Xmlns.BLOCKING) || packet.hasChild("blocklist", Xmlns.BLOCKING)) && + } else if ((packet.hasChild("block", Namespace.BLOCKING) || packet.hasChild("blocklist", Namespace.BLOCKING)) && packet.fromServer(account)) { // Block list or block push. Log.d(Config.LOGTAG, "Received blocklist update from server"); - final Element blocklist = packet.findChild("blocklist", Xmlns.BLOCKING); - final Element block = packet.findChild("block", Xmlns.BLOCKING); + final Element blocklist = packet.findChild("blocklist", Namespace.BLOCKING); + final Element block = packet.findChild("block", Namespace.BLOCKING); final Collection<Element> items = blocklist != null ? blocklist.getChildren() : (block != null ? block.getChildren() : null); // If this is a response to a blocklist query, clear the block list and replace with the new one. @@ -335,10 +335,10 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { final IqPacket response = packet.generateResponse(IqPacket.TYPE.RESULT); mXmppConnectionService.sendIqPacket(account, response, null); } - } else if (packet.hasChild("unblock", Xmlns.BLOCKING) && + } else if (packet.hasChild("unblock", Namespace.BLOCKING) && packet.fromServer(account) && packet.getType() == IqPacket.TYPE.SET) { Log.d(Config.LOGTAG, "Received unblock update from server"); - final Collection<Element> items = packet.findChild("unblock", Xmlns.BLOCKING).getChildren(); + final Collection<Element> items = packet.findChild("unblock", Namespace.BLOCKING).getChildren(); if (items.size() == 0) { // No children to unblock == unblock all account.getBlocklist().clear(); diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java index be44d967b..ba8995108 100644 --- a/src/main/java/de/pixart/messenger/parser/MessageParser.java +++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java @@ -31,7 +31,7 @@ import de.pixart.messenger.http.HttpConnectionManager; import de.pixart.messenger.services.MessageArchiveService; import de.pixart.messenger.services.XmppConnectionService; import de.pixart.messenger.utils.CryptoHelper; -import de.pixart.messenger.utils.Xmlns; +import de.pixart.messenger.utils.Namespace; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xmpp.OnMessagePacketReceived; import de.pixart.messenger.xmpp.chatstate.ChatState; @@ -215,7 +215,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece private static String extractStanzaId(Element packet, Jid by) { for (Element child : packet.getChildren()) { if (child.getName().equals("stanza-id") - && Xmlns.STANZA_IDS.equals(child.getNamespace()) + && Namespace.STANZA_IDS.equals(child.getNamespace()) && by.equals(child.getAttributeAsJid("by"))) { return child.getAttribute("id"); } @@ -299,16 +299,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_LEGACY); + final Element fin = original.findChild("fin", Namespace.MAM_LEGACY); if (fin != null) { mXmppConnectionService.getMessageArchiveService().processFinLegacy(fin, original.getFrom()); return; } - final boolean mamlegacy = original.hasChild("result", Xmlns.MAM_LEGACY); - final Element result = original.findChild("result", mamlegacy ? Xmlns.MAM_LEGACY : Xmlns.MAM); + final boolean mamlegacy = original.hasChild("result", Namespace.MAM_LEGACY); + final Element result = original.findChild("result", mamlegacy ? Namespace.MAM_LEGACY : Namespace.MAM); final MessageArchiveService.Query query = result == null ? null : mXmppConnectionService.getMessageArchiveService().findQuery(result.getAttribute("queryid")); if (query != null && query.validFrom(original.getFrom())) { - Pair<MessagePacket, Long> f = original.getForwardedMessagePacket("result", mamlegacy ? Xmlns.MAM_LEGACY : Xmlns.MAM); + Pair<MessagePacket, Long> f = original.getForwardedMessagePacket("result", mamlegacy ? Namespace.MAM_LEGACY : Namespace.MAM); if (f == null) { return; } @@ -442,7 +442,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece final boolean safeToExtract; if (isTypeGroupChat) { by = conversation.getJid().toBareJid(); - safeToExtract = conversation.getMucOptions().hasFeature(Xmlns.STANZA_IDS); + safeToExtract = conversation.getMucOptions().hasFeature(Namespace.STANZA_IDS); } else { by = account.getJid().toBareJid(); safeToExtract = account.getXmppConnection().getFeatures().stanzaIds(); diff --git a/src/main/java/de/pixart/messenger/services/MessageArchiveService.java b/src/main/java/de/pixart/messenger/services/MessageArchiveService.java index 96a40d5d0..5e240b18d 100644 --- a/src/main/java/de/pixart/messenger/services/MessageArchiveService.java +++ b/src/main/java/de/pixart/messenger/services/MessageArchiveService.java @@ -14,7 +14,7 @@ import de.pixart.messenger.R; import de.pixart.messenger.entities.Account; import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.generator.AbstractGenerator; -import de.pixart.messenger.utils.Xmlns; +import de.pixart.messenger.utils.Namespace; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xmpp.OnAdvancedStreamFeaturesLoaded; import de.pixart.messenger.xmpp.OnIqPacketReceived; @@ -155,7 +155,7 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { this.mXmppConnectionService.sendIqPacket(account, packet, new OnIqPacketReceived() { @Override public void onIqPacketReceived(Account account, IqPacket packet) { - Element fin = packet.findChild("fin", Xmlns.MAM); + Element fin = packet.findChild("fin", Namespace.MAM); if (packet.getType() == IqPacket.TYPE.TIMEOUT) { synchronized (MessageArchiveService.this.queries) { MessageArchiveService.this.queries.remove(query); diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 931ccf06e..b2b3e5d68 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -119,7 +119,7 @@ import de.pixart.messenger.utils.PRNGFixes; import de.pixart.messenger.utils.PhoneHelper; import de.pixart.messenger.utils.ReplacingSerialSingleThreadExecutor; import de.pixart.messenger.utils.SerialSingleThreadExecutor; -import de.pixart.messenger.utils.Xmlns; +import de.pixart.messenger.utils.Namespace; import de.pixart.messenger.utils.XmppUri; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xmpp.OnBindListener; @@ -135,7 +135,6 @@ import de.pixart.messenger.xmpp.Patches; import de.pixart.messenger.xmpp.XmppConnection; import de.pixart.messenger.xmpp.chatstate.ChatState; import de.pixart.messenger.xmpp.forms.Data; -import de.pixart.messenger.xmpp.forms.Field; import de.pixart.messenger.xmpp.jid.InvalidJidException; import de.pixart.messenger.xmpp.jid.Jid; import de.pixart.messenger.xmpp.jingle.JingleConnectionManager; @@ -1461,7 +1460,7 @@ public class XmppConnectionService extends Service { } else { Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": fetching roster"); } - iqPacket.query(Xmlns.ROSTER).setAttribute("ver", account.getRosterVersion()); + iqPacket.query(Namespace.ROSTER).setAttribute("ver", account.getRosterVersion()); sendIqPacket(account, iqPacket, mIqParser); } @@ -2864,7 +2863,7 @@ public class XmppConnectionService extends Service { .getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST) && contact.getOption(Contact.Options.PREEMPTIVE_GRANT); final IqPacket iq = new IqPacket(IqPacket.TYPE.SET); - iq.query(Xmlns.ROSTER).addChild(contact.asElement()); + iq.query(Namespace.ROSTER).addChild(contact.asElement()); account.getXmppConnection().sendIqPacket(iq, mDefaultIqHandler); if (sendUpdates) { sendPresencePacket(account, @@ -3153,7 +3152,7 @@ public class XmppConnectionService extends Service { Account account = contact.getAccount(); if (account.getStatus() == Account.State.ONLINE) { IqPacket iq = new IqPacket(IqPacket.TYPE.SET); - Element item = iq.query(Xmlns.ROSTER).addChild("item"); + Element item = iq.query(Namespace.ROSTER).addChild("item"); item.setAttribute("jid", contact.getJid().toString()); item.setAttribute("subscription", "remove"); account.getXmppConnection().sendIqPacket(iq, mDefaultIqHandler); @@ -3822,11 +3821,11 @@ public class XmppConnectionService extends Service { public void fetchMamPreferences(Account account, final OnMamPreferencesFetched callback) { final boolean legacy = account.getXmppConnection().getFeatures().mamLegacy(); IqPacket request = new IqPacket(IqPacket.TYPE.GET); - request.addChild("prefs",legacy ? Xmlns.MAM_LEGACY : Xmlns.MAM); + request.addChild("prefs",legacy ? Namespace.MAM_LEGACY : Namespace.MAM); sendIqPacket(account, request, new OnIqPacketReceived() { @Override public void onIqPacketReceived(Account account, IqPacket packet) { - Element prefs = packet.findChild("prefs",legacy ? Xmlns.MAM_LEGACY : Xmlns.MAM); + Element prefs = packet.findChild("prefs",legacy ? Namespace.MAM_LEGACY : Namespace.MAM); if (packet.getType() == IqPacket.TYPE.RESULT && prefs != null) { callback.onPreferencesFetched(prefs); } else { diff --git a/src/main/java/de/pixart/messenger/utils/Xmlns.java b/src/main/java/de/pixart/messenger/utils/Namespace.java index dbe1aaade..bc6d56752 100644 --- a/src/main/java/de/pixart/messenger/utils/Xmlns.java +++ b/src/main/java/de/pixart/messenger/utils/Namespace.java @@ -1,6 +1,6 @@ package de.pixart.messenger.utils; -public final class Xmlns { +public final class Namespace { public static final String BLOCKING = "urn:xmpp:blocking"; public static final String ROSTER = "jabber:iq:roster"; public static final String REGISTER = "jabber:iq:register"; diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 7c7602ce9..48d4c631a 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -70,7 +70,7 @@ import de.pixart.messenger.ui.EditAccountActivity; import de.pixart.messenger.utils.DNSHelper; import de.pixart.messenger.utils.SSLSocketHelper; import de.pixart.messenger.utils.SocksSocketFactory; -import de.pixart.messenger.utils.Xmlns; +import de.pixart.messenger.utils.Namespace; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xml.Tag; import de.pixart.messenger.xml.TagWriter; @@ -1631,7 +1631,7 @@ public class XmppConnection implements Runnable { } public boolean blocking() { - return hasDiscoFeature(account.getServer(), Xmlns.BLOCKING); + return hasDiscoFeature(account.getServer(), Namespace.BLOCKING); } public boolean spamReporting() { @@ -1639,7 +1639,7 @@ public class XmppConnection implements Runnable { } public boolean register() { - return hasDiscoFeature(account.getServer(), Xmlns.REGISTER); + return hasDiscoFeature(account.getServer(), Namespace.REGISTER); } public boolean sm() { @@ -1666,13 +1666,13 @@ public class XmppConnection implements Runnable { } public boolean mam() { - return hasDiscoFeature(account.getJid().toBareJid(), Xmlns.MAM) - || hasDiscoFeature(account.getJid().toBareJid(), Xmlns.MAM_LEGACY); + return hasDiscoFeature(account.getJid().toBareJid(), Namespace.MAM) + || hasDiscoFeature(account.getJid().toBareJid(), Namespace.MAM_LEGACY); } public boolean mamLegacy() { - return !hasDiscoFeature(account.getJid().toBareJid(), Xmlns.MAM) - && hasDiscoFeature(account.getJid().toBareJid(), Xmlns.MAM_LEGACY); + return !hasDiscoFeature(account.getJid().toBareJid(), Namespace.MAM) + && hasDiscoFeature(account.getJid().toBareJid(), Namespace.MAM_LEGACY); } public boolean push() { @@ -1692,10 +1692,10 @@ public class XmppConnection implements Runnable { if (Config.DISABLE_HTTP_UPLOAD) { return false; } else { - List<Entry<Jid, ServiceDiscoveryResult>> items = findDiscoItemsByFeature(Xmlns.HTTP_UPLOAD); + List<Entry<Jid, ServiceDiscoveryResult>> items = findDiscoItemsByFeature(Namespace.HTTP_UPLOAD); if (items.size() > 0) { try { - long maxsize = Long.parseLong(items.get(0).getValue().getExtendedDiscoInformation(Xmlns.HTTP_UPLOAD, "max-file-size")); + long maxsize = Long.parseLong(items.get(0).getValue().getExtendedDiscoInformation(Namespace.HTTP_UPLOAD, "max-file-size")); if (filesize <= maxsize) { return true; } else { @@ -1712,10 +1712,10 @@ public class XmppConnection implements Runnable { } public long getMaxHttpUploadSize() { - List<Entry<Jid, ServiceDiscoveryResult>> items = findDiscoItemsByFeature(Xmlns.HTTP_UPLOAD); + List<Entry<Jid, ServiceDiscoveryResult>> items = findDiscoItemsByFeature(Namespace.HTTP_UPLOAD); if (items.size() > 0) { try { - return Long.parseLong(items.get(0).getValue().getExtendedDiscoInformation(Xmlns.HTTP_UPLOAD, "max-file-size")); + return Long.parseLong(items.get(0).getValue().getExtendedDiscoInformation(Namespace.HTTP_UPLOAD, "max-file-size")); } catch (Exception e) { return -1; } @@ -1725,7 +1725,7 @@ public class XmppConnection implements Runnable { } public boolean stanzaIds() { - return hasDiscoFeature(account.getJid().toBareJid(), Xmlns.STANZA_IDS); + return hasDiscoFeature(account.getJid().toBareJid(), Namespace.STANZA_IDS); } } diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java index 7aab291a3..8c1cee0fd 100644 --- a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java +++ b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java @@ -15,7 +15,7 @@ import de.pixart.messenger.entities.Message; import de.pixart.messenger.entities.Transferable; import de.pixart.messenger.services.AbstractConnectionManager; import de.pixart.messenger.services.XmppConnectionService; -import de.pixart.messenger.utils.Xmlns; +import de.pixart.messenger.utils.Namespace; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xmpp.OnIqPacketReceived; import de.pixart.messenger.xmpp.jid.Jid; @@ -88,16 +88,16 @@ public class JingleConnectionManager extends AbstractConnectionManager { return; } if (!this.primaryCandidates.containsKey(account.getJid().toBareJid())) { - final Jid proxy = account.getXmppConnection().findDiscoItemByFeature(Xmlns.BYTE_STREAMS); + final Jid proxy = account.getXmppConnection().findDiscoItemByFeature(Namespace.BYTE_STREAMS); if (proxy != null) { IqPacket iq = new IqPacket(IqPacket.TYPE.GET); iq.setTo(proxy); - iq.query(Xmlns.BYTE_STREAMS); + iq.query(Namespace.BYTE_STREAMS); account.getXmppConnection().sendIqPacket(iq, new OnIqPacketReceived() { @Override public void onIqPacketReceived(Account account, IqPacket packet) { - Element streamhost = packet.query().findChild("streamhost", Xmlns.BYTE_STREAMS); + Element streamhost = packet.query().findChild("streamhost", Namespace.BYTE_STREAMS); final String host = streamhost == null ? null : streamhost.getAttribute("host"); final String port = streamhost == null ? null : streamhost.getAttribute("port"); if (host != null && port != null) { |