prose-im / prose-app-web

Prose Web application. XMPP client for team messaging.
https://prose.org/downloads
Mozilla Public License 2.0
23 stars 2 forks source link

Support RoomState in sidebar #29

Closed nesium closed 8 months ago

nesium commented 8 months ago

As discussed on Slack, Room now has a state property…

export enum RoomStateType {
  Connecting = 0,
  Connected = 1,
  Disconnected = 2,
}

export interface RoomState {
    readonly type: RoomStateType
}

export interface RoomStateConnecting extends RoomState {
    type: RoomStateType.Connecting
}

export interface RoomStateConnected extends RoomState {
    type: RoomStateType.Connected
}

export interface RoomStateDisconnected extends RoomState {
    type: RoomStateType.Disconnected
    readonly error?: string;
    readonly canRetry?: boolean;
}

export interface RoomBase {
    readonly type: RoomType;
    readonly state: RoomState;
    readonly id: RoomID;
    readonly name: string;
    readonly participants: ParticipantInfo[];
    // …
}

Introduced in prose-im/prose-core-client@3146d4dd75acf97d917c9a08eb21973af8354983