-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: capability of muting or unmuting a user in a room
- Loading branch information
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { IRoom } from '../rooms'; | ||
import { IUser } from '../users'; | ||
|
||
export interface IRoomUpdater { | ||
muteUser(room: IRoom, executorId: IUser, user: IUser): Promise<void>; | ||
|
||
unmuteUser(room: IRoom, executorId: IUser, user: IUser): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { IRoomUpdater } from '../../definition/accessors/IRoomUpdater'; | ||
import { IRoom } from '../../definition/rooms'; | ||
import { IUser } from '../../definition/users'; | ||
import { AppBridges } from '../bridges'; | ||
|
||
export class RoomUpdater implements IRoomUpdater { | ||
constructor(private readonly bridges: AppBridges, private readonly appId: string) { | ||
} | ||
|
||
public async muteUser(room: IRoom, executor: IUser, user: IUser) { | ||
return this.bridges.getRoomBridge().doMuteUser(room.id, executor.id, user.id, this.appId); | ||
} | ||
|
||
public async unmuteUser(room: IRoom, executor: IUser, user: IUser) { | ||
return this.bridges.getRoomBridge().doUnmuteUser(room.id, executor.id, user.id, this.appId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters