Skip to content

Commit

Permalink
Fix SPECIAL_INTEREST_CREATION_TEMPLATE
Browse files Browse the repository at this point in the history
Issue unrelated to this PR, probably been broken for a while
  • Loading branch information
reivilibre committed Dec 3, 2024
1 parent 57ffd23 commit 1b41a6c
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions src/models/room_kinds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,28 @@ export const TALK_CREATION_TEMPLATE = (moderatorUserIds: string[]) => ({ // befo
invite: moderatorUserIds,
} satisfies RoomCreateOptions);

export const SPECIAL_INTEREST_CREATION_TEMPLATE = (moderatorUserIds: string[]) => ({
preset: 'public_chat',
visibility: 'public',
initial_state: [
{type: "m.room.guest_access", state_key: "", content: {guest_access: "can_join"}},
{type: "m.room.history_visibility", state_key: "", content: {history_visibility: "world_readable"}},
],
creation_content: {
[RSC_ROOM_KIND_FLAG]: RoomKind.SpecialInterest,
},
power_level_content_override: {
...PUBLIC_ROOM_POWER_LEVELS_TEMPLATE,
events: {
...PUBLIC_ROOM_POWER_LEVELS_TEMPLATE['events'],
"m.room.power_levels": 50,
export const SPECIAL_INTEREST_CREATION_TEMPLATE = (moderatorUserIds: string[]) => {
let template = PUBLIC_ROOM_POWER_LEVELS_TEMPLATE(moderatorUserIds);
return ({
preset: 'public_chat',
visibility: 'public',
initial_state: [
{type: "m.room.guest_access", state_key: "", content: {guest_access: "can_join"}},
{type: "m.room.history_visibility", state_key: "", content: {history_visibility: "world_readable"}},
],
creation_content: {
[RSC_ROOM_KIND_FLAG]: RoomKind.SpecialInterest,
},
},
invite: moderatorUserIds,
} satisfies RoomCreateOptions);
power_level_content_override: {
...template,
events: {
...template.events,
"m.room.power_levels": 50,
},
},
invite: moderatorUserIds,
} satisfies RoomCreateOptions);
};

export function mergeWithCreationTemplate(template: RoomCreateOptions, addlProps: any): any {
const result = {...template};
Expand Down

0 comments on commit 1b41a6c

Please sign in to comment.