Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/definition/accessors/ILivechatRead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export interface ILivechatRead {
isOnlineAsync(departmentId?: string): Promise<boolean>;
getDepartmentsEnabledWithAgents(): Promise<Array<IDepartment>>;
getLivechatRooms(visitor: IVisitor, departmentId?: string): Promise<Array<ILivechatRoom>>;
getLivechatRoomsByAgentId(agentId: string): Promise<Array<ILivechatRoom>>;
getLivechatTotalRoomsByAgentId(agentId: string): Promise<number>;
getLivechatOpenRoomsByAgentId(agentId: string): Promise<Array<ILivechatRoom>>;
getLivechatTotalOpenRoomsByAgentId(agentId: string): Promise<number>;
/**
* @deprecated This method does not adhere to the conversion practices applied
* elsewhere in the Apps-Engine and will be removed in the next major version.
Expand Down
8 changes: 4 additions & 4 deletions src/server/accessors/LivechatRead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ export class LivechatRead implements ILivechatRead {
return this.livechatBridge.doFindRooms(visitor, departmentId, this.appId);
}

public getLivechatTotalRoomsByAgentId(agentId: string): Promise<number> {
return this.livechatBridge.doCountRoomsByAgentId(agentId, this.appId);
public getLivechatTotalOpenRoomsByAgentId(agentId: string): Promise<number> {
return this.livechatBridge.doCountOpenRoomsByAgentId(agentId, this.appId);
}

public getLivechatRoomsByAgentId(agentId: string): Promise<Array<ILivechatRoom>> {
return this.livechatBridge.doFindRoomsByAgentId(agentId, this.appId);
public getLivechatOpenRoomsByAgentId(agentId: string): Promise<Array<ILivechatRoom>> {
return this.livechatBridge.doFindOpenRoomsByAgentId(agentId, this.appId);
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/server/bridges/LivechatBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ export abstract class LivechatBridge extends BaseBridge {
}
}

public async doCountRoomsByAgentId(agentId: string, appId: string): Promise<number> {
public async doCountOpenRoomsByAgentId(agentId: string, appId: string): Promise<number> {
if (this.hasReadPermission(appId, 'livechat-room')) {
return this.countRoomsByAgentId(agentId, appId);
return this.countOpenRoomsByAgentId(agentId, appId);
}
}

public async doFindRoomsByAgentId(agentId: string, appId: string): Promise<Array<ILivechatRoom>> {
public async doFindOpenRoomsByAgentId(agentId: string, appId: string): Promise<Array<ILivechatRoom>> {
if (this.hasReadPermission(appId, 'livechat-room')) {
return this.findRoomsByAgentId(agentId, appId);
return this.findOpenRoomsByAgentId(agentId, appId);
}
}

Expand Down Expand Up @@ -183,9 +183,9 @@ export abstract class LivechatBridge extends BaseBridge {

protected abstract closeRoom(room: ILivechatRoom, comment: string, closer: IUser | undefined, appId: string): Promise<boolean>;

protected abstract countRoomsByAgentId(agentId: string, appId: string): Promise<number>;
protected abstract countOpenRoomsByAgentId(agentId: string, appId: string): Promise<number>;

protected abstract findRoomsByAgentId(agentId: string, appId: string): Promise<Array<ILivechatRoom>>;
protected abstract findOpenRoomsByAgentId(agentId: string, appId: string): Promise<Array<ILivechatRoom>>;

protected abstract findRooms(visitor: IVisitor, departmentId: string | null, appId: string): Promise<Array<ILivechatRoom>>;

Expand Down
4 changes: 2 additions & 2 deletions tests/test-data/bridges/livechatBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ export class TestLivechatBridge extends LivechatBridge {
throw new Error('Method not implemented');
}

public findRoomsByAgentId(agentId: string, appId: string): Promise<ILivechatRoom[]> {
public findOpenRoomsByAgentId(agentId: string, appId: string): Promise<ILivechatRoom[]> {
throw new Error('Method not implemented');
}

public countRoomsByAgentId(agentId: string, appId: string): Promise<number> {
public countOpenRoomsByAgentId(agentId: string, appId: string): Promise<number> {
throw new Error('Method not implemented');
}

Expand Down