add jingle message init namespace to features

This commit is contained in:
Daniel Gultsch 2020-04-21 14:59:03 +02:00
parent 5b12e23382
commit 442b952700

View file

@ -23,6 +23,7 @@ import eu.siacs.conversations.xmpp.XmppConnection;
import eu.siacs.conversations.xmpp.jingle.stanzas.FileTransferDescription; import eu.siacs.conversations.xmpp.jingle.stanzas.FileTransferDescription;
public abstract class AbstractGenerator { public abstract class AbstractGenerator {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
private final String[] FEATURES = { private final String[] FEATURES = {
Namespace.JINGLE, Namespace.JINGLE,
@ -55,24 +56,26 @@ public abstract class AbstractGenerator {
private final String[] PRIVACY_SENSITIVE = { private final String[] PRIVACY_SENSITIVE = {
"urn:xmpp:time" //XEP-0202: Entity Time leaks time zone "urn:xmpp:time" //XEP-0202: Entity Time leaks time zone
}; };
private final String[] VOIP_NAMESPACES = { private final String[] VOIP_NAMESPACES = {
Namespace.JINGLE_TRANSPORT_ICE_UDP, Namespace.JINGLE_TRANSPORT_ICE_UDP,
Namespace.JINGLE_FEATURE_AUDIO, Namespace.JINGLE_FEATURE_AUDIO,
Namespace.JINGLE_FEATURE_VIDEO, Namespace.JINGLE_FEATURE_VIDEO,
Namespace.JINGLE_APPS_RTP, Namespace.JINGLE_APPS_RTP,
Namespace.JINGLE_APPS_DTLS, Namespace.JINGLE_APPS_DTLS,
Namespace.JINGLE_MESSAGE
}; };
private String mVersion = null;
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
protected XmppConnectionService mXmppConnectionService; protected XmppConnectionService mXmppConnectionService;
private String mVersion = null;
AbstractGenerator(XmppConnectionService service) { AbstractGenerator(XmppConnectionService service) {
this.mXmppConnectionService = service; this.mXmppConnectionService = service;
} }
public static String getTimestamp(long time) {
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
return DATE_FORMAT.format(time);
}
String getIdentityVersion() { String getIdentityVersion() {
if (mVersion == null) { if (mVersion == null) {
this.mVersion = PhoneHelper.getVersionName(mXmppConnectionService); this.mVersion = PhoneHelper.getVersionName(mXmppConnectionService);
@ -113,11 +116,6 @@ public abstract class AbstractGenerator {
return Base64.encodeToString(sha1, Base64.NO_WRAP); return Base64.encodeToString(sha1, Base64.NO_WRAP);
} }
public static String getTimestamp(long time) {
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
return DATE_FORMAT.format(time);
}
public List<String> getFeatures(Account account) { public List<String> getFeatures(Account account) {
final XmppConnection connection = account.getXmppConnection(); final XmppConnection connection = account.getXmppConnection();
final ArrayList<String> features = new ArrayList<>(Arrays.asList(FEATURES)); final ArrayList<String> features = new ArrayList<>(Arrays.asList(FEATURES));