# Interface ChatroomStatusListener

聊天室状态监听

#### Version

1.0.0

interface ChatroomStatusListener {
onChatroomJoining(roomId: string): void;
onChatroomJoined(roomId: string, info: ChatroomJoinedInfo): any;
onChatroomJoinFailed(roomId: string, code: EngineError): any;
onChatroomQuited(roomId: string): any;
onChatroomDestroyed(roomId: string, type: ChatroomDestroyType): any;
}

- Defined in chatroom/listener/ChatroomStatusListener.ts:8

##### Index

### Methods

onChatroomJoining
onChatroomJoined
onChatroomJoinFailed
onChatroomQuited
onChatroomDestroyed

## Methods

### onChatroomJoining

- onChatroomJoining(roomId: string): void

  开始加入聊天室的回调

  #### Parameters

  - roomId: string

    聊天室 id

  #### Returns void

  - Defined in chatroom/listener/ChatroomStatusListener.ts:13

### onChatroomJoined

- onChatroomJoined(roomId: string, info: ChatroomJoinedInfo): any

  加入聊天室成功的回调

  #### Parameters

  - roomId: string

    聊天室 id

  - info: ChatroomJoinedInfo

    加入的聊天室信息

  #### Returns any

  - Defined in chatroom/listener/ChatroomStatusListener.ts:20

### onChatroomJoinFailed

- onChatroomJoinFailed(roomId: string, code: EngineError): any

  加入聊天室失败的回调

  #### Parameters

  - roomId: string

    聊天室 id

  - code: EngineError

    加入失败的错误码

  #### Returns any

  #### Discussion

  如果 code 是 ChatroomKicked 或 ChatroomNotExist，则不会自动重新加入聊天室，App 需要按照自己的逻辑处理

  - Defined in chatroom/listener/ChatroomStatusListener.ts:28

### onChatroomQuited

- onChatroomQuited(roomId: string): any

  退出聊天室成功的回调

  #### Parameters

  - roomId: string

    聊天室 id

  #### Returns any

  - Defined in chatroom/listener/ChatroomStatusListener.ts:34

### onChatroomDestroyed

- onChatroomDestroyed(roomId: string, type: ChatroomDestroyType): any

  聊天室被销毁的回调，用户在线的时候房间被销毁才会收到此回调

  #### Parameters

  - roomId: string

    聊天室 id

  - type: ChatroomDestroyType

    聊天室销毁原因

  #### Returns any

  - Defined in chatroom/listener/ChatroomStatusListener.ts:41