Skip to content

Commit

Permalink
Support extended room names (#210)
Browse files Browse the repository at this point in the history
* support extended room names

* cleanup

* Update src/commands/VerifyCommand.ts

Co-authored-by: reivilibre <[email protected]>

---------

Co-authored-by: reivilibre <[email protected]>
  • Loading branch information
H-Shay and reivilibre authored Jan 24, 2024
1 parent ee80e11 commit 3deb801
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/commands/HelpCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ export class HelpCommand implements ICommand {
"</code></pre>" +
"<h4>People management:</h4>" +
"<pre><code>" +
"!conference verify &lt;aud&gt; - Dumps information about who would be invited to which rooms when\n" +
" the invite command is run for the auditorium.\n" +
"!conference invite [aud] - Issues invites to all the people to their relevant rooms. If an [aud] is\n" +
" supplied, only that auditorium will receive invites.\n" +
"!conference permissions - Updates moderator status for everyone that is supposed to have it.\n" +
"!conference attendance - Checks the status of invites across the conference.\n" +
"!conference verify &lt;aud&gt; [backstage] - Dumps information about who would be invited to which rooms when\n" +
" the invite command is run for the auditorium.\n" +
"!conference invite [aud] - Issues invites to all the people to their relevant rooms. If an [aud] is\n" +
" supplied, only that auditorium will receive invites.\n" +
"!conference permissions - Updates moderator status for everyone that is supposed to have it.\n" +
"!conference attendance - Checks the status of invites across the conference.\n" +
"</code></pre>" +
"<h4>Bridge management:</h4>" +
"<pre><code>" +
Expand Down
2 changes: 1 addition & 1 deletion src/commands/RunCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class RunCommand implements ICommand {
constructor(private readonly client: MatrixClient, private readonly conference: Conference, private readonly scheduler: Scheduler) {}

public async run(roomId: string, event: any, args: string[]) {
const audId = args[0];
const audId = args.join(" ");
if (audId === "all") {
await this.scheduler.addAuditorium("all");
} else {
Expand Down
12 changes: 10 additions & 2 deletions src/commands/VerifyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,18 @@ export class VerifyCommand implements ICommand {
constructor(private readonly client: MatrixClient, private readonly conference: Conference) {}

public async run(roomId: string, event: any, args: string[]) {
const audId = args[0];
let audId;
let backstage = args[args.length - 1] === "backstage";
if (backstage) {
const aud_slice = args.slice(0, -1)
audId = aud_slice.join(" ")
}
else {
audId = args.join(" ");
}

let aud: PhysicalRoom = this.conference.getAuditorium(audId);
if (args.includes("backstage")) {
if (backstage) {
aud = this.conference.getAuditoriumBackstage(audId);
}

Expand Down
5 changes: 3 additions & 2 deletions src/commands/actions/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ export async function runRoleCommand(action: IAction, conference: Conference, cl
const skipTalks = args.includes("notalks");

if (args[0] && args[0] !== "backstage") {
const aud = backstageOnly ? conference.getAuditoriumBackstage(args[0]) : conference.getAuditorium(args[0]);
const audId = args.join(" ")
const aud = backstageOnly ? conference.getAuditoriumBackstage(audId) : conference.getAuditorium(audId);
if (!aud) {
const spiRoom = conference.getInterestRoom(args[0]);
const spiRoom = conference.getInterestRoom(audId);
if (!spiRoom) return client.replyNotice(roomId, event, "Unknown auditorium/interest room");
await doInterestResolveAction(action, client, spiRoom, conference, isInvite);
} else {
Expand Down

0 comments on commit 3deb801

Please sign in to comment.