Double puppet support

This commit is contained in:
Gary Kramlich
2022-02-18 03:52:07 -06:00
parent c6be694106
commit dc3bdc2cec
15 changed files with 728 additions and 77 deletions

View File

@@ -232,11 +232,16 @@ func (p *Portal) createMatrixRoom(user *User, channel *discordgo.Channel) error
p.bridge.portalsByMXID[p.MXID] = p
p.bridge.portalsLock.Unlock()
p.log.Debugln("inviting user", user)
p.ensureUserInvited(user)
user.syncChatDoublePuppetDetails(p, true)
p.syncParticipants(user, channel.Recipients)
if p.IsPrivateChat() {
p.syncParticipants(user, channel.Recipients)
puppet := user.bridge.GetPuppetByID(p.Key.Receiver)
chats := map[id.UserID][]id.RoomID{puppet.MXID: {p.MXID}}
user.updateDirectChats(chats)
}
firstEventResp, err := p.MainIntent().SendMessageEvent(p.MXID, portalCreationDummyEvent, struct{}{})