@@ -49,6 +49,19 @@ export abstract class RoomBridge extends BaseBridge {
4949 }
5050 }
5151
52+ // TODO: check if we can use a list of user ids
53+ public async doMuteUser ( roomId : string , executorId : string , userId : string , appId : string ) : Promise < void > {
54+ if ( this . hasWritePermission ( appId ) ) {
55+ return this . doUnmuteUser ( roomId , executorId , userId , appId ) ;
56+ }
57+ }
58+
59+ public async doUnmuteUser ( roomId : string , executorId : string , userId : string , appId : string ) : Promise < void > {
60+ if ( this . hasWritePermission ( appId ) ) {
61+ return this . doMuteUser ( roomId , executorId , userId , appId ) ;
62+ }
63+ }
64+
5265 public async doUpdate ( room : IRoom , members : Array < string > , appId : string ) : Promise < void > {
5366 if ( this . hasWritePermission ( appId ) ) {
5467 return this . update ( room , members , appId ) ;
@@ -92,25 +105,41 @@ export abstract class RoomBridge extends BaseBridge {
92105 }
93106
94107 protected abstract create ( room : IRoom , members : Array < string > , appId : string ) : Promise < string > ;
108+
95109 protected abstract getById ( roomId : string , appId : string ) : Promise < IRoom > ;
110+
96111 protected abstract getByName ( roomName : string , appId : string ) : Promise < IRoom > ;
112+
97113 protected abstract getCreatorById ( roomId : string , appId : string ) : Promise < IUser | undefined > ;
114+
98115 protected abstract getCreatorByName ( roomName : string , appId : string ) : Promise < IUser | undefined > ;
116+
99117 protected abstract getDirectByUsernames ( usernames : Array < string > , appId : string ) : Promise < IRoom | undefined > ;
118+
100119 protected abstract getMembers ( roomId : string , appId : string ) : Promise < Array < IUser > > ;
120+
101121 protected abstract update ( room : IRoom , members : Array < string > , appId : string ) : Promise < void > ;
122+
102123 protected abstract createDiscussion (
103124 room : IRoom ,
104125 parentMessage : IMessage | undefined ,
105126 reply : string | undefined ,
106127 members : Array < string > ,
107128 appId : string ,
108129 ) : Promise < string > ;
130+
109131 protected abstract delete ( room : string , appId : string ) : Promise < void > ;
132+
110133 protected abstract getModerators ( roomId : string , appId : string ) : Promise < Array < IUser > > ;
134+
111135 protected abstract getOwners ( roomId : string , appId : string ) : Promise < Array < IUser > > ;
136+
112137 protected abstract getLeaders ( roomId : string , appId : string ) : Promise < Array < IUser > > ;
113138
139+ protected abstract muteUser ( roomId : string , executorId : string , userId : string , appId : string ) : Promise < void > ;
140+
141+ protected abstract unmuteUser ( roomId : string , executorId : string , userId : string , appId : string ) : Promise < void > ;
142+
114143 private hasWritePermission ( appId : string ) : boolean {
115144 if ( AppPermissionManager . hasPermission ( appId , AppPermissions . room . write ) ) {
116145 return true ;
0 commit comments