11import type { ITypingOptions } from '../../definition/accessors/INotifier' ;
2- import type { IMessage } from '../../definition/messages' ;
2+ import type { IMessage , Reaction } from '../../definition/messages' ;
33import type { IRoom } from '../../definition/rooms' ;
44import type { IUser } from '../../definition/users' ;
55import { PermissionDeniedError } from '../errors/PermissionDeniedError' ;
@@ -54,6 +54,18 @@ export abstract class MessageBridge extends BaseBridge {
5454 }
5555 }
5656
57+ public async doAddReaction ( messageId : string , userId : string , reaction : Reaction , appId : string ) : Promise < void > {
58+ if ( this . hasWritePermission ( appId ) ) {
59+ return this . addReaction ( messageId , userId , reaction ) ;
60+ }
61+ }
62+
63+ public async doRemoveReaction ( messageId : string , userId : string , reaction : Reaction , appId : string ) : Promise < void > {
64+ if ( this . hasWritePermission ( appId ) ) {
65+ return this . removeReaction ( messageId , userId , reaction ) ;
66+ }
67+ }
68+
5769 protected abstract create ( message : IMessage , appId : string ) : Promise < string > ;
5870
5971 protected abstract update ( message : IMessage , appId : string ) : Promise < void > ;
@@ -68,6 +80,10 @@ export abstract class MessageBridge extends BaseBridge {
6880
6981 protected abstract delete ( message : IMessage , user : IUser , appId : string ) : Promise < void > ;
7082
83+ protected abstract addReaction ( messageId : string , userId : string , reaction : Reaction ) : Promise < void > ;
84+
85+ protected abstract removeReaction ( messageId : string , userId : string , reaction : Reaction ) : Promise < void > ;
86+
7187 private hasReadPermission ( appId : string ) : boolean {
7288 if ( AppPermissionManager . hasPermission ( appId , AppPermissions . message . read ) ) {
7389 return true ;
0 commit comments