extend createRoom for creating rooms in a space
This commit is contained in:
parent
c10512fd56
commit
1a7a0e619d
3 changed files with 42 additions and 2 deletions
|
@ -14,9 +14,11 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import {MatrixClientPeg} from "../../MatrixClientPeg";
|
||||
import isIp from "is-ip";
|
||||
import * as utils from 'matrix-js-sdk/src/utils';
|
||||
import * as utils from "matrix-js-sdk/src/utils";
|
||||
import {Room} from "matrix-js-sdk/src/models/room";
|
||||
|
||||
import {MatrixClientPeg} from "../../MatrixClientPeg";
|
||||
import SpecPermalinkConstructor, {baseUrl as matrixtoBaseUrl} from "./SpecPermalinkConstructor";
|
||||
import PermalinkConstructor, {PermalinkParts} from "./PermalinkConstructor";
|
||||
import ElementPermalinkConstructor from "./ElementPermalinkConstructor";
|
||||
|
@ -121,6 +123,10 @@ export class RoomPermalinkCreator {
|
|||
this._started = false;
|
||||
}
|
||||
|
||||
get serverCandidates() {
|
||||
return this._serverCandidates;
|
||||
}
|
||||
|
||||
isStarted() {
|
||||
return this._started;
|
||||
}
|
||||
|
@ -451,3 +457,9 @@ function isHostnameIpAddress(hostname) {
|
|||
|
||||
return isIp(hostname);
|
||||
}
|
||||
|
||||
export const calculateRoomVia = (room: Room) => {
|
||||
const permalinkCreator = new RoomPermalinkCreator(room);
|
||||
permalinkCreator.load();
|
||||
return permalinkCreator.serverCandidates;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue