mx-puppet-bridge
Advanced tools
Comparing version 0.0.35-4 to 0.0.35-5
@@ -241,3 +241,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const roomParts = yield this.bridge.roomSync.resolve(ident); | ||
const roomParts = yield this.bridge.roomSync.resolve(ident, userId); | ||
if (!roomParts) { | ||
@@ -267,3 +267,3 @@ return false; | ||
const ADMIN_POWER_LEVEL = 100; | ||
const roomParts = yield this.bridge.roomSync.resolve(ident); | ||
const roomParts = yield this.bridge.roomSync.resolve(ident, userId); | ||
if (!roomParts) { | ||
@@ -292,3 +292,3 @@ throw new Error("Room not resolvable"); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const roomParts = yield this.bridge.roomSync.resolve(ident); | ||
const roomParts = yield this.bridge.roomSync.resolve(ident, userId); | ||
if (!roomParts) { | ||
@@ -295,0 +295,0 @@ return false; |
@@ -26,3 +26,3 @@ import { PuppetBridge } from "./puppetbridge"; | ||
deleteForPuppet(puppetId: number): Promise<void>; | ||
resolve(str: RemoteRoomResolvable): Promise<IRemoteRoom | null>; | ||
resolve(str: RemoteRoomResolvable, sender?: string): Promise<IRemoteRoom | null>; | ||
private giveOp; | ||
@@ -29,0 +29,0 @@ private removeGhostsFromRoom; |
@@ -578,3 +578,3 @@ "use strict"; | ||
} | ||
resolve(str) { | ||
resolve(str, sender) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -585,6 +585,12 @@ const remoteUserToGroup = (ident) => __awaiter(this, void 0, void 0, function* () { | ||
} | ||
const parts = yield this.bridge.userSync.resolve(ident); | ||
let parts = yield this.bridge.userSync.resolve(ident); | ||
if (!parts) { | ||
return null; | ||
} | ||
if (sender) { | ||
parts = yield this.bridge.namespaceHandler.getRemoteUser(parts, sender); | ||
if (!parts) { | ||
return null; | ||
} | ||
} | ||
const maybeRoomId = yield this.bridge.hooks.getDmRoomId(parts); | ||
@@ -591,0 +597,0 @@ if (!maybeRoomId) { |
@@ -164,3 +164,3 @@ "use strict"; | ||
const res2 = res ? 1 : 0; | ||
if (res1 ^ res2) { | ||
if (res1 ^ res2) { // tslint:disable-line no-bitwise | ||
return result || res; | ||
@@ -167,0 +167,0 @@ } |
{ | ||
"name": "mx-puppet-bridge", | ||
"version": "0.0.35-4", | ||
"version": "0.0.35-5", | ||
"description": "Matrix Puppeting Bridge library", | ||
@@ -30,3 +30,3 @@ "repository": { | ||
"markdown-it": "^9.1.0", | ||
"matrix-bot-sdk": "git+https://github.com/Sorunome/matrix-js-bot-sdk.git#b1ee59aef5809d949f272f65aae23a05908d76d4", | ||
"matrix-bot-sdk": "git+https://github.com/Sorunome/matrix-js-bot-sdk.git#8259b9e470469b243666f420e6cf972758694bbb", | ||
"pg-promise": "^8.7.5", | ||
@@ -33,0 +33,0 @@ "request": "^2.88.2", |
@@ -22,2 +22,4 @@ [Support Chat](https://matrix.to/#/#mx-puppet-bridge:sorunome.de) [![donate](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/Sorunome/donate) | ||
- [Twitter](https://github.com/Sorunome/mx-puppet-twitter) | ||
- [voip.ms](https://github.com/zoenb/mx-puppet-voipms) | ||
- [Skype](https://github.com/Sorunome/mx-puppet-skype) | ||
@@ -24,0 +26,0 @@ ## Docs |
@@ -233,3 +233,3 @@ /* | ||
public async unbridge(userId: string, ident: RemoteRoomResolvable): Promise<boolean> { | ||
const roomParts = await this.bridge.roomSync.resolve(ident); | ||
const roomParts = await this.bridge.roomSync.resolve(ident, userId); | ||
if (!roomParts) { | ||
@@ -258,3 +258,3 @@ return false; | ||
const ADMIN_POWER_LEVEL = 100; | ||
const roomParts = await this.bridge.roomSync.resolve(ident); | ||
const roomParts = await this.bridge.roomSync.resolve(ident, userId); | ||
if (!roomParts) { | ||
@@ -282,3 +282,3 @@ throw new Error("Room not resolvable"); | ||
public async invite(userId: string, ident: RemoteRoomResolvable): Promise<boolean> { | ||
const roomParts = await this.bridge.roomSync.resolve(ident); | ||
const roomParts = await this.bridge.roomSync.resolve(ident, userId); | ||
if (!roomParts) { | ||
@@ -285,0 +285,0 @@ return false; |
@@ -615,3 +615,3 @@ /* | ||
public async resolve(str: RemoteRoomResolvable): Promise<IRemoteRoom | null> { | ||
public async resolve(str: RemoteRoomResolvable, sender?: string): Promise<IRemoteRoom | null> { | ||
const remoteUserToGroup = async (ident: RemoteUserResolvable): Promise<IRemoteRoom | null> => { | ||
@@ -621,6 +621,12 @@ if (!this.bridge.hooks.getDmRoomId) { | ||
} | ||
const parts = await this.bridge.userSync.resolve(ident); | ||
let parts = await this.bridge.userSync.resolve(ident); | ||
if (!parts) { | ||
return null; | ||
} | ||
if (sender) { | ||
parts = await this.bridge.namespaceHandler.getRemoteUser(parts, sender); | ||
if (!parts) { | ||
return null; | ||
} | ||
} | ||
const maybeRoomId = await this.bridge.hooks.getDmRoomId(parts); | ||
@@ -627,0 +633,0 @@ if (!maybeRoomId) { |
@@ -154,3 +154,3 @@ /* | ||
case "=": { | ||
const res = StringFormatter.condition(pattern.substr(i+1), vars); | ||
const res = StringFormatter.condition(pattern.substr(i + 1), vars); | ||
if (res === result) { | ||
@@ -165,3 +165,3 @@ return res; | ||
} | ||
return StringFormatter.condition(pattern.substr(i+1), vars); | ||
return StringFormatter.condition(pattern.substr(i + 1), vars); | ||
} | ||
@@ -172,9 +172,9 @@ case "&": { | ||
} | ||
return StringFormatter.condition(pattern.substr(i+1), vars); | ||
return StringFormatter.condition(pattern.substr(i + 1), vars); | ||
} | ||
case "^": { | ||
const res = StringFormatter.condition(pattern.substr(i+1), vars); | ||
const res = StringFormatter.condition(pattern.substr(i + 1), vars); | ||
const res1 = result ? 1 : 0; | ||
const res2 = res ? 1 : 0; | ||
if (res1 ^ res2) { | ||
if (res1 ^ res2) { // tslint:disable-line no-bitwise | ||
return result || res; | ||
@@ -181,0 +181,0 @@ } |
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
737372
18958
85