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
6 changes: 5 additions & 1 deletion src/definition/accessors/ILivechatRead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { ILivechatRoom } from '../livechat/ILivechatRoom';
import { IVisitor } from '../livechat/IVisitor';

export interface ILivechatRead {
isOnline(): boolean;
/**
* Gets online status of the livechat.
* @param departmentId (optional) the id of the livechat department
*/
isOnline(departmentId?: string): boolean;
getLivechatRooms(visitor: IVisitor, departmentId?: string): Promise<Array<ILivechatRoom>>;
/**
* @deprecated This method does not adhere to the conversion practices applied
Expand Down
4 changes: 2 additions & 2 deletions src/server/accessors/LivechatRead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { ILivechatBridge } from '../bridges/ILivechatBridge';
export class LivechatRead implements ILivechatRead {
constructor(private readonly livechatBridge: ILivechatBridge, private readonly appId: string) { }

public isOnline(): boolean {
return this.livechatBridge.isOnline();
public isOnline(departmentId?: string): boolean {
return this.livechatBridge.isOnline(departmentId);
}

public getLivechatRooms(visitor: IVisitor, departmentId?: string): Promise<Array<ILivechatRoom>> {
Expand Down
2 changes: 1 addition & 1 deletion src/server/bridges/ILivechatBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IDepartment, ILivechatMessage, ILivechatRoom, ILivechatTransferData, IV
import { IUser } from '../../definition/users';

export interface ILivechatBridge {
isOnline(): boolean;
isOnline(departmentId?: string): boolean;
createMessage(message: ILivechatMessage, appId: string): Promise<string>;
getMessageById(messageId: string, appId: string): Promise<ILivechatMessage>;
updateMessage(message: ILivechatMessage, appId: string): Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion tests/test-data/bridges/livechatBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IUser } from '../../../src/definition/users';
import { ILivechatBridge } from '../../../src/server/bridges/ILivechatBridge';

export class TestLivechatBridge implements ILivechatBridge {
public isOnline(): boolean {
public isOnline(departmentId?: string): boolean {
throw new Error('Method not implemented');
}
public createMessage(message: ILivechatMessage, appId: string): Promise<string> {
Expand Down