Skip to content

Commit

Permalink
requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay committed Sep 18, 2024
1 parent 63510e9 commit 829c957
Show file tree
Hide file tree
Showing 8 changed files with 1,049 additions and 1,108 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@sentry/node": "^7.17.2",
"@sentry/tracing": "^7.17.2",
"@tensorflow/tfjs-node": "^4.21.0",
"@vector-im/matrix-bot-sdk": "^0.7.1-element.0",
"await-lock": "^2.2.2",
"body-parser": "^1.20.1",
"config": "^3.3.8",
Expand All @@ -63,8 +64,7 @@
"prom-client": "^14.1.0",
"shell-quote": "^1.7.3",
"ulidx": "^0.3.0",
"yaml": "^2.2.2",
"@vector-im/matrix-bot-sdk": "^0.7.1-element.0"
"yaml": "^2.2.2"
},
"engines": {
"node": ">=18.0.0"
Expand Down
3 changes: 2 additions & 1 deletion src/appservice/AccessControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export class AccessControl {
const accessControlList = new PolicyList(
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()
);
const accessControlUnit = new AccessControlUnit([accessControlList]);
Expand Down
6 changes: 4 additions & 2 deletions src/appservice/MjolnirManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export class MjolnirManager {
invite: [requestingUserId],
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);
await mjolnir.createFirstList(requestingUserId, "list");

Expand Down Expand Up @@ -183,7 +184,8 @@ export class MjolnirManager {
await this.makeInstance(
mjolnirRecord.owner,
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,
).catch((e: any) => {
log.error(`Could not start mjolnir ${mjolnirRecord.local_part} for ${mjolnirRecord.owner}:`, e);
Expand Down
1 change: 1 addition & 0 deletions src/commands/SinceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ async function execSinceCommandAux(destinationRoomId: string, event: any, mjolni
}

//...or as a duration
// @ts-ignore
maybeMaxAgeMS = parseDuration(source);
if (maybeMaxAgeMS && !Number.isNaN(maybeMaxAgeMS)) {
maybeMaxAgeMS = Math.abs(maybeMaxAgeMS);
Expand Down
9 changes: 8 additions & 1 deletion src/models/PolicyList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ See the License for the specific language governing permissions and
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 { 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";
Expand Down
1 change: 1 addition & 0 deletions src/protections/ProtectionSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export class DurationMSProtectionSetting extends AbstractProtectionSetting<numbe

fromString(data: string) {
let number = parseDuration(data);
// @ts-ignore
return isNaN(number) ? undefined : number;
}
validate(data: number) {
Expand Down
1 change: 1 addition & 0 deletions test/integration/clientHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export async function registerUser(homeserver: string, username: string, display
} catch (ex) {
let err;
if (ex instanceof Error) {
// @ts-ignore - objectively this works, a temp hack anyway
err = ex.body.errcode
} else {
err = ex.errcode
Expand Down
Loading

0 comments on commit 829c957

Please sign in to comment.