You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-16 09:42:23 +03:00
Handle empty m.room.topic (#4673)
* Define topic as optional. * Change isProvided so that types work better. * allow makeTopicContent and parseTopicContent to handle optional values for plain text * linting * Remove usage of optional * Topic key may only contain legacy key. * Add tests for other branches.
This commit is contained in:
@@ -4490,11 +4490,13 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
||||
}
|
||||
|
||||
/**
|
||||
* @param roomId - The room to update the topic in.
|
||||
* @param topic - The plaintext topic. May be empty to remove the topic.
|
||||
* @param htmlTopic - Optional.
|
||||
* @returns Promise which resolves: TODO
|
||||
* @returns Rejects: with an error response.
|
||||
*/
|
||||
public setRoomTopic(roomId: string, topic: string, htmlTopic?: string): Promise<ISendEventResponse> {
|
||||
public setRoomTopic(roomId: string, topic?: string, htmlTopic?: string): Promise<ISendEventResponse> {
|
||||
const content = ContentHelpers.makeTopicContent(topic, htmlTopic);
|
||||
return this.sendStateEvent(roomId, EventType.RoomTopic, content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user