diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java index 7e2ff213..f50ec1b4 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 de.thedevstack.conversationsplus.ConversationsPlusApplication; +import de.thedevstack.conversationsplus.ConversationsPlusPreferences; import de.tzur.conversations.Settings; import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.services.XmppConnectionService; @@ -43,29 +44,10 @@ public abstract class AbstractGenerator { private final String[] MESSAGE_CORRECTION_FEATURES = { "urn:xmpp:message-correct: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'Z'", Locale.US); - protected XmppConnectionService mXmppConnectionService; - - protected AbstractGenerator(XmppConnectionService service) { - this.mXmppConnectionService = service; - } - - protected String getIdentityVersion() { - if (mVersion == null) { - this.mVersion = PhoneHelper.getVersionName(mXmppConnectionService); - } - return this.mVersion; - } - - public String getIdentityName() { - return IDENTITY_NAME + " " + getIdentityVersion(); - } - public String getCapHash() { StringBuilder s = new StringBuilder(); s.append("client/" + IDENTITY_TYPE + "//" + ConversationsPlusApplication.getNameAndVersion() + "<"); @@ -94,7 +76,7 @@ public abstract class AbstractGenerator { if (Settings.CONFIRM_MESSAGE_RECEIVED) { features.addAll(Arrays.asList(MESSAGE_CONFIRMATION_FEATURES)); } - if (mXmppConnectionService.allowMessageCorrection()) { + if (ConversationsPlusPreferences.allowMessageCorrection()) { features.addAll(Arrays.asList(MESSAGE_CORRECTION_FEATURES)); } Collections.sort(features); |