diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-07-22 18:22:21 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-07-25 19:47:54 +0200 |
commit | c474c17081ec036234c3c8a7c68e6432a05b2d4d (patch) | |
tree | bee2cd3012ca424d07b96ad07375a06996c5ab33 /src/main/java/eu/siacs/conversations | |
parent | e6c1e53cdac19788fc107019b772b678fd88f6d1 (diff) |
feed version response from app name instead of static variable
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r-- | src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java | 5 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/generator/IqGenerator.java | 3 |
2 files changed, 5 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 f071db3c0..eb90ac7b1 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; @@ -51,7 +52,7 @@ public abstract class AbstractGenerator { private String mVersion = null; private String mVersionOs = null; - protected final String IDENTITY_NAME = "Pix-Art Messenger"; + 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); @@ -78,7 +79,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 6b7c3a02f..3aff63a3a 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()); query.addChild("os").setContent(getIdentityVersionOs()); return packet; |