Skip to content

Commit

Permalink
correct order
Browse files Browse the repository at this point in the history
  • Loading branch information
Dnouv committed Sep 26, 2024
1 parent d5aa91c commit 97b9cc9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/definition/accessors/IRoomRead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export interface IRoomRead {

/**
* Gets the user's unread messages count in a room.
* @param uid user's id
* @param roomId room's id
* @param uid user's id
*/
getUserUnreadMessageCount(uid: string, roomId: string): Promise<number | undefined>;
getUserUnreadMessageCount(roomId: string, uid: string): Promise<number | undefined>;
}
4 changes: 2 additions & 2 deletions src/server/accessors/RoomRead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export class RoomRead implements IRoomRead {
return this.roomBridge.doGetUnreadByUser(roomId, uid, completeOptions, this.appId);
}

public getUserUnreadMessageCount(uid: string, rid: string): Promise<number> {
return this.roomBridge.doGetUserUnreadMessageCount(uid, rid, this.appId);
public getUserUnreadMessageCount(roomId: string, uid: string): Promise<number> {
return this.roomBridge.doGetUserUnreadMessageCount(roomId, uid, this.appId);
}

// If there are any invalid fields or values, throw
Expand Down
6 changes: 3 additions & 3 deletions src/server/bridges/RoomBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ export abstract class RoomBridge extends BaseBridge {
}
}

public async doGetUserUnreadMessageCount(uid: string, roomId: string, appId: string): Promise<number> {
public async doGetUserUnreadMessageCount(roomId: string, uid: string, appId: string): Promise<number> {
if (this.hasReadPermission(appId)) {
return this.getUserUnreadMessageCount(uid, roomId, appId);
return this.getUserUnreadMessageCount(roomId, uid, appId);
}
}

Expand Down Expand Up @@ -161,7 +161,7 @@ export abstract class RoomBridge extends BaseBridge {

protected abstract getUnreadByUser(roomId: string, uid: string, options: GetMessagesOptions, appId: string): Promise<IMessageRaw[]>;

protected abstract getUserUnreadMessageCount(uid: string, roomId: string, appId: string): Promise<number>;
protected abstract getUserUnreadMessageCount(roomId: string, uid: string, appId: string): Promise<number>;

private hasWritePermission(appId: string): boolean {
if (AppPermissionManager.hasPermission(appId, AppPermissions.room.write)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test-data/bridges/roomBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class TestsRoomBridge extends RoomBridge {
throw new Error('Method not implemented.');
}

protected getUserUnreadMessageCount(uid: string, roomId: string, appId: string): Promise<number> {
protected getUserUnreadMessageCount(roomId: string, uid: string, appId: string): Promise<number> {
throw new Error('Method not implemented.');
}
}

0 comments on commit 97b9cc9

Please sign in to comment.