diff --git a/.cspell-allowed-words b/.cspell-allowed-words new file mode 100644 index 00000000..58d9d259 --- /dev/null +++ b/.cspell-allowed-words @@ -0,0 +1,111 @@ +aminda +anymore +appservice +appservices +autojoin +backingstore +baldr +banlist +cirillo +conduwuit +csam +datadirectory +deanonymisation +deanonymise +deduplicator +displayname +dockerised +dogfooded +draupnir +draupnirfactory +draupnir's +draupnirs +errcode +eventcontext +filepermissions +foobar +gnuxie +healthz +homeserver +homeservers +honor +honoring +ingword +introspected +joinable +joinwave +journalctl +langua +legacymentions +localpart +loggable +makeconfirmation +managementroom +marewolf +mjolnir +mjolnirs +moderationroom +msgtype +mxid +mxids +mytable +myurl +ncii +neko +nnedword +nodesource +nord +nsfw +oneliner +pantalaimon +powerlevel +precalculated +preemptively +preminor +protectrooms +psql +qmarks +ralston +redacter +resultify +roomid +rustup +safemode +savepoints +schemav +sdkmps +seibel's +sextortion +shadowban +shadowbanned +spammy +spamtesting +stringfrom +sublicensable +sweepy +syncloop +takedown +takendown +tatsuo +tojoin +trusteduser +tsnode +tsplugin +typebox +uisi +unbannable +unbanner +unixepoch +unprotecting +unredacted +unrestrict +unrestriction +unstarted +unsuspension +useraccount +vars +webapi +webapis +webproxy +writeback +yeha diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 00000000..57bc18ea --- /dev/null +++ b/.cspell.json @@ -0,0 +1,17 @@ +{ + + "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json", + "version": "0.2", + "language": "en_GB", + "words": ["add", "to", ".cspell-allowed-words", "instead"], + "flagWords": ["flaggedword", "hte"], + "dictionaries": ["cspell-allowed-words"], + + "dictionaryDefinitions": [ + { + "name": "cspell-allowed-words", + "path": "./.cspell-allowed-words", + "addWords": true + } + ] +} diff --git a/README.md b/README.md index 2fa08b96..c632bafc 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ for installation instructions and usage guides. specific moderation tasks by shadowing the actions taken by your Matrix Client. -- Draupnir synchonises bans for users, and servers across all of the matrix +- Draupnir synchronises bans for users, and servers across all of the matrix rooms that you moderate - Draupnir can protect your community by applying policies from community @@ -116,7 +116,7 @@ Mjolnir**. the rewrite of the core of Draupnir into the [matrix-protection-suite](https://github.com/Gnuxie/matrix-protection-suite), providing all the Matrix client code required to operate a protection - platform. The matrix-protection-suite also covers severall shortfalls in the + platform. The matrix-protection-suite also covers several shortfalls in the available SDK's, providing event parsing and types that keep code secure and sound. The [interface-manager](https://github.com/the-draupnir-project/interface-manager) diff --git a/eslint.config.mjs b/eslint.config.mjs index e5cf583b..e38bd5b4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -6,11 +6,11 @@ import eslint from "@eslint/js"; import tseslint from "typescript-eslint"; import tsplugin from "@typescript-eslint/eslint-plugin"; -// this configuration file stilli includes random shite from these directories -// and I do not understand why. It is one of the most frustraiting things +// this configuration file still includes random shite from these directories +// and I do not understand why. It is one of the most frustrating things // my guess is that there is some hidden ambient config that is included // full of eslint defaults that we can't intercept?? -// I don't know, but it's one of the most frustraiting things ever. +// I don't know, but it's one of the most frustrating things ever. const ignores = [ "**/docs/**", "**/.husky/**", @@ -44,7 +44,7 @@ const rulesFromMPS = { }; export default tseslint.config({ - // This is a typescript-eslint configurartion for typescript files. + // This is a typescript-eslint configuration for typescript files. // This will not work against js files. files: ["src/**/*.ts", "src/**/*.tsx", "test/**/*.ts", "test/**/*.tsx"], extends: [eslint.configs.recommended, ...tseslint.configs.strictTypeChecked], diff --git a/src/Draupnir.ts b/src/Draupnir.ts index bbbec8ba..ccaa5b49 100644 --- a/src/Draupnir.ts +++ b/src/Draupnir.ts @@ -43,7 +43,7 @@ import { IConfig } from "./config"; import { LogLevel } from "matrix-bot-sdk"; import { ARGUMENT_PROMPT_LISTENER, - DEFAUILT_ARGUMENT_PROMPT_LISTENER, + DEFAULT_ARGUMENT_PROMPT_LISTENER, makeListenerForArgumentPrompt as makeListenerForArgumentPrompt, makeListenerForPromptDefault, } from "./commands/interface-manager/MatrixPromptForAccept"; @@ -95,7 +95,7 @@ const log = new Logger("Draupnir"); export class Draupnir implements Client, MatrixAdaptorContext { /** * This is for users who are not listed on a watchlist, - * but have been flagged by the automatic spam detection as suispicous + * but have been flagged by the automatic spam detection as suspicious */ public unlistedUserRedactionQueue = new UnlistedUserRedactionQueue(); @@ -188,7 +188,7 @@ export class Draupnir implements Client, MatrixAdaptorContext { ) ); this.reactionHandler.on( - DEFAUILT_ARGUMENT_PROMPT_LISTENER, + DEFAULT_ARGUMENT_PROMPT_LISTENER, makeListenerForPromptDefault( this.commandRoomID, this.commandDispatcher, diff --git a/src/DraupnirBotMode.ts b/src/DraupnirBotMode.ts index 6c40f4e7..47a3bff8 100644 --- a/src/DraupnirBotMode.ts +++ b/src/DraupnirBotMode.ts @@ -65,9 +65,9 @@ export function constructWebAPIs(draupnir: Draupnir): WebAPIs { * This includes the webAPIS that accompany Draupnir in bot mode. * * The appservice also implements `SafeModeToggle` but has different requirements. - * This interface is exlusively used by the entrypoints to draupnir's bot mode. + * This interface is exclusively used by the entrypoints to draupnir's bot mode. */ -interface BotModeTogle extends SafeModeToggle { +interface BotModeToggle extends SafeModeToggle { encryptionInitialized(): Promise; stopEverything(): void; startFromScratch( @@ -79,7 +79,7 @@ interface BotModeTogle extends SafeModeToggle { ): Promise>; } -export class DraupnirBotModeToggle implements BotModeTogle { +export class DraupnirBotModeToggle implements BotModeToggle { private draupnir: Draupnir | null = null; private safeModeDraupnir: SafeModeDraupnir | null = null; private webAPIs: WebAPIs | null = null; @@ -131,7 +131,7 @@ export class DraupnirBotModeToggle implements BotModeTogle { clientsInRoomMap, DefaultEventDecoder ); - // needed to have accurate join infomration. + // needed to have accurate join information. ( await clientsInRoomMap.makeClientRooms(clientUserID, async () => joinedRoomsSafe(client) diff --git a/src/appservice/AppService.ts b/src/appservice/AppService.ts index daeaa48d..2d917588 100644 --- a/src/appservice/AppService.ts +++ b/src/appservice/AppService.ts @@ -60,7 +60,7 @@ export class MjolnirAppService { public readonly commands: AppserviceCommandHandler; /** - * The constructor is private because we want to ensure intialization steps are followed, + * The constructor is private because we want to ensure initialization steps are followed, * use `makeMjolnirAppService`. */ private constructor( @@ -91,7 +91,7 @@ export class MjolnirAppService { /** * Make and initialize the app service from the config, ready to be started. * @param config The appservice's config, not draupnirs's, see `src/appservice/config`. - * @param dataStore A datastore to persist infomration about the draupnir to. + * @param dataStore A datastore to persist information about the draupnir to. * @param registrationFilePath A file path to the registration file to read the namespace and tokens from. * @returns A new `MjolnirAppService`. */ @@ -249,7 +249,7 @@ export class MjolnirAppService { } public onUserQuery(_queriedUser: MatrixUser) { - return {}; // auto-provision users with no additonal data + return {}; // auto-provision users with no additional data } // Provision a new draupnir for the invitee when the appservice bot (designated by this.bridge.botUserId) is invited to a room. @@ -289,7 +289,7 @@ export class MjolnirAppService { .getClient() .sendText( mxEvent.room_id, - "Please accept the inviations to the newly provisioned rooms. These will be the home of your Draupnir Instance. This room will not be used in the future." + "Please accept the invitations to the newly provisioned rooms. These will be the home of your Draupnir Instance. This room will not be used in the future." ); } catch (e: unknown) { log.error( @@ -307,7 +307,7 @@ export class MjolnirAppService { ); } try { - // reject the invite to keep the room clean and make sure the invetee doesn't get confused and think this is their draupnir. + // reject the invite to keep the room clean and make sure the invitee doesn't get confused and think this is their draupnir. await this.bridge.getBot().getClient().leaveRoom(mxEvent.room_id); } catch (e: unknown) { log.warn("Unable to reject an invite to a room", e); diff --git a/src/appservice/AppServiceDraupnirManager.ts b/src/appservice/AppServiceDraupnirManager.ts index ad13d892..ae1f781f 100644 --- a/src/appservice/AppServiceDraupnirManager.ts +++ b/src/appservice/AppServiceDraupnirManager.ts @@ -212,7 +212,7 @@ export class AppServiceDraupnirManager { }, }); if (!isStringRoomID(managementRoomID)) { - throw new TypeError(`${managementRoomID} malformed managmentRoomID`); + throw new TypeError(`${managementRoomID} malformed managementRoomID`); } const draupnir = await this.makeInstance( mjolnirLocalPart, @@ -256,7 +256,7 @@ export class AppServiceDraupnirManager { } /** - * Utility that creates a matrix client for a virtual user on our homeserver with the specified loclapart. + * Utility that creates a matrix client for a virtual user on our homeserver with the specified localpart. * @param localPart The localpart of the virtual user we need a client for. * @returns A bridge intent with the complete mxid of the virtual user and a MatrixClient. */ diff --git a/src/appservice/bot/AppserviceBotCommandDispatcher.ts b/src/appservice/bot/AppserviceBotCommandDispatcher.ts index 211afaa4..c6ff8507 100644 --- a/src/appservice/bot/AppserviceBotCommandDispatcher.ts +++ b/src/appservice/bot/AppserviceBotCommandDispatcher.ts @@ -37,7 +37,7 @@ function makeAppserviceCommandNormaliser( isAllowedOnlySymbolPrefixes: false, additionalPrefixes: ["admin"], getDisplayName: function (): string { - // TODO: I don't nkow how we're going to do this yet but we'll + // TODO: I don't know how we're going to do this yet but we'll // figure it out one day. return "admin"; }, diff --git a/src/appservice/bot/AppserviceCommandHandler.ts b/src/appservice/bot/AppserviceCommandHandler.ts index ab975bd6..f8092bf4 100644 --- a/src/appservice/bot/AppserviceCommandHandler.ts +++ b/src/appservice/bot/AppserviceCommandHandler.ts @@ -32,7 +32,7 @@ import { MatrixEventContext } from "../../commands/interface-manager/MPSMatrixIn import { MatrixReactionHandler } from "../../commands/interface-manager/MatrixReactionHandler"; import { ARGUMENT_PROMPT_LISTENER, - DEFAUILT_ARGUMENT_PROMPT_LISTENER, + DEFAULT_ARGUMENT_PROMPT_LISTENER, makeListenerForArgumentPrompt, makeListenerForPromptDefault, } from "../../commands/interface-manager/MatrixPromptForAccept"; @@ -82,7 +82,7 @@ export class AppserviceCommandHandler { ) ); this.reactionHandler.on( - DEFAUILT_ARGUMENT_PROMPT_LISTENER, + DEFAULT_ARGUMENT_PROMPT_LISTENER, makeListenerForPromptDefault( this.adminRoomID, this.commandDispatcher, diff --git a/src/appservice/cli.ts b/src/appservice/cli.ts index 7896837c..04c27a77 100644 --- a/src/appservice/cli.ts +++ b/src/appservice/cli.ts @@ -16,7 +16,7 @@ import { Value } from "@sinclair/typebox/value"; /** * This file provides the entrypoint for the appservice mode for draupnir. * A registration file can be generated `ts-node src/appservice/cli.ts -r -u "http://host.docker.internal:9000"` - * and the appservice can be started with `ts-node src/appservice/cli -p 9000 -c your-confg.yaml`. + * and the appservice can be started with `ts-node src/appservice/cli -p 9000 -c your-config.yaml`. */ const cli = new Cli({ registrationPath: "draupnir-registration.yaml", diff --git a/src/backingstore/better-sqlite3/SqliteRoomStateBackingStore.ts b/src/backingstore/better-sqlite3/SqliteRoomStateBackingStore.ts index 755d32bf..79123203 100644 --- a/src/backingstore/better-sqlite3/SqliteRoomStateBackingStore.ts +++ b/src/backingstore/better-sqlite3/SqliteRoomStateBackingStore.ts @@ -55,7 +55,7 @@ const SchemaOptions = { ), legacyUpgrade(db) { // An older version of this store used a different schema management system - // fortunatley the data is just a psersistent cache so we don't need to worry about removing it. + // fortunately the data is just a persistent cache so we don't need to worry about removing it. db.exec(` DROP TABLE room_state_event; DROP TABLE room_info; @@ -225,7 +225,7 @@ export class SqliteRoomStateBackingStore ); const deleteRoom = this.db.transaction(() => { deleteStateStatement.run(roomID); - deleteMetaStatement.run(roomID); // needs to be last to avoid violating foriegn key cnostraint + deleteMetaStatement.run(roomID); // needs to be last to avoid violating foreign key constraint }); try { deleteRoom(); diff --git a/src/capabilities/RoomTakedownCapability.tsx b/src/capabilities/RoomTakedownCapability.tsx index ce3eb2af..52d872ff 100644 --- a/src/capabilities/RoomTakedownCapability.tsx +++ b/src/capabilities/RoomTakedownCapability.tsx @@ -24,7 +24,7 @@ export const RoomTakedownCapability = Type.Intersect([ Capability, ]); // we'll probably want to include room details too so we can provide some -// rudinemtary information to takedown. +// rudimentary information to takedown. // I'd make the fields optional however because it may be impossible // to get those details on conduwuit. export type RoomTakedownCapability = { diff --git a/src/capabilities/StandardUserConsequencesRenderer.tsx b/src/capabilities/StandardUserConsequencesRenderer.tsx index ea3ee266..acf50059 100644 --- a/src/capabilities/StandardUserConsequencesRenderer.tsx +++ b/src/capabilities/StandardUserConsequencesRenderer.tsx @@ -264,7 +264,7 @@ class StandardUserConsequencesRenderer implements UserConsequences { describeCapabilityRenderer({ name: "StandardUserConsequences", - description: "Renders your mum uselesss", + description: "Renders your mum useless", interface: "UserConsequences", factory(description, draupnir, capability) { return new StandardUserConsequencesRenderer( diff --git a/src/capabilities/SynapseAdminRoomTakedown/SynapseAdminRoomTakedown.ts b/src/capabilities/SynapseAdminRoomTakedown/SynapseAdminRoomTakedown.ts index 8c6bdc19..c5db8cf5 100644 --- a/src/capabilities/SynapseAdminRoomTakedown/SynapseAdminRoomTakedown.ts +++ b/src/capabilities/SynapseAdminRoomTakedown/SynapseAdminRoomTakedown.ts @@ -79,7 +79,7 @@ export class SynapseAdminRoomTakedownCapability details = detailsResponse.ok; } log.debug("Taking down room", roomID); - // we use delte V1 because clients do not pick up the user's own leave event + // we use delete V1 because clients do not pick up the user's own leave event // in V2 and i don't know why. // That is very important in the case of stuck invitations. const takedownResult = await this.adminClient.deleteRoom(roomID, { @@ -103,7 +103,7 @@ export class SynapseAdminRoomTakedownCapability describeCapabilityProvider({ name: SynapseAdminRoomTakedownCapability.name, interface: "RoomTakedownCapability", - description: "Takesdown rooms using the synapse admin API", + description: "Takes down rooms using the synapse admin API", factory(description, draupnir) { if (draupnir.synapseAdminClient === undefined) { throw new TypeError( diff --git a/src/commands/DraupnirCommands.ts b/src/commands/DraupnirCommands.ts index c5a96509..3f3c15a7 100644 --- a/src/commands/DraupnirCommands.ts +++ b/src/commands/DraupnirCommands.ts @@ -57,7 +57,7 @@ import { DraupnirProtectionsCapabilityCommand } from "./ProtectionsCapabilitiesC import { JoinWaveCommandTable } from "../protections/JoinWaveShortCircuit"; import { DraupnirTakedownCommand } from "./server-admin/Takedown"; import { SynapseAdminSuspendUserCommand } from "./server-admin/SuspendCommand"; -import { SynpaseAdminUnrestrictUserCommand } from "./server-admin/UnrestrictCommand"; +import { SynapseAdminUnrestrictUserCommand } from "./server-admin/UnrestrictCommand"; import { DraupnirPolicyRemoveCommand } from "./unban/PolicyRemove"; // TODO: These commands should all be moved to subdirectories tbh and this @@ -67,7 +67,7 @@ export const SynapseAdminCommands = new StandardCommandTable("synapse admin") .internCommand(SynapseAdminHijackRoomCommand, ["hijack", "room"]) .internCommand(SynapseAdminShutdownRoomCommand, ["shutdown", "room"]) .internCommand(SynapseAdminSuspendUserCommand, ["suspend"]) - .internCommand(SynpaseAdminUnrestrictUserCommand, ["unrestrict"]); + .internCommand(SynapseAdminUnrestrictUserCommand, ["unrestrict"]); const DraupnirCommands = new StandardCommandTable("draupnir") .internCommand(DraupnirAliasMoveCommand, ["alias", "move"]) diff --git a/src/commands/ProtectionsCommands.tsx b/src/commands/ProtectionsCommands.tsx index 308c7a67..3fadc30e 100644 --- a/src/commands/ProtectionsCommands.tsx +++ b/src/commands/ProtectionsCommands.tsx @@ -250,7 +250,7 @@ export const DraupnirProtectionsConfigAddCommand = describeCommand({ } const newSettings = details.description .toMirror() - // We technically need to print the argument "readbly" but i don't think + // We technically need to print the argument "ready" but i don't think // we have a way to do that. // at least without getting the argument from the argument stream in // interface-manager so that we still have its presentation type. @@ -418,7 +418,7 @@ async function findSettingDetailsForCommand( // So I'm thinking instead that we're going to move to the PersistentConfigData // thingy for protection settings. Wouldn't it make sense to make a plan for that, -// consider how recovery would work, and how to unit test evertyhing, then +// consider how recovery would work, and how to unit test everything, then // do that. async function changeSettingsForCommands< @@ -503,7 +503,7 @@ DraupnirInterfaceAdaptor.describeRenderer( ); export const DraupnirProtectionsCapabilityResetCommand = describeCommand({ - summary: "Use the default set of capabilies for the named protection", + summary: "Use the default set of capabilities for the named protection", parameters: tuple({ name: "protection name", acceptor: StringPresentationType, diff --git a/src/commands/ProtectionsShowCommand.tsx b/src/commands/ProtectionsShowCommand.tsx index d3780c7c..ca892732 100644 --- a/src/commands/ProtectionsShowCommand.tsx +++ b/src/commands/ProtectionsShowCommand.tsx @@ -109,7 +109,7 @@ DraupnirInterfaceAdaptor.describeRenderer(DraupnirProtectionsShowCommand, { {protectionInfo.description.name} {"<"}property name{">"} {"<"}value {">"} {" "} - command. Protections may provide more conveniant commands to manage + command. Protections may provide more convenient commands to manage their settings.

diff --git a/src/commands/RedactCommand.ts b/src/commands/RedactCommand.ts index f10cbb05..ef2e100f 100644 --- a/src/commands/RedactCommand.ts +++ b/src/commands/RedactCommand.ts @@ -51,7 +51,7 @@ export async function redactEvent( export const DraupnirRedactCommand = describeCommand({ summary: - "Redacts either a users's recent messagaes within protected rooms or a specific message shared with the bot.", + "Redacts either a users's recent messages within protected rooms or a specific message shared with the bot.", parameters: tuple({ name: "entity", acceptor: { diff --git a/src/commands/StatusCommand.tsx b/src/commands/StatusCommand.tsx index 82f5ef55..b16fcade 100644 --- a/src/commands/StatusCommand.tsx +++ b/src/commands/StatusCommand.tsx @@ -92,7 +92,7 @@ DraupnirInterfaceAdaptor.describeRenderer(DraupnirStatusCommand, { }, }); -// FIXME: need a shoutout to dependencies in here and NOTICE info. +// FIXME: need a shout out to dependencies in here and NOTICE info. export function draupnirStatusInfo(draupnir: Draupnir): StatusInfo { const watchedListInfo = groupWatchedPolicyRoomsByProtectionStatus( draupnir.protectedRoomsSet.watchedPolicyRooms, diff --git a/src/commands/WatchUnwatchCommand.ts b/src/commands/WatchUnwatchCommand.ts index 5298bd4e..1afdf89d 100644 --- a/src/commands/WatchUnwatchCommand.ts +++ b/src/commands/WatchUnwatchCommand.ts @@ -32,7 +32,7 @@ export type DraupnirWatchUnwatchCommandContext = { export const DraupnirWatchPolicyRoomCommand = describeCommand({ summary: - "Watches a list and applies the list's assocated policies to draupnir's protected rooms.", + "Watches a list and applies the list's associated policies to draupnir's protected rooms.", parameters: tuple({ name: "policy room", acceptor: MatrixRoomReferencePresentationSchema, @@ -62,7 +62,7 @@ export const DraupnirWatchPolicyRoomCommand = describeCommand({ export const DraupnirUnwatchPolicyRoomCommand = describeCommand({ summary: - "Unwatches a list and stops applying the list's assocated policies to draupnir's protected rooms.", + "Unwatches a list and stops applying the list's associated policies to draupnir's protected rooms.", parameters: tuple({ name: "policy room", acceptor: MatrixRoomReferencePresentationSchema, diff --git a/src/commands/interface-manager/MPSMatrixInterfaceAdaptor.ts b/src/commands/interface-manager/MPSMatrixInterfaceAdaptor.ts index e75f9899..7cc22002 100644 --- a/src/commands/interface-manager/MPSMatrixInterfaceAdaptor.ts +++ b/src/commands/interface-manager/MPSMatrixInterfaceAdaptor.ts @@ -161,7 +161,7 @@ export const MPSCommandDispatcherCallbacks = { }, commandUncaughtErrorCB(info, body, error) { log.error( - `Caught an unexpcted error when attempting to process the command "${body}" send by the user ${info.commandSender}:`, + `Caught an unexpected error when attempting to process the command "${body}" send by the user ${info.commandSender}:`, error ); }, diff --git a/src/commands/interface-manager/MatrixPromptForAccept.tsx b/src/commands/interface-manager/MatrixPromptForAccept.tsx index 49be9124..e2d94157 100644 --- a/src/commands/interface-manager/MatrixPromptForAccept.tsx +++ b/src/commands/interface-manager/MatrixPromptForAccept.tsx @@ -69,7 +69,7 @@ export function continueCommandAcceptingPrompt( ); } -export const DEFAUILT_ARGUMENT_PROMPT_LISTENER = +export const DEFAULT_ARGUMENT_PROMPT_LISTENER = "ge.applied-langua.ge.draupnir.default_argument_prompt"; export function makeListenerForPromptDefault( commandRoomID: StringRoomID, @@ -155,7 +155,7 @@ export async function promptDefault( { replyToEvent: eventContext.event, additionalContent: reactionHandler.createAnnotation( - DEFAUILT_ARGUMENT_PROMPT_LISTENER, + DEFAULT_ARGUMENT_PROMPT_LISTENER, reactionMap, { command_designator: command.designator, diff --git a/src/commands/interface-manager/MatrixPromptForConfirmation.tsx b/src/commands/interface-manager/MatrixPromptForConfirmation.tsx index 531a749e..4541ee3c 100644 --- a/src/commands/interface-manager/MatrixPromptForConfirmation.tsx +++ b/src/commands/interface-manager/MatrixPromptForConfirmation.tsx @@ -143,7 +143,7 @@ export async function sendConfirmationPrompt( return sendResult as Result; } if (sendResult.ok[0] === undefined) { - throw new TypeError(`We exepct to have sent at least one event`); + throw new TypeError(`We expect to have sent at least one event`); } return await reactionHandler .addReactionsToEvent(client, roomIDToUse, sendResult.ok[0], reactionMap) diff --git a/src/commands/server-admin/DeactivateCommand.tsx b/src/commands/server-admin/DeactivateCommand.tsx index 1274af85..e7b54d7e 100644 --- a/src/commands/server-admin/DeactivateCommand.tsx +++ b/src/commands/server-admin/DeactivateCommand.tsx @@ -104,7 +104,7 @@ export const SynapseAdminDeactivateCommand = describeCommand({ ); } else if (!details.ok) { return ResultError.Result( - `Couldn't find a residident user with the ID ${targetUser.toString()}` + `Couldn't find a resident user with the ID ${targetUser.toString()}` ); } return Ok({ diff --git a/src/commands/server-admin/ShutdownRoomCommand.ts b/src/commands/server-admin/ShutdownRoomCommand.ts index b2f82dff..d4a23a4f 100644 --- a/src/commands/server-admin/ShutdownRoomCommand.ts +++ b/src/commands/server-admin/ShutdownRoomCommand.ts @@ -63,7 +63,7 @@ export const SynapseAdminShutdownRoomCommand = describeCommand({ return resolvedRoom; } const reason = reasonParts.join(" "); - // we use delte V1 because clients do not pick up the user's own leave event + // we use delete V1 because clients do not pick up the user's own leave event // in V2 and i don't know why. // That is very important in the case of stuck invitations. return await draupnir.synapseAdminClient.deleteRoom( diff --git a/src/commands/server-admin/Takedown.tsx b/src/commands/server-admin/Takedown.tsx index b62915c8..e3c6e881 100644 --- a/src/commands/server-admin/Takedown.tsx +++ b/src/commands/server-admin/Takedown.tsx @@ -119,7 +119,7 @@ export type TakedownPolicyPreview = { export const DraupnirTakedownCommand = describeCommand({ summary: - "Mark an entity for takedown. This command is used to mark illegal or intollerable content as takedown. This is the strongest of consequences and is usualy irreversable.\ + "Mark an entity for takedown. This command is used to mark illegal or intolerable content as takedown. This is the strongest of consequences and is usually irreversible.\ This can be used to block rooms on your homeserver and discard spam invitations.", parameters: tuple( { @@ -277,7 +277,7 @@ function renderTakedownPreview(preview: TakedownPolicyPreview): DocumentNode {
  • policy room: {renderRoomPill(preview.policyRoom)}
  • -
    Please consider that doing so may have irreversable effects.
    +
    Please consider that doing so may have irreversible effects.

    You MUST only use takedown policies to mark spam, illegal, or diff --git a/src/commands/server-admin/UnrestrictCommand.tsx b/src/commands/server-admin/UnrestrictCommand.tsx index c6e3eec4..5bc3f124 100644 --- a/src/commands/server-admin/UnrestrictCommand.tsx +++ b/src/commands/server-admin/UnrestrictCommand.tsx @@ -13,7 +13,7 @@ import { Result, ResultError } from "@gnuxie/typescript-result"; import { SynapseAdminUserSuspensionCapability } from "../../protections/HomeserverUserPolicyApplication/UserSuspensionCapability"; import { DraupnirInterfaceAdaptor } from "../DraupnirCommandPrerequisites"; -export const SynpaseAdminUnrestrictUserCommand = describeCommand({ +export const SynapseAdminUnrestrictUserCommand = describeCommand({ summary: "Unrestrict a user on the homeserver if their account has been suspended or shadowbanned", parameters: tuple({ @@ -47,6 +47,6 @@ export const SynpaseAdminUnrestrictUserCommand = describeCommand({ }, }); -DraupnirInterfaceAdaptor.describeRenderer(SynpaseAdminUnrestrictUserCommand, { +DraupnirInterfaceAdaptor.describeRenderer(SynapseAdminUnrestrictUserCommand, { isAlwaysSupposedToUseDefaultRenderer: true, }); diff --git a/src/commands/unban/Unban.tsx b/src/commands/unban/Unban.tsx index d5c16c94..982bf334 100644 --- a/src/commands/unban/Unban.tsx +++ b/src/commands/unban/Unban.tsx @@ -75,7 +75,7 @@ export type UnbanMembersPreview = UnbanEntityPreview & { readonly membersToUnban: MemberRooms[]; }; -// The idea is to to only diplay these if at least one result failed. +// The idea is to to only display these if at least one result failed. export type UnbanMembersResult = UnbanMembersPreview & { readonly policyRemovalResult: RoomSetResult; readonly usersUnbanned: ResultForUsersInSet; diff --git a/src/commands/unban/UnbanUsers.tsx b/src/commands/unban/UnbanUsers.tsx index 6778a152..0edc553d 100644 --- a/src/commands/unban/UnbanUsers.tsx +++ b/src/commands/unban/UnbanUsers.tsx @@ -278,7 +278,7 @@ export function findUnbanInformationForMember( ) { literalsToScan.push(match.entity); } - // HashedLiterals that match will be removed indriectly when their sourceEvent's + // HashedLiterals that match will be removed indirectly when their sourceEvent's // get removed. } } @@ -302,7 +302,7 @@ export function findUnbanInformationForMember( ).length > 0 ); }; - // Now we need to filter out only members that are completly free of policies. + // Now we need to filter out only members that are completely free of policies. const membersToUnban = membersMatchingPoliciesAndEntity.filter( (member) => !isMemberStillBannedAfterPolicyRemoval(member) ); diff --git a/src/draupnirfactory/DraupnirFactory.ts b/src/draupnirfactory/DraupnirFactory.ts index 784d0c7c..afe08be1 100644 --- a/src/draupnirfactory/DraupnirFactory.ts +++ b/src/draupnirfactory/DraupnirFactory.ts @@ -133,7 +133,7 @@ export class DraupnirFactory { managementRoomMembership.ok, managementRoomState.ok ); - // synapesHTTPAntispam is made here so that the listeners get destroyed + // synapseHTTPAntispam is made here so that the listeners get destroyed // when draupnir is destroyed. const synapseHTTPAntispam = config.web.synapseHTTPAntispam.enabled ? new SynapseHttpAntispam(config.web.synapseHTTPAntispam.authorization) diff --git a/src/draupnirfactory/StandardDraupnirManager.ts b/src/draupnirfactory/StandardDraupnirManager.ts index adb17b89..513090ac 100644 --- a/src/draupnirfactory/StandardDraupnirManager.ts +++ b/src/draupnirfactory/StandardDraupnirManager.ts @@ -165,12 +165,12 @@ export class StandardDraupnirManager { return safeModeDraupnir; } - private isNormalDraupnir(drapunirClientID: StringUserID): boolean { - return this.draupnir.has(drapunirClientID); + private isNormalDraupnir(draupnirClientID: StringUserID): boolean { + return this.draupnir.has(draupnirClientID); } - private isSafeModeDraupnir(drapunirClientID: StringUserID): boolean { - return this.safeModeDraupnir.has(drapunirClientID); + private isSafeModeDraupnir(draupnirClientID: StringUserID): boolean { + return this.safeModeDraupnir.has(draupnirClientID); } /** diff --git a/src/managementroom/ManagementRoomOutput.ts b/src/managementroom/ManagementRoomOutput.ts index 79c64cc9..cadfa237 100644 --- a/src/managementroom/ManagementRoomOutput.ts +++ b/src/managementroom/ManagementRoomOutput.ts @@ -58,7 +58,7 @@ export interface ManagementRoomOutput { } /** - * Allows the different componenets of draupnir to send messages back to the management room without introducing a dependency on the entirity of a `Draupnir` instance. + * Allows the different components of draupnir to send messages back to the management room without introducing a dependency on the entirety of a `Draupnir` instance. */ export default class StandardManagementRoomOutput implements ManagementRoomOutput diff --git a/src/models/RoomUpdateError.tsx b/src/models/RoomUpdateError.tsx index a796b2e3..a58677cf 100644 --- a/src/models/RoomUpdateError.tsx +++ b/src/models/RoomUpdateError.tsx @@ -37,8 +37,8 @@ function renderErrorItem(error: RoomUpdateError): DocumentNode { * @param errors Any errors associated with the action. * @param options.title To give context about what the action was, shown when there are errors. * @param options.noErrorsText To show when there are no errors. - * @param options.skipNoErrors is ineffective and does nothing, it is an option for the accompnying `printActionResult`. - * @returns A `DocumentNode` fragment that can be sent to Matrix or incorperated into another message. + * @param options.skipNoErrors is ineffective and does nothing, it is an option for the accompanying `printActionResult`. + * @returns A `DocumentNode` fragment that can be sent to Matrix or incorporated into another message. */ export async function renderActionResult( errors: RoomUpdateError[], diff --git a/src/protections/BanPropagation.tsx b/src/protections/BanPropagation.tsx index 88823f68..82b2a966 100644 --- a/src/protections/BanPropagation.tsx +++ b/src/protections/BanPropagation.tsx @@ -336,10 +336,16 @@ describeProtection({ defaultCapabilities: { userConsequences: "StandardUserConsequences", }, - factory: (decription, protectedRoomsSet, draupnir, capabilities, _settings) => + factory: ( + description, + protectedRoomsSet, + draupnir, + capabilities, + _settings + ) => Ok( new BanPropagationProtection( - decription, + description, capabilities, protectedRoomsSet, draupnir diff --git a/src/protections/BlockInvitationsOnServerProtection.tsx b/src/protections/BlockInvitationsOnServerProtection.tsx index ef3ef38c..470aaff5 100644 --- a/src/protections/BlockInvitationsOnServerProtection.tsx +++ b/src/protections/BlockInvitationsOnServerProtection.tsx @@ -152,7 +152,7 @@ export class BlockInvitationsOnServerProtection describeProtection({ name: BlockInvitationsOnServerProtection.name, description: - "Blocks invitations from users marked as takedown or have bans matching the the configured automaticallyRedactForReasons", + "Blocks invitations from users marked as takedown or have bans matching the configured automaticallyRedactForReasons", capabilityInterfaces: {}, defaultCapabilities: {}, factory(description, protectedRoomsSet, draupnir, capabilities, _settings) { diff --git a/src/protections/DraupnirProtectionsIndex.ts b/src/protections/DraupnirProtectionsIndex.ts index ac14907a..33d6ed65 100644 --- a/src/protections/DraupnirProtectionsIndex.ts +++ b/src/protections/DraupnirProtectionsIndex.ts @@ -4,7 +4,7 @@ /** * This file exists as a way to register all protections. - * In future, we should maybe try to dogfood the dynamic plugin load sytem + * In future, we should maybe try to dogfood the dynamic plugin load system * instead. For now that system doesn't even exist. */ diff --git a/src/protections/HomeserverUserPolicyApplication/HomeserverUserPolicyApplication.ts b/src/protections/HomeserverUserPolicyApplication/HomeserverUserPolicyApplication.ts index 3efe721e..d4e058b4 100644 --- a/src/protections/HomeserverUserPolicyApplication/HomeserverUserPolicyApplication.ts +++ b/src/protections/HomeserverUserPolicyApplication/HomeserverUserPolicyApplication.ts @@ -42,7 +42,7 @@ export class HomeserverUserPolicyApplication { // nothing to do. } - private isPolicyElegiableForRestriction(policy: LiteralPolicyRule): boolean { + private isPolicyEligibleForRestriction(policy: LiteralPolicyRule): boolean { if (policy.kind !== PolicyRuleType.User) { return false; } @@ -127,7 +127,7 @@ export class HomeserverUserPolicyApplication { if (policy.matchType !== PolicyRuleMatchType.Literal) { continue; } - if (!this.isPolicyElegiableForRestriction(policy)) { + if (!this.isPolicyEligibleForRestriction(policy)) { continue; } const isUserRestricted = await this.consequences.isUserRestricted( @@ -141,7 +141,7 @@ export class HomeserverUserPolicyApplication { } else if (isUserRestricted.ok) { continue; // user is already suspended } - // FIXME: Takedown policie should really automatically deactivate + // FIXME: Takedown policy should really automatically deactivate // after a grace period or something. if ( this.automaticallyRedactForReasons.some( @@ -182,9 +182,9 @@ export class HomeserverUserPolicyApplication { // in the background too. void Task( (async () => { - log.debug("Findind local users to suspend at protection enable..."); + log.debug("Finding local users to suspend at protection enable..."); const revision = this.watchedPolicyRooms.currentRevision; - // FIXME: We need to also paginate through all supsended, shadowbanned, and locked + // FIXME: We need to also paginate through all suspended, shadowbanned, and locked // users to see if they have a matching policy and recommend that they either // be deactivated or have their restrictions lifted. // probably something for another component of the protection to do. diff --git a/src/protections/HomeserverUserPolicyApplication/HomeserverUserPurgingDeactivate.ts b/src/protections/HomeserverUserPolicyApplication/HomeserverUserPurgingDeactivate.ts index d14427c5..7488bd00 100644 --- a/src/protections/HomeserverUserPolicyApplication/HomeserverUserPurgingDeactivate.ts +++ b/src/protections/HomeserverUserPolicyApplication/HomeserverUserPurgingDeactivate.ts @@ -72,7 +72,7 @@ export class HomeserverUserPurgingDeactivate { ); } // We make sure we have shadow banned their account while we redact. - // This is to make sure they don't send anymore while we decomission the account. + // This is to make sure they don't send anymore while we decommission the account. if (!userDetails.ok || !isUserAccountRestricted(userDetails.ok)) { const shadowBanResult = await this.synapseAdminClient.shadowBanUser(userID); diff --git a/src/protections/HomeserverUserPolicyApplication/UserRestrictionAuditLog.ts b/src/protections/HomeserverUserPolicyApplication/UserRestrictionAuditLog.ts index f0fb6679..a8b4022e 100644 --- a/src/protections/HomeserverUserPolicyApplication/UserRestrictionAuditLog.ts +++ b/src/protections/HomeserverUserPolicyApplication/UserRestrictionAuditLog.ts @@ -18,7 +18,7 @@ export interface UserRestrictionAuditLog { } ): Promise>; recordExistingUserRestriction( - uesrID: StringUserID, + userID: StringUserID, restriction: AccountRestriction ): Promise>; unrestrictUser( diff --git a/src/protections/JoinWaveShortCircuit.tsx b/src/protections/JoinWaveShortCircuit.tsx index 79754f9c..ac177511 100644 --- a/src/protections/JoinWaveShortCircuit.tsx +++ b/src/protections/JoinWaveShortCircuit.tsx @@ -144,7 +144,7 @@ export class JoinWaveShortCircuitProtection const roomID = revision.room.toRoomIDOrAlias(); for (const change of changes) { await this.handleMembership(roomID, change).catch((e: unknown) => { - log.error(`Unexpected error handling memebership change`, e); + log.error(`Unexpected error handling membership change`, e); }); } return Ok(undefined); diff --git a/src/protections/MembershipChangeProtection.tsx b/src/protections/MembershipChangeProtection.tsx index 07d528e3..409e1b46 100644 --- a/src/protections/MembershipChangeProtection.tsx +++ b/src/protections/MembershipChangeProtection.tsx @@ -194,10 +194,16 @@ describeProtection< finalConsequences: "StandardUserConsequences", }, configSchema: MembershipChangeProtectionSettings, - factory: (decription, protectedRoomsSet, draupnir, capabilitySet, settings) => + factory: ( + description, + protectedRoomsSet, + draupnir, + capabilitySet, + settings + ) => Ok( new MembershipChangeProtection( - decription, + description, capabilitySet, protectedRoomsSet, draupnir.clientPlatform.toRoomMessageSender(), diff --git a/src/protections/MentionLimitProtection.tsx b/src/protections/MentionLimitProtection.tsx index 2af6324b..d51b5b75 100644 --- a/src/protections/MentionLimitProtection.tsx +++ b/src/protections/MentionLimitProtection.tsx @@ -203,7 +203,7 @@ describeProtection< typeof MentionLimitProtectionSettings >({ name: "MentionLimitProtection", - description: `A potection that will remove any messages with + description: `A protection that will remove any messages with a number of mentions over a preconfigured limit. Please read the documentation https://the-draupnir-project.github.io/draupnir-documentation/protections/mention-limit-protection.`, capabilityInterfaces: { @@ -215,10 +215,16 @@ describeProtection< userConsequences: "StandardUserConsequences", }, configSchema: MentionLimitProtectionSettings, - factory: (decription, protectedRoomsSet, draupnir, capabilitySet, settings) => + factory: ( + description, + protectedRoomsSet, + draupnir, + capabilitySet, + settings + ) => Ok( new MentionLimitProtection( - decription, + description, capabilitySet, draupnir.clientPlatform.toRoomMessageSender(), protectedRoomsSet, diff --git a/src/protections/NewJoinerProtection.ts b/src/protections/NewJoinerProtection.ts index 07942122..7065993c 100644 --- a/src/protections/NewJoinerProtection.ts +++ b/src/protections/NewJoinerProtection.ts @@ -96,10 +96,10 @@ describeProtection({ defaultCapabilities: { userConsequences: "StandardUserConsequences", }, - factory: (decription, protectedRoomsSet, draupnir, capabilitySet) => + factory: (description, protectedRoomsSet, draupnir, capabilitySet) => Ok( new NewJoinerProtection( - decription, + description, capabilitySet, protectedRoomsSet, draupnir.config diff --git a/src/protections/PolicyChangeNotification.tsx b/src/protections/PolicyChangeNotification.tsx index 3fca8b6c..740dcf69 100644 --- a/src/protections/PolicyChangeNotification.tsx +++ b/src/protections/PolicyChangeNotification.tsx @@ -43,13 +43,13 @@ import { renderRuleHashes, renderRuleClearText } from "../commands/Rules"; const log = new Logger("PolicyChangeNotification"); -export type PolicyChangeNotificationCapabilitites = Record; +export type PolicyChangeNotificationCapabilities = Record; export type PolicyChangeNotificationProtectionDescription = ProtectionDescription< Draupnir, UnknownConfig, - PolicyChangeNotificationCapabilitites + PolicyChangeNotificationCapabilities >; type ChangesByRoomID = Map; @@ -60,7 +60,7 @@ export class PolicyChangeNotification { constructor( description: PolicyChangeNotificationProtectionDescription, - capabilities: PolicyChangeNotificationCapabilitites, + capabilities: PolicyChangeNotificationCapabilities, protectedRoomsSet: ProtectedRoomsSet, private readonly draupnir: Draupnir ) { @@ -159,7 +159,7 @@ function renderGroupedChanges(groupedChanges: GroupedChange[]): DocumentNode { return {groupedChanges.map(renderListChanges)}; } -describeProtection({ +describeProtection({ name: PolicyChangeNotification.name, description: "Provides notification of policy changes from watched lists.", capabilityInterfaces: {}, diff --git a/src/protections/ProtectedRooms/ProtectJoinedRooms.tsx b/src/protections/ProtectedRooms/ProtectJoinedRooms.tsx index 0d927d19..317c9aa9 100644 --- a/src/protections/ProtectedRooms/ProtectJoinedRooms.tsx +++ b/src/protections/ProtectedRooms/ProtectJoinedRooms.tsx @@ -105,7 +105,7 @@ export class ProtectedJoinedRooms { {} ), { - description: "Report newly protected rooms to the managmeent room.", + description: "Report newly protected rooms to the management room.", } ); } diff --git a/src/protections/ProtectedRooms/RoomsSetBehaviourProtection.tsx b/src/protections/ProtectedRooms/RoomsSetBehaviourProtection.tsx index 14dba437..09273cbc 100644 --- a/src/protections/ProtectedRooms/RoomsSetBehaviourProtection.tsx +++ b/src/protections/ProtectedRooms/RoomsSetBehaviourProtection.tsx @@ -19,13 +19,13 @@ import { ProtectedJoinedRooms } from "./ProtectJoinedRooms"; import { UnprotectPartedRooms } from "./UnprotectPartedRooms"; import { StringRoomID } from "@the-draupnir-project/matrix-basic-types"; -export type RoomsSetBehaviourCapabailities = Record; +export type RoomsSetBehaviourCapabilities = Record; export type RoomsSetBehaviourSettings = UnknownConfig; export type RoomsSetBehaviourDescription = ProtectionDescription< Draupnir, RoomsSetBehaviourSettings, - RoomsSetBehaviourCapabailities + RoomsSetBehaviourCapabilities >; export class RoomsSetBehaviour @@ -47,7 +47,7 @@ export class RoomsSetBehaviour ); public constructor( description: RoomsSetBehaviourDescription, - capabilities: RoomsSetBehaviourCapabailities, + capabilities: RoomsSetBehaviourCapabilities, protectedRoomsSet: ProtectedRoomsSet, private readonly draupnir: Draupnir ) { @@ -80,7 +80,7 @@ export class RoomsSetBehaviour } } -describeProtection({ +describeProtection({ name: RoomsSetBehaviour.name, description: "Unprotects parted rooms and update the list of protected rooms.", diff --git a/src/protections/RedactionSynchronisation.ts b/src/protections/RedactionSynchronisation.ts index 496f6c8b..e36676f8 100644 --- a/src/protections/RedactionSynchronisation.ts +++ b/src/protections/RedactionSynchronisation.ts @@ -66,7 +66,7 @@ type RedactionSynchronisationProtectionDescription = ProtectionDescription< // users will cause issues,, we could just add a second method though. // FIXME: Just add the invited users thing, we need that code here or there -// so may aswell do it and test it. +// so may as well do it and test it. // FIXME: We should consider updating both SetMembership and SetMembershipPolicies // to understand parted members... @@ -80,7 +80,7 @@ export interface RedactionSynchronisationConsequences extends Capability { rejectInvite( roomID: StringRoomID, sender: StringUserID, - reciever: StringUserID, + receiver: StringUserID, reason: string | undefined ): Promise>; } @@ -172,8 +172,8 @@ describeCapabilityRenderer({ async redactMessagesIn(userIDOrGlob, reason, roomIDs) { return await provider.redactMessagesIn(userIDOrGlob, reason, roomIDs); }, - async rejectInvite(roomID, sender, reciever, reason) { - return await provider.rejectInvite(roomID, sender, reciever, reason); + async rejectInvite(roomID, sender, receiver, reason) { + return await provider.rejectInvite(roomID, sender, receiver, reason); }, } satisfies RedactionSynchronisationConsequences); }, diff --git a/src/protections/RoomTakedown/RoomDiscovery.ts b/src/protections/RoomTakedown/RoomDiscovery.ts index 98e2ed15..e6bdf656 100644 --- a/src/protections/RoomTakedown/RoomDiscovery.ts +++ b/src/protections/RoomTakedown/RoomDiscovery.ts @@ -116,7 +116,7 @@ export class SynapseHTTPAntispamRoomDiscovery const storeResult = await this.hashStore.storeUndiscoveredRooms(entries); if (isError(storeResult)) { log.error( - "Unxpected error while trying to store undiscovered rooms", + "Unexpected error while trying to store undiscovered rooms", storeResult.error ); return; diff --git a/src/protections/RoomTakedown/RoomDiscoveryRenderer.tsx b/src/protections/RoomTakedown/RoomDiscoveryRenderer.tsx index 981a6baf..e92cfd37 100644 --- a/src/protections/RoomTakedown/RoomDiscoveryRenderer.tsx +++ b/src/protections/RoomTakedown/RoomDiscoveryRenderer.tsx @@ -16,7 +16,7 @@ export function renderDiscoveredRoom(details: RoomBasicDetails): DocumentNode {

    • - name: {details.name ?? "Unamed room"} + name: {details.name ?? "Unnamed room"}
    • member count: {details.joined_members ?? "unknown"} diff --git a/src/protections/RoomTakedown/RoomTakedown.ts b/src/protections/RoomTakedown/RoomTakedown.ts index 12fc5835..570159c6 100644 --- a/src/protections/RoomTakedown/RoomTakedown.ts +++ b/src/protections/RoomTakedown/RoomTakedown.ts @@ -20,7 +20,7 @@ import { RoomTakedownCapability } from "../../capabilities/RoomTakedownCapabilit const log = new Logger("RoomTakedown"); // FIXME: How can we segment this so that rooms are takendown on prompt in -// the abscence of policy approval? +// the absence of policy approval? // Probably by using a simulated capability that asks to confirm and then // does the takedown for real? // Probably by using an updated version of the shutdown command... diff --git a/src/protections/RoomTakedown/RoomTakedownProtection.ts b/src/protections/RoomTakedown/RoomTakedownProtection.ts index 2858d139..4c0f148e 100644 --- a/src/protections/RoomTakedown/RoomTakedownProtection.ts +++ b/src/protections/RoomTakedown/RoomTakedownProtection.ts @@ -59,7 +59,7 @@ const RoomTakedownProtectionSettings = Type.Object( discoveryNotificationEnabled: Type.Boolean({ default: false, description: - "Wether to send notifications for newly discovered rooms from the homerserver.", + "Whether to send notifications for newly discovered rooms from the homeserver.", }), }, { title: "RoomTakedownProtectionSettings" } diff --git a/src/protections/RoomTakedown/SqliteRoomAuditLog.ts b/src/protections/RoomTakedown/SqliteRoomAuditLog.ts index 6ebe2601..2f3a5503 100644 --- a/src/protections/RoomTakedown/SqliteRoomAuditLog.ts +++ b/src/protections/RoomTakedown/SqliteRoomAuditLog.ts @@ -33,7 +33,7 @@ const log = new Logger("SqliteRoomAuditLog"); // NOTE: This should only be used to check in bulk whether rooms are taken down // upon getting a policy, you probably always want to try again or // check with the server rather than check the audit log. -// Incase rooms were unbanned. +// In case rooms were unbanned. const SchemaText = [ ` diff --git a/src/protections/invitation/JoinRoomsOnInviteProtection.tsx b/src/protections/invitation/JoinRoomsOnInviteProtection.tsx index f7725398..44b71470 100644 --- a/src/protections/invitation/JoinRoomsOnInviteProtection.tsx +++ b/src/protections/invitation/JoinRoomsOnInviteProtection.tsx @@ -141,7 +141,7 @@ export class JoinRoomsOnInviteProtection const renderFailedTojoin = (error: ActionError) => { const title = ( - Unfortunatley I was unable to accept the invitation from{" "} + Unfortunately I was unable to accept the invitation from{" "} {renderMentionPill(event.sender, event.sender)} to the room{" "} {renderRoomPill(room)}. diff --git a/src/queues/LeakyBucket.ts b/src/queues/LeakyBucket.ts index e5ee78f5..fcdd86d4 100644 --- a/src/queues/LeakyBucket.ts +++ b/src/queues/LeakyBucket.ts @@ -18,7 +18,7 @@ type BucketEntry = { }; /** - * A lazy version of the bucket to be used when the throuhgput is really + * A lazy version of the bucket to be used when the throughput is really * low most of the time, so doesn't warrant constant filling/leaking. * * This won't be good to use in a high throughput situation because diff --git a/src/queues/ProtectedRoomActivityTracker.ts b/src/queues/ProtectedRoomActivityTracker.ts index d5dd7cf2..2723bb68 100644 --- a/src/queues/ProtectedRoomActivityTracker.ts +++ b/src/queues/ProtectedRoomActivityTracker.ts @@ -39,7 +39,7 @@ export class ProtectedRoomActivityTracker { } /** - * Inform the trakcer that a room is no longer being protected by Draupnir. + * Inform the tracker that a room is no longer being protected by Draupnir. * @param roomId The roomId that is no longer being protected by Draupnir. */ public removeProtectedRoom(roomId: string): void { diff --git a/src/report/ReportManager.ts b/src/report/ReportManager.ts index e015373f..7f497705 100644 --- a/src/report/ReportManager.ts +++ b/src/report/ReportManager.ts @@ -512,7 +512,7 @@ export class StandardReportManager { } ); } else { - throw new TypeError(`Something is throwing absoloute garbage ${ex}`); + throw new TypeError(`Something is throwing absolute garbage ${ex}`); } } } diff --git a/src/safemode/DraupnirSafeMode.ts b/src/safemode/DraupnirSafeMode.ts index f59faef2..2a189e32 100644 --- a/src/safemode/DraupnirSafeMode.ts +++ b/src/safemode/DraupnirSafeMode.ts @@ -25,7 +25,7 @@ import { } from "./SafeModeCommandDispatcher"; import { ARGUMENT_PROMPT_LISTENER, - DEFAUILT_ARGUMENT_PROMPT_LISTENER, + DEFAULT_ARGUMENT_PROMPT_LISTENER, makeListenerForArgumentPrompt, makeListenerForPromptDefault, } from "../commands/interface-manager/MatrixPromptForAccept"; @@ -84,7 +84,7 @@ export class SafeModeDraupnir implements MatrixAdaptorContext { ) ); this.reactionHandler.on( - DEFAUILT_ARGUMENT_PROMPT_LISTENER, + DEFAULT_ARGUMENT_PROMPT_LISTENER, makeListenerForPromptDefault( this.commandRoomID, this.commandDispatcher, diff --git a/src/safemode/PersistentConfigEditor.ts b/src/safemode/PersistentConfigEditor.ts index d2502348..c00e8c3e 100644 --- a/src/safemode/PersistentConfigEditor.ts +++ b/src/safemode/PersistentConfigEditor.ts @@ -32,7 +32,7 @@ export interface PersistentConfigEditor { getConfigAdaptors(): PersistentConfigData[]; requestConfigStatus(): Promise>; /** - * requestConfigStatus, but be sure to update the PeristentConfigStatus list + * requestConfigStatus, but be sure to update the PersistentConfigStatus list * with the ConfigPropertyUseError in the safe mode cause, if there is one. * * This is because `ConfigPropertyUseError`'s will not show up in parsing, diff --git a/src/safemode/commands/RecoverCommand.tsx b/src/safemode/commands/RecoverCommand.tsx index 1d1b1eb9..f773dd40 100644 --- a/src/safemode/commands/RecoverCommand.tsx +++ b/src/safemode/commands/RecoverCommand.tsx @@ -33,7 +33,7 @@ export type SafeModeRecoverEffectInfo = { }; export const SafeModeRecoverCommand = describeCommand({ - summary: "Select an availale recovery option to enact.", + summary: "Select an available recovery option to enact.", parameters: tuple({ name: "recovery option", acceptor: StringPresentationType, diff --git a/src/utils.ts b/src/utils.ts index 9d79e3e8..bd1e6faa 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -308,7 +308,7 @@ type RequestResponse = * - they offer no stack. * * This method configures `MatrixClient` to ensure that methods that may throw - * instead throws more reasonable insetances of `Error`. + * instead throws more reasonable instances of `Error`. */ function patchMatrixClientForConciseExceptions() { if (isMatrixClientPatchedForConciseExceptions) { @@ -465,7 +465,7 @@ function patchMatrixClientForRetry() { err?.body?.errcode === "M_LIMIT_EXCEEDED" ) { // We need to retry. - // We're not able to refactor away from thsis now, pretty unfortunatley. + // We're not able to refactor away from this now, pretty unfortunately. // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors reject(err); } else { diff --git a/src/webapis/WebAPIs.ts b/src/webapis/WebAPIs.ts index e467760e..0e5bf114 100644 --- a/src/webapis/WebAPIs.ts +++ b/src/webapis/WebAPIs.ts @@ -191,12 +191,12 @@ export class WebAPIs { const authorization = request.get("Authorization"); if (authorization) { - const brearerMatch = AUTHORIZATION.exec(authorization); - if (brearerMatch === null) { + const bearerMatch = AUTHORIZATION.exec(authorization); + if (bearerMatch === null) { response.status(401).send("Missing access token"); return; } else { - [, accessToken] = brearerMatch; + [, accessToken] = bearerMatch; } } else if (typeof request.query["access_token"] === "string") { // Authentication mechanism 2: Access token as query parameter. @@ -254,7 +254,7 @@ export class WebAPIs { */ // Now, let's gather more info on the event. - // IMPORTANT: The following call will return the event without decyphering it, so we're + // IMPORTANT: The following call will return the event without deciphering it, so we're // not obtaining anything that we couldn't also obtain through a homeserver's Admin API. // // By doing this with the reporterClient, we ensure that this feature of Draupnir can work diff --git a/test/unit/protections/RedactionSynchronisationTest.ts b/test/unit/protections/RedactionSynchronisationTest.ts index ba013915..6d298581 100644 --- a/test/unit/protections/RedactionSynchronisationTest.ts +++ b/test/unit/protections/RedactionSynchronisationTest.ts @@ -60,7 +60,7 @@ describe("RedactionSynchronisation", function () { mockMethodCalls += 1; return Ok(undefined); }, - async rejectInvite(roomID, sender, _reciever, _reason) { + async rejectInvite(roomID, sender, _receiver, _reason) { expect(roomID).toBe(room.toRoomIDOrAlias()); expect(sender).toBe(targetUser); mockMethodCalls += 1; diff --git a/test/unit/stores/hashStoreTest.ts b/test/unit/stores/hashStoreTest.ts index 0eb2a4e6..6d8ad2a5 100644 --- a/test/unit/stores/hashStoreTest.ts +++ b/test/unit/stores/hashStoreTest.ts @@ -69,7 +69,7 @@ describe("meow", function () { expect(reverserResult.length).toBe(0); // now try storing the room and testing that the policy is there (await store.storeUndiscoveredRooms([bannedRoom.toRoomIDOrAlias()])).expect( - "Should be able to discover rooms jsut fine" + "Should be able to discover rooms just fine" ); const foundHash = (await store.findRoomHash(bannedRoomHash)).expect( "Should be able to findRoomHash" @@ -116,7 +116,7 @@ describe("meow", function () { expect(reverserResult.length).toBe(0); // now try storing the room and testing that the policy is there (await store.storeUndiscoveredRooms([roomBannedViaServer])).expect( - "Should be able to discover rooms jsut fine" + "Should be able to discover rooms just fine" ); const foundHash = (await store.findServerHash(bannedServerHash)).expect( "Should be able to now find the server hash from the room we discovered" diff --git a/test/unit/stores/roomStateBackingStoreTest.ts b/test/unit/stores/roomStateBackingStoreTest.ts index ff38c5c8..7730af08 100644 --- a/test/unit/stores/roomStateBackingStoreTest.ts +++ b/test/unit/stores/roomStateBackingStoreTest.ts @@ -88,7 +88,7 @@ describe("RoomStateBackingStore", function () { const db = new Database(options.path); db.pragma("FOREIGN_KEYS = ON"); // This is not the real former schema, because they are the same - // it's just differnt on purpose + // it's just different on purpose db.exec(` CREATE TABLE room_info ( room_id TEXT PRIMARY KEY NOT NULL