mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-23 11:07:57 +01:00
[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.
This commit is contained in:
parent
2a9671ca93
commit
e6a60213b6
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue