mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Ensure user is registered and joined
This commit is contained in:
parent
445a033e71
commit
13108cd51c
@ -233,8 +233,9 @@ export class GithubBridge {
|
||||
return;
|
||||
}
|
||||
log.info(`Bridge bot joined ${roomId}`);
|
||||
const bridgeStateEvents: IBridgeRoomState[] =
|
||||
(await this.as.botClient.getRoomState(roomId)).filter((ev) =>
|
||||
const stateEvs = await this.as.botClient.getRoomState(roomId);
|
||||
console.log(stateEvs);
|
||||
const bridgeStateEvents: IBridgeRoomState[] = stateEvs.filter((ev) =>
|
||||
ev.type === BRIDGE_STATE_TYPE,
|
||||
);
|
||||
|
||||
|
@ -48,6 +48,7 @@ export class MatrixSender {
|
||||
|
||||
public async sendMatrixMessage(messageId: string, msg: IMatrixSendMessage) {
|
||||
const intent = msg.sender ? this.as.getIntentForUserId(msg.sender) : this.as.botIntent;
|
||||
await intent.ensureRegisteredAndJoined(msg.roomId);
|
||||
const eventId = await intent.underlyingClient.sendEvent(msg.roomId, msg.type, msg.content);
|
||||
log.info("Sent", eventId);
|
||||
await this.mq.push<IMatrixSendMessageResponse>({
|
||||
|
Loading…
x
Reference in New Issue
Block a user