diff --git a/src/IRCBridge.ts b/src/IRCBridge.ts index d230666..dc02055 100644 --- a/src/IRCBridge.ts +++ b/src/IRCBridge.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixClient, MatrixEvent } from "matrix-bot-sdk"; +import {LogService, MatrixClient, MatrixEvent} from "matrix-bot-sdk"; import * as irc from "irc-upd"; import { Auditorium } from "./models/Auditorium"; import { InterestRoom } from "./models/InterestRoom"; @@ -128,7 +128,8 @@ export class IRCBridge { public async plumbChannelToRoom(channel: string, roomId: string) { if (await this.shouldInviteBot(roomId)) { - await this.mxClient.inviteUser(this.config.botUserId, roomId); + //await this.mxClient.inviteUser(this.config.botUserId, roomId); + LogService.info("IRCBridge", `Inviting ${this.config.botUserId}`) } await this.ircClient.join(channel); const result = await this.executeCommand(`plumb ${roomId} ${this.config.serverName} ${channel}`); diff --git a/src/invites.ts b/src/invites.ts index 8035867..21e0a66 100644 --- a/src/invites.ts +++ b/src/invites.ts @@ -80,7 +80,8 @@ export async function resolveIdentifiers(client: ConferenceMatrixClient, people: export async function invitePersonToRoom(client: ConferenceMatrixClient, resolvedPerson: ResolvedPersonIdentifier, roomId: string): Promise { if (resolvedPerson.mxid) { - return await client.inviteUser(resolvedPerson.mxid.trim(), roomId); + //return await client.inviteUser(resolvedPerson.mxid.trim(), roomId); + LogService.info("invites", `Inviting ${resolvedPerson.mxid}`) } if (!resolvedPerson.emails) { @@ -93,16 +94,17 @@ export async function invitePersonToRoom(client: ConferenceMatrixClient, resolve } for (const email of resolvedPerson.emails) { - const idInvite = await client.identityClient.makeEmailInvite(email, roomId); - const content = { - display_name: idInvite.display_name, - // XXX: https://github.com/matrix-org/matrix-doc/issues/2948 - key_validity_url: `${client.identityClient.serverUrl}/_matrix/identity/v2/pubkey/ephemeral/isvalid`, - public_key: idInvite.public_key, - public_keys: idInvite.public_keys, - [RS_3PID_PERSON_ID]: resolvedPerson.person.id, - }; - const stateKey = idInvite.token; // not included in the content - await client.sendStateEvent(roomId, "m.room.third_party_invite", stateKey, content); + // const idInvite = await client.identityClient.makeEmailInvite(email, roomId); + // const content = { + // display_name: idInvite.display_name, + // // XXX: https://github.com/matrix-org/matrix-doc/issues/2948 + // key_validity_url: `${client.identityClient.serverUrl}/_matrix/identity/v2/pubkey/ephemeral/isvalid`, + // public_key: idInvite.public_key, + // public_keys: idInvite.public_keys, + // [RS_3PID_PERSON_ID]: resolvedPerson.person.id, + // }; + // const stateKey = idInvite.token; // not included in the content + // await client.sendStateEvent(roomId, "m.room.third_party_invite", stateKey, content); + LogService.info("invites", `Third-party inviting ${email}`) } }