Skip to content

Commit d73d0fc

Browse files
authored
Change mentions of Mjölnir to Draupnir (#796)
Cat ran into this funny leftover when validating if abuse reporting still works after Cats reworks in mdad. Turns out they do and as it was my first time using these flows Cat discovered this.
1 parent 5014489 commit d73d0fc

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

src/report/ReportManager.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ enum Kind {
9696
MODERATION_REQUEST,
9797
//! An abuse report, as per https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-rooms-roomid-report-eventid
9898
SERVER_ABUSE_REPORT,
99-
//! Mjölnir encountered a problem while attempting to handle a moderation request or abuse report
99+
//! Draupnir encountered a problem while attempting to handle a moderation request or abuse report
100100
ERROR,
101101
//! A moderation request or server abuse report escalated by the server/room moderators.
102102
ESCALATED_REPORT,
@@ -572,7 +572,7 @@ interface IUIAction {
572572
/**
573573
* A unique label.
574574
*
575-
* Used by Mjölnir to differentiate the actions, e.g. `kick-user`.
575+
* Used by Draupnir to differentiate the actions, e.g. `kick-user`.
576576
*/
577577
readonly label: string;
578578

@@ -590,14 +590,14 @@ interface IUIAction {
590590
readonly needsConfirmation: boolean;
591591

592592
/**
593-
* Detect whether the action may be executed, e.g. whether Mjölnir has
593+
* Detect whether the action may be executed, e.g. whether Draupnir has
594594
* sufficient powerlevel to execute this action.
595595
*
596596
* **Security caveat** This assumes that the security policy on whether
597597
* the operation can be executed is:
598598
*
599599
* > *Anyone* in the moderation room and who isn't muted can execute
600-
* > an operation iff Mjölnir has the rights to execute it.
600+
* > an operation iff Draupnir has the rights to execute it.
601601
*
602602
* @param report Details on the abuse report.
603603
*/
@@ -902,7 +902,7 @@ class Help implements IUIAction {
902902
))
903903
) {
904904
list.push(
905-
`<li>Some actions were disabled because Mjölnir is not moderator in room ${htmlEscape(report.room_alias_or_id)}</li>`
905+
`<li>Some actions were disabled because Draupnir is not moderator in room ${htmlEscape(report.room_alias_or_id)}</li>`
906906
);
907907
}
908908
const body = `<ul>${list.join("\n")}</ul>`;
@@ -911,7 +911,7 @@ class Help implements IUIAction {
911911
}
912912

913913
/**
914-
* Escalate to the moderation room of this instance of Mjölnir.
914+
* Escalate to the moderation room of this instance of Draupnir.
915915
*/
916916
class EscalateToServerModerationRoom implements IUIAction {
917917
public label = "escalate-to-server-moderation";
@@ -1055,7 +1055,7 @@ class DisplayManager {
10551055
}
10561056
} catch (ex) {
10571057
eventContent = {
1058-
msg: `<Cannot extract event. Please verify that Mjölnir has been invited to room ${room.toPermalink()} and made room moderator or administrator>.`,
1058+
msg: `<Cannot extract event. Please verify that Draupnir has been invited to room ${room.toPermalink()} and made room moderator or administrator>.`,
10591059
};
10601060
}
10611061

@@ -1084,7 +1084,7 @@ class DisplayManager {
10841084
try {
10851085
eventTimestamp = new Date(event["origin_server_ts"]).toUTCString();
10861086
} catch (ex) {
1087-
eventTimestamp = `<Cannot extract event. Please verify that Mjölnir has been invited to room ${room.toPermalink()} and made room moderator or administrator>.`;
1087+
eventTimestamp = `<Cannot extract event. Please verify that Draupnir has been invited to room ${room.toPermalink()} and made room moderator or administrator>.`;
10881088
}
10891089

10901090
let title;

src/webapis/WebAPIs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export class WebAPIs {
221221
// as this would let us read encrypted messages;
222222
// - this client is torn down as soon as possible to avoid
223223
// any case in which it could somehow be abused if a
224-
// malicious third-party gains access to Mjölnir.
224+
// malicious third-party gains access to Draupnir.
225225
//
226226
// Rationales for using this mechanism:
227227
//
@@ -233,7 +233,7 @@ export class WebAPIs {
233233
// - identity-checking; and
234234
// - features that are already available in the Synapse Admin API
235235
// (possibly in the Admin APIs of other homeservers, I haven't checked)
236-
// so we are not extending the abilities of Mjölnir
236+
// so we are not extending the abilities of Draupnir
237237
// 3. We are avoiding the use of the Synapse Admin API to ensure that
238238
// this feature can work with all homeservers, not just Synapse.
239239
const reporterClient = new MatrixClient(
@@ -257,7 +257,7 @@ export class WebAPIs {
257257
// IMPORTANT: The following call will return the event without decyphering it, so we're
258258
// not obtaining anything that we couldn't also obtain through a homeserver's Admin API.
259259
//
260-
// By doing this with the reporterClient, we ensure that this feature of Mjölnir can work
260+
// By doing this with the reporterClient, we ensure that this feature of Draupnir can work
261261
// with all Matrix homeservers, rather than just Synapse.
262262
event = await reporterClient.getEvent(roomID, eventID);
263263
}

test/integration/abuseReportTest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe("Test: Reporting abuse", () => {
5656
// are sent.
5757
for (const endpoint of ["v3", "r0"]) {
5858
it(
59-
`Mjölnir intercepts abuse reports with endpoint ${endpoint}`,
59+
`Draupnir intercepts abuse reports with endpoint ${endpoint}`,
6060
async function (this: DraupnirTestContext) {
6161
this.timeout(90000);
6262
if (this.draupnir === undefined) {
@@ -344,7 +344,7 @@ describe("Test: Reporting abuse", () => {
344344
}
345345
assert.deepEqual(found, reportsToFind);
346346

347-
// Since Mjölnir is not a member of the room, the only buttons we should find
347+
// Since Draupnir is not a member of the room, the only buttons we should find
348348
// are `help` and `ignore`.
349349
for (const event of reactions) {
350350
const regexp = /\/([[^]]*)\]/;
@@ -417,7 +417,7 @@ describe("Test: Reporting abuse", () => {
417417
await badUser.joinRoom(roomId);
418418
await goodUser.joinRoom(roomId);
419419

420-
// Setup Mjölnir as moderator for our room.
420+
// Setup Draupnir as moderator for our room.
421421
await moderatorUser.inviteUser(await draupnir.client.getUserId(), roomId);
422422
await moderatorUser.setUserPowerLevel(
423423
await draupnir.client.getUserId(),

test/integration/commands/hijackRoomCommandTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { getFirstReaction } from "./commandUtils";
1414
import { DraupnirTestContext, draupnirSafeEmitter } from "../mjolnirSetupUtils";
1515

1616
describe("Test: The make admin command", function () {
17-
it("Mjölnir make the bot self room administrator", async function (
17+
it("Draupnir make the bot self room administrator", async function (
1818
this: DraupnirTestContext
1919
) {
2020
this.timeout(90000);

test/integration/commands/redactCommandTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("Test: The redaction command", function () {
3131
});
3232

3333
it(
34-
"Mjölnir redacts all of the events sent by a spammer when instructed to by giving their id and a room id.",
34+
"Draupnir redacts all of the events sent by a spammer when instructed to by giving their id and a room id.",
3535
async function (this: RedactionTestContext) {
3636
this.timeout(60000);
3737
// Create a few users and a room.
@@ -139,7 +139,7 @@ describe("Test: The redaction command", function () {
139139
);
140140

141141
it(
142-
"Mjölnir redacts all of the events sent by a spammer when instructed to by giving their id in multiple rooms.",
142+
"Draupnir redacts all of the events sent by a spammer when instructed to by giving their id in multiple rooms.",
143143
async function (this: RedactionTestContext) {
144144
this.timeout(60000);
145145
// Create a few users and a room.

test/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ http {
1212

1313
location ~ ^/_matrix/client/(r0|v3)/rooms/([^/]*)/report/(.*)$ {
1414
mirror /report_mirror;
15-
# Abuse reports should be sent to Mjölnir.
15+
# Abuse reports should be sent to Draupnir.
1616
# The r0 endpoint is deprecated but still used by many clients.
1717
# As of this writing, the v3 endpoint is the up-to-date version.
1818

0 commit comments

Comments
 (0)