From e6a60213b6e2e86ea9dfacbb61e97e76508668ac Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 26 Aug 2020 11:36:55 +0200 Subject: [PATCH] [core] Add convenience constructor to AbstractStreamOpen Most of the times when we construct a stream-open-like element, we want the jabber:client namespace. Hence add a constructor that does select the namespace implicitly. --- .../org/jivesoftware/smack/packet/AbstractStreamOpen.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractStreamOpen.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractStreamOpen.java index 36f0dc760..1b6a3d1e0 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractStreamOpen.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractStreamOpen.java @@ -1,6 +1,6 @@ /** * - * Copyright 2020 Aditya Borikar + * Copyright 2020 Florian Schmaus, Aditya Borikar * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,6 +60,10 @@ public abstract class AbstractStreamOpen implements Nonza { */ protected final String contentNamespace; + public AbstractStreamOpen(CharSequence to, CharSequence from, String id, String lang) { + this(to, from, id, lang, StreamContentNamespace.client); + } + public AbstractStreamOpen(CharSequence to, CharSequence from, String id, String lang, StreamContentNamespace ns) { this.to = StringUtils.maybeToString(to); this.from = StringUtils.maybeToString(from);