mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
requested changes
This commit is contained in:
parent
63510e96bd
commit
829c95700a
@ -47,6 +47,7 @@
|
|||||||
"@sentry/node": "^7.17.2",
|
"@sentry/node": "^7.17.2",
|
||||||
"@sentry/tracing": "^7.17.2",
|
"@sentry/tracing": "^7.17.2",
|
||||||
"@tensorflow/tfjs-node": "^4.21.0",
|
"@tensorflow/tfjs-node": "^4.21.0",
|
||||||
|
"@vector-im/matrix-bot-sdk": "^0.7.1-element.0",
|
||||||
"await-lock": "^2.2.2",
|
"await-lock": "^2.2.2",
|
||||||
"body-parser": "^1.20.1",
|
"body-parser": "^1.20.1",
|
||||||
"config": "^3.3.8",
|
"config": "^3.3.8",
|
||||||
@ -63,8 +64,7 @@
|
|||||||
"prom-client": "^14.1.0",
|
"prom-client": "^14.1.0",
|
||||||
"shell-quote": "^1.7.3",
|
"shell-quote": "^1.7.3",
|
||||||
"ulidx": "^0.3.0",
|
"ulidx": "^0.3.0",
|
||||||
"yaml": "^2.2.2",
|
"yaml": "^2.2.2"
|
||||||
"@vector-im/matrix-bot-sdk": "^0.7.1-element.0"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0"
|
"node": ">=18.0.0"
|
||||||
|
@ -47,7 +47,8 @@ export class AccessControl {
|
|||||||
const accessControlList = new PolicyList(
|
const accessControlList = new PolicyList(
|
||||||
accessControlListId,
|
accessControlListId,
|
||||||
Permalinks.forRoom(accessControlListId),
|
Permalinks.forRoom(accessControlListId),
|
||||||
// @ts-ignore
|
// @ts-ignore - mismatch between client using @vector-im/matrix-bot-sdk and matrix-appservice-bridge using
|
||||||
|
// matrix-bot-sdk
|
||||||
bridge.getBot().getClient()
|
bridge.getBot().getClient()
|
||||||
);
|
);
|
||||||
const accessControlUnit = new AccessControlUnit([accessControlList]);
|
const accessControlUnit = new AccessControlUnit([accessControlList]);
|
||||||
|
@ -140,7 +140,8 @@ export class MjolnirManager {
|
|||||||
invite: [requestingUserId],
|
invite: [requestingUserId],
|
||||||
name: `${requestingUserId}'s mjolnir`
|
name: `${requestingUserId}'s mjolnir`
|
||||||
});
|
});
|
||||||
// @ts-ignore
|
// @ts-ignore - mismatch between client using @vector-im/matrix-bot-sdk and matrix-appservice-bridge using
|
||||||
|
// matrix-bot-sdk
|
||||||
const mjolnir = await this.makeInstance(requestingUserId, managementRoomId, mjIntent.matrixClient);
|
const mjolnir = await this.makeInstance(requestingUserId, managementRoomId, mjIntent.matrixClient);
|
||||||
await mjolnir.createFirstList(requestingUserId, "list");
|
await mjolnir.createFirstList(requestingUserId, "list");
|
||||||
|
|
||||||
@ -183,7 +184,8 @@ export class MjolnirManager {
|
|||||||
await this.makeInstance(
|
await this.makeInstance(
|
||||||
mjolnirRecord.owner,
|
mjolnirRecord.owner,
|
||||||
mjolnirRecord.management_room,
|
mjolnirRecord.management_room,
|
||||||
// @ts-ignore
|
// @ts-ignore - mismatch between client using @vector-im/matrix-bot-sdk and matrix-appservice-bridge using
|
||||||
|
// matrix-bot-sdk
|
||||||
mjIntent.matrixClient,
|
mjIntent.matrixClient,
|
||||||
).catch((e: any) => {
|
).catch((e: any) => {
|
||||||
log.error(`Could not start mjolnir ${mjolnirRecord.local_part} for ${mjolnirRecord.owner}:`, e);
|
log.error(`Could not start mjolnir ${mjolnirRecord.local_part} for ${mjolnirRecord.owner}:`, e);
|
||||||
|
@ -139,6 +139,7 @@ async function execSinceCommandAux(destinationRoomId: string, event: any, mjolni
|
|||||||
}
|
}
|
||||||
|
|
||||||
//...or as a duration
|
//...or as a duration
|
||||||
|
// @ts-ignore
|
||||||
maybeMaxAgeMS = parseDuration(source);
|
maybeMaxAgeMS = parseDuration(source);
|
||||||
if (maybeMaxAgeMS && !Number.isNaN(maybeMaxAgeMS)) {
|
if (maybeMaxAgeMS && !Number.isNaN(maybeMaxAgeMS)) {
|
||||||
maybeMaxAgeMS = Math.abs(maybeMaxAgeMS);
|
maybeMaxAgeMS = Math.abs(maybeMaxAgeMS);
|
||||||
|
@ -14,7 +14,14 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { extractRequestError, LogLevel, LogService, Permalinks, RoomCreateOptions, UserID } from "@vector-im/matrix-bot-sdk";
|
import {
|
||||||
|
extractRequestError,
|
||||||
|
LogLevel,
|
||||||
|
LogService,
|
||||||
|
Permalinks,
|
||||||
|
RoomCreateOptions,
|
||||||
|
UserID
|
||||||
|
} from "@vector-im/matrix-bot-sdk";
|
||||||
import { EventEmitter } from "events";
|
import { EventEmitter } from "events";
|
||||||
import { ALL_RULE_TYPES, EntityType, ListRule, Recommendation, ROOM_RULE_TYPES, RULE_ROOM, RULE_SERVER, RULE_USER, SERVER_RULE_TYPES, USER_RULE_TYPES } from "./ListRule";
|
import { ALL_RULE_TYPES, EntityType, ListRule, Recommendation, ROOM_RULE_TYPES, RULE_ROOM, RULE_SERVER, RULE_USER, SERVER_RULE_TYPES, USER_RULE_TYPES } from "./ListRule";
|
||||||
import { MatrixSendClient } from "../MatrixEmitter";
|
import { MatrixSendClient } from "../MatrixEmitter";
|
||||||
|
@ -176,6 +176,7 @@ export class DurationMSProtectionSetting extends AbstractProtectionSetting<numbe
|
|||||||
|
|
||||||
fromString(data: string) {
|
fromString(data: string) {
|
||||||
let number = parseDuration(data);
|
let number = parseDuration(data);
|
||||||
|
// @ts-ignore
|
||||||
return isNaN(number) ? undefined : number;
|
return isNaN(number) ? undefined : number;
|
||||||
}
|
}
|
||||||
validate(data: number) {
|
validate(data: number) {
|
||||||
|
@ -63,6 +63,7 @@ export async function registerUser(homeserver: string, username: string, display
|
|||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
let err;
|
let err;
|
||||||
if (ex instanceof Error) {
|
if (ex instanceof Error) {
|
||||||
|
// @ts-ignore - objectively this works, a temp hack anyway
|
||||||
err = ex.body.errcode
|
err = ex.body.errcode
|
||||||
} else {
|
} else {
|
||||||
err = ex.errcode
|
err = ex.errcode
|
||||||
|
Loading…
Reference in New Issue
Block a user