From 75a91d0ab4a4285a38f59c07f3a5a3682021b38c Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Fri, 4 Mar 2022 14:51:19 +0000 Subject: [PATCH] Drop `gitlab notifications toggle` command (#226) * Drop gitlab notifications toggle * changelog --- changelog.d/226.bugfix | 1 + src/AdminRoom.ts | 31 ------------------------------- 2 files changed, 1 insertion(+), 31 deletions(-) create mode 100644 changelog.d/226.bugfix diff --git a/changelog.d/226.bugfix b/changelog.d/226.bugfix new file mode 100644 index 00000000..cd129d7c --- /dev/null +++ b/changelog.d/226.bugfix @@ -0,0 +1 @@ +Remove nonfunctional `gitlab notifications toggle` command. \ No newline at end of file diff --git a/src/AdminRoom.ts b/src/AdminRoom.ts index 6ccca0b4..561d7578 100644 --- a/src/AdminRoom.ts +++ b/src/AdminRoom.ts @@ -385,37 +385,6 @@ export class AdminRoom extends AdminRoomCommandHandler { return this.sendNotice("A token is stored for your GitLab account."); } - @botCommand("gitlab notifications toggle", {help: "Toggle enabling/disabling GitHub notifications in this room", optionalArgs: ["instanceName"], category: "gitlab"}) - public async setGitLabNotificationsStateToggle(instanceName: string) { - if (!this.config.gitlab) { - return this.sendNotice("The bridge is not configured with GitLab support"); - } - const instance = this.config.gitlab.instances[instanceName]; - if (!instance) { - return this.sendNotice("The bridge is not configured for this GitLab instance"); - } - const hasClient = await this.tokenStore.getGitLabForUser(this.userId, instance.url); - if (!hasClient) { - return this.sendNotice("You do not have a GitLab token configured for this instance"); - } - let newValue = false; - await this.saveAccountData((data) => { - const currentNotifs = (data.gitlab || {})[instanceName].notifications; - newValue = !currentNotifs.enabled; - return { - ...data, - gitlab: { - [instanceName]: { - notifications: { - enabled: newValue, - }, - } - }, - }; - }); - return this.sendNotice(`${newValue ? "En" : "Dis"}abled GitLab notifications for ${instanceName}`); - } - @botCommand("filters list", "List your saved filters") public async getFilters() { if (this.notifFilter.empty) {