mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-08-06 18:59:32 +00:00
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.
This commit is contained in:
@@ -96,7 +96,7 @@ enum Kind {
|
||||
MODERATION_REQUEST,
|
||||
//! An abuse report, as per https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-rooms-roomid-report-eventid
|
||||
SERVER_ABUSE_REPORT,
|
||||
//! Mjölnir encountered a problem while attempting to handle a moderation request or abuse report
|
||||
//! Draupnir encountered a problem while attempting to handle a moderation request or abuse report
|
||||
ERROR,
|
||||
//! A moderation request or server abuse report escalated by the server/room moderators.
|
||||
ESCALATED_REPORT,
|
||||
@@ -572,7 +572,7 @@ interface IUIAction {
|
||||
/**
|
||||
* A unique label.
|
||||
*
|
||||
* Used by Mjölnir to differentiate the actions, e.g. `kick-user`.
|
||||
* Used by Draupnir to differentiate the actions, e.g. `kick-user`.
|
||||
*/
|
||||
readonly label: string;
|
||||
|
||||
@@ -590,14 +590,14 @@ interface IUIAction {
|
||||
readonly needsConfirmation: boolean;
|
||||
|
||||
/**
|
||||
* Detect whether the action may be executed, e.g. whether Mjölnir has
|
||||
* Detect whether the action may be executed, e.g. whether Draupnir has
|
||||
* sufficient powerlevel to execute this action.
|
||||
*
|
||||
* **Security caveat** This assumes that the security policy on whether
|
||||
* the operation can be executed is:
|
||||
*
|
||||
* > *Anyone* in the moderation room and who isn't muted can execute
|
||||
* > an operation iff Mjölnir has the rights to execute it.
|
||||
* > an operation iff Draupnir has the rights to execute it.
|
||||
*
|
||||
* @param report Details on the abuse report.
|
||||
*/
|
||||
@@ -902,7 +902,7 @@ class Help implements IUIAction {
|
||||
))
|
||||
) {
|
||||
list.push(
|
||||
`<li>Some actions were disabled because Mjölnir is not moderator in room ${htmlEscape(report.room_alias_or_id)}</li>`
|
||||
`<li>Some actions were disabled because Draupnir is not moderator in room ${htmlEscape(report.room_alias_or_id)}</li>`
|
||||
);
|
||||
}
|
||||
const body = `<ul>${list.join("\n")}</ul>`;
|
||||
@@ -911,7 +911,7 @@ class Help implements IUIAction {
|
||||
}
|
||||
|
||||
/**
|
||||
* Escalate to the moderation room of this instance of Mjölnir.
|
||||
* Escalate to the moderation room of this instance of Draupnir.
|
||||
*/
|
||||
class EscalateToServerModerationRoom implements IUIAction {
|
||||
public label = "escalate-to-server-moderation";
|
||||
@@ -1055,7 +1055,7 @@ class DisplayManager {
|
||||
}
|
||||
} catch (ex) {
|
||||
eventContent = {
|
||||
msg: `<Cannot extract event. Please verify that Mjölnir has been invited to room ${room.toPermalink()} and made room moderator or administrator>.`,
|
||||
msg: `<Cannot extract event. Please verify that Draupnir has been invited to room ${room.toPermalink()} and made room moderator or administrator>.`,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1084,7 +1084,7 @@ class DisplayManager {
|
||||
try {
|
||||
eventTimestamp = new Date(event["origin_server_ts"]).toUTCString();
|
||||
} catch (ex) {
|
||||
eventTimestamp = `<Cannot extract event. Please verify that Mjölnir has been invited to room ${room.toPermalink()} and made room moderator or administrator>.`;
|
||||
eventTimestamp = `<Cannot extract event. Please verify that Draupnir has been invited to room ${room.toPermalink()} and made room moderator or administrator>.`;
|
||||
}
|
||||
|
||||
let title;
|
||||
|
||||
@@ -221,7 +221,7 @@ export class WebAPIs {
|
||||
// as this would let us read encrypted messages;
|
||||
// - this client is torn down as soon as possible to avoid
|
||||
// any case in which it could somehow be abused if a
|
||||
// malicious third-party gains access to Mjölnir.
|
||||
// malicious third-party gains access to Draupnir.
|
||||
//
|
||||
// Rationales for using this mechanism:
|
||||
//
|
||||
@@ -233,7 +233,7 @@ export class WebAPIs {
|
||||
// - identity-checking; and
|
||||
// - features that are already available in the Synapse Admin API
|
||||
// (possibly in the Admin APIs of other homeservers, I haven't checked)
|
||||
// so we are not extending the abilities of Mjölnir
|
||||
// so we are not extending the abilities of Draupnir
|
||||
// 3. We are avoiding the use of the Synapse Admin API to ensure that
|
||||
// this feature can work with all homeservers, not just Synapse.
|
||||
const reporterClient = new MatrixClient(
|
||||
@@ -257,7 +257,7 @@ export class WebAPIs {
|
||||
// IMPORTANT: The following call will return the event without decyphering 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 Mjölnir can work
|
||||
// By doing this with the reporterClient, we ensure that this feature of Draupnir can work
|
||||
// with all Matrix homeservers, rather than just Synapse.
|
||||
event = await reporterClient.getEvent(roomID, eventID);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ describe("Test: Reporting abuse", () => {
|
||||
// are sent.
|
||||
for (const endpoint of ["v3", "r0"]) {
|
||||
it(
|
||||
`Mjölnir intercepts abuse reports with endpoint ${endpoint}`,
|
||||
`Draupnir intercepts abuse reports with endpoint ${endpoint}`,
|
||||
async function (this: DraupnirTestContext) {
|
||||
this.timeout(90000);
|
||||
if (this.draupnir === undefined) {
|
||||
@@ -344,7 +344,7 @@ describe("Test: Reporting abuse", () => {
|
||||
}
|
||||
assert.deepEqual(found, reportsToFind);
|
||||
|
||||
// Since Mjölnir is not a member of the room, the only buttons we should find
|
||||
// Since Draupnir is not a member of the room, the only buttons we should find
|
||||
// are `help` and `ignore`.
|
||||
for (const event of reactions) {
|
||||
const regexp = /\/([[^]]*)\]/;
|
||||
@@ -417,7 +417,7 @@ describe("Test: Reporting abuse", () => {
|
||||
await badUser.joinRoom(roomId);
|
||||
await goodUser.joinRoom(roomId);
|
||||
|
||||
// Setup Mjölnir as moderator for our room.
|
||||
// Setup Draupnir as moderator for our room.
|
||||
await moderatorUser.inviteUser(await draupnir.client.getUserId(), roomId);
|
||||
await moderatorUser.setUserPowerLevel(
|
||||
await draupnir.client.getUserId(),
|
||||
|
||||
@@ -14,7 +14,7 @@ import { getFirstReaction } from "./commandUtils";
|
||||
import { DraupnirTestContext, draupnirSafeEmitter } from "../mjolnirSetupUtils";
|
||||
|
||||
describe("Test: The make admin command", function () {
|
||||
it("Mjölnir make the bot self room administrator", async function (
|
||||
it("Draupnir make the bot self room administrator", async function (
|
||||
this: DraupnirTestContext
|
||||
) {
|
||||
this.timeout(90000);
|
||||
|
||||
@@ -31,7 +31,7 @@ describe("Test: The redaction command", function () {
|
||||
});
|
||||
|
||||
it(
|
||||
"Mjölnir redacts all of the events sent by a spammer when instructed to by giving their id and a room id.",
|
||||
"Draupnir redacts all of the events sent by a spammer when instructed to by giving their id and a room id.",
|
||||
async function (this: RedactionTestContext) {
|
||||
this.timeout(60000);
|
||||
// Create a few users and a room.
|
||||
@@ -139,7 +139,7 @@ describe("Test: The redaction command", function () {
|
||||
);
|
||||
|
||||
it(
|
||||
"Mjölnir redacts all of the events sent by a spammer when instructed to by giving their id in multiple rooms.",
|
||||
"Draupnir redacts all of the events sent by a spammer when instructed to by giving their id in multiple rooms.",
|
||||
async function (this: RedactionTestContext) {
|
||||
this.timeout(60000);
|
||||
// Create a few users and a room.
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ http {
|
||||
|
||||
location ~ ^/_matrix/client/(r0|v3)/rooms/([^/]*)/report/(.*)$ {
|
||||
mirror /report_mirror;
|
||||
# Abuse reports should be sent to Mjölnir.
|
||||
# Abuse reports should be sent to Draupnir.
|
||||
# The r0 endpoint is deprecated but still used by many clients.
|
||||
# As of this writing, the v3 endpoint is the up-to-date version.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user