diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-07-22 18:22:21 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-07-22 18:22:21 +0200 |
commit | 3d372cb3394ce934cce2881f2bf428b302925431 (patch) | |
tree | f1a9fe1cf1f0de7204efc275361ee649308bc8d8 /src/main/java/eu/siacs/conversations | |
parent | 6dcce765687774031b39455781afcc4f84b751a4 (diff) |
feed version response from app name instead of static variable
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java | 4 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/generator/IqGenerator.java | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java index c3be07bb..7964a38a 100644 --- a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java @@ -13,6 +13,7 @@ import java.util.Locale; import java.util.TimeZone; import eu.siacs.conversations.Config; +import eu.siacs.conversations.R; import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.utils.PhoneHelper; @@ -49,7 +50,6 @@ public abstract class AbstractGenerator { "urn:xmpp:otr:0" }; private String mVersion = null; - protected final String IDENTITY_NAME = "Conversations"; protected final String IDENTITY_TYPE = "phone"; private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US); @@ -68,7 +68,7 @@ public abstract class AbstractGenerator { } public String getIdentityName() { - return IDENTITY_NAME + " " + getIdentityVersion(); + return mXmppConnectionService.getString(R.string.app_name) + " " + getIdentityVersion(); } public String getCapHash() { diff --git a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java index ca476349..bd4f4131 100644 --- a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java @@ -18,6 +18,7 @@ import java.util.Set; import java.util.TimeZone; import eu.siacs.conversations.Config; +import eu.siacs.conversations.R; import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Conversation; @@ -57,7 +58,7 @@ public class IqGenerator extends AbstractGenerator { public IqPacket versionResponse(final IqPacket request) { final IqPacket packet = request.generateResponse(IqPacket.TYPE.RESULT); Element query = packet.query("jabber:iq:version"); - query.addChild("name").setContent(IDENTITY_NAME); + query.addChild("name").setContent(mXmppConnectionService.getString(R.string.app_name)); query.addChild("version").setContent(getIdentityVersion()); return packet; } |