mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
offer to rejoin archived room from menu
This commit is contained in:
parent
03be63572d
commit
c04a8140a3
@ -148,6 +148,14 @@ export class RoomViewModel extends ViewModel {
|
||||
this._room.forget();
|
||||
}
|
||||
|
||||
get canRejoin() {
|
||||
return this._room.isArchived;
|
||||
}
|
||||
|
||||
rejoinRoom() {
|
||||
this._room.join();
|
||||
}
|
||||
|
||||
async _sendMessage(message) {
|
||||
if (!this._room.isArchived && message) {
|
||||
try {
|
||||
|
@ -162,6 +162,12 @@ export class ArchivedRoom extends BaseRoom {
|
||||
this._forgetCallback(this.id);
|
||||
});
|
||||
}
|
||||
|
||||
join(log = null) {
|
||||
return this._platform.logger.wrapOrRun(log, "rejoin archived room", async log => {
|
||||
await this._hsApi.join(this.id, {log}).response();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function findKickDetails(roomResponse, ownUserId) {
|
||||
|
@ -73,6 +73,9 @@ export class RoomView extends TemplateView {
|
||||
if (vm.canForget) {
|
||||
options.push(Menu.option(vm.i18n`Forget room`, () => vm.forgetRoom()));
|
||||
}
|
||||
if (vm.canRejoin) {
|
||||
options.push(Menu.option(vm.i18n`Rejoin room`, () => vm.rejoinRoom()));
|
||||
}
|
||||
if (!options.length) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user