Skip to content

Commit

Permalink
Merge pull request #96 from matrix-org/hs/fix-gateway-profiles
Browse files Browse the repository at this point in the history
Fix viewing matrix profiles over the gateway
  • Loading branch information
Half-Shot authored Feb 3, 2020
2 parents 17a6800 + d42cce7 commit 2f7231f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/96.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Matrix profiles can now be viewed over the gateway
8 changes: 5 additions & 3 deletions src/xmppjs/XJSInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,15 @@ export class XmppJsInstance extends EventEmitter implements IBifrostInstance {
});
}

public getAccountForJid(aJid: JID): XmppJsAccount|undefined {
log.debug(aJid);
public getAccountForJid(aJid: JID): {mxId: string}|undefined {
const gatewayMxid = this.gateway?.getMatrixIDForJID(`${aJid.local}@${aJid.domain}`, aJid);
if (gatewayMxid) {
return {mxId: gatewayMxid};
}
if (aJid.domain === this.myAddress.domain) {
log.debug(aJid.local, [...this.accounts.keys()]);
return this.accounts.get(aJid.toString());
}
// TODO: Handle MUC based JIDs?
return;
}

Expand Down

0 comments on commit 2f7231f

Please sign in to comment.