Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Jan 31, 2025
1 parent 166ff12 commit f2028d4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 2 additions & 4 deletions spec/unit/content-helpers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,11 @@ describe("Topic content helpers", () => {
it("creates an empty event when the topic is falsey", () => {
expect(makeTopicContent(undefined)).toEqual({
topic: undefined,
[M_TOPIC.name]: [
],
[M_TOPIC.name]: [],
});
expect(makeTopicContent(null)).toEqual({
topic: null,
[M_TOPIC.name]: [
],
[M_TOPIC.name]: [],
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/@types/state_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export interface RoomNameEventContent {
}

export interface RoomTopicEventContent {
topic: string;
topic: string | undefined | null;
}

export interface RoomAvatarEventContent {
Expand Down
4 changes: 3 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion src/content-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { Optional } from "matrix-events-sdk";

import { MBeaconEventContent, MBeaconInfoContent, MBeaconInfoEventContent } from "./@types/beacon.ts";
import { MsgType } from "./@types/event.ts";
import { M_TEXT, REFERENCE_RELATION } from "./@types/extensible_events.ts";
Expand All @@ -31,7 +33,6 @@ import {
} from "./@types/location.ts";
import { MRoomTopicEventContent, MTopicContent, M_TOPIC } from "./@types/topic.ts";
import { RoomMessageEventContent } from "./@types/events.ts";
import { Optional } from "matrix-events-sdk";

/**
* Generates the content for a HTML Message event
Expand Down

0 comments on commit f2028d4

Please sign in to comment.