diff --git a/portal.go b/portal.go index 793b629..9aa55cb 100644 --- a/portal.go +++ b/portal.go @@ -726,6 +726,10 @@ func (portal *Portal) SyncParticipants(source *User, metadata *gmproto.Conversat } portal.zlog.Debug().Interface("participant", participant).Msg("Syncing participant") puppet := source.GetPuppetByID(participant.ID.ParticipantID, participant.ID.Number) + if puppet == nil { + portal.zlog.Error().Any("participant_id", participant.ID).Msg("Failed to get puppet for participant") + continue + } userIDs = append(userIDs, puppet.MXID) puppet.Sync(source, participant) if portal.MXID != "" { diff --git a/puppet.go b/puppet.go index 134afb5..15f3368 100644 --- a/puppet.go +++ b/puppet.go @@ -140,8 +140,12 @@ func (br *GMBridge) NewPuppet(dbPuppet *database.Puppet) *Puppet { return &Puppet{ Puppet: dbPuppet, bridge: br, - log: br.ZLog.With().Str("phone", dbPuppet.Phone).Int("puppet_receiver", dbPuppet.Receiver).Logger(), - MXID: br.FormatPuppetMXID(dbPuppet.Key), + log: br.ZLog.With(). + Str("phone", dbPuppet.Phone). + Str("puppet_id", dbPuppet.ID). + Int("puppet_receiver", dbPuppet.Receiver). + Logger(), + MXID: br.FormatPuppetMXID(dbPuppet.Key), } } diff --git a/user.go b/user.go index 37cb03b..556969a 100644 --- a/user.go +++ b/user.go @@ -537,6 +537,7 @@ func (user *User) DeleteConnection() { defer user.connLock.Unlock() user.unlockedDeleteConnection() user.longPollingError = errors.New("not connected") + user.phoneResponding = true } func (user *User) HasSession() bool {