Fix some bugs
This commit is contained in:
parent
e0df07e384
commit
d7d1abc3b7
3 changed files with 11 additions and 2 deletions
|
@ -726,6 +726,10 @@ func (portal *Portal) SyncParticipants(source *User, metadata *gmproto.Conversat
|
||||||
}
|
}
|
||||||
portal.zlog.Debug().Interface("participant", participant).Msg("Syncing participant")
|
portal.zlog.Debug().Interface("participant", participant).Msg("Syncing participant")
|
||||||
puppet := source.GetPuppetByID(participant.ID.ParticipantID, participant.ID.Number)
|
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)
|
userIDs = append(userIDs, puppet.MXID)
|
||||||
puppet.Sync(source, participant)
|
puppet.Sync(source, participant)
|
||||||
if portal.MXID != "" {
|
if portal.MXID != "" {
|
||||||
|
|
|
@ -140,8 +140,12 @@ func (br *GMBridge) NewPuppet(dbPuppet *database.Puppet) *Puppet {
|
||||||
return &Puppet{
|
return &Puppet{
|
||||||
Puppet: dbPuppet,
|
Puppet: dbPuppet,
|
||||||
bridge: br,
|
bridge: br,
|
||||||
log: br.ZLog.With().Str("phone", dbPuppet.Phone).Int("puppet_receiver", dbPuppet.Receiver).Logger(),
|
log: br.ZLog.With().
|
||||||
MXID: br.FormatPuppetMXID(dbPuppet.Key),
|
Str("phone", dbPuppet.Phone).
|
||||||
|
Str("puppet_id", dbPuppet.ID).
|
||||||
|
Int("puppet_receiver", dbPuppet.Receiver).
|
||||||
|
Logger(),
|
||||||
|
MXID: br.FormatPuppetMXID(dbPuppet.Key),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
user.go
1
user.go
|
@ -537,6 +537,7 @@ func (user *User) DeleteConnection() {
|
||||||
defer user.connLock.Unlock()
|
defer user.connLock.Unlock()
|
||||||
user.unlockedDeleteConnection()
|
user.unlockedDeleteConnection()
|
||||||
user.longPollingError = errors.New("not connected")
|
user.longPollingError = errors.New("not connected")
|
||||||
|
user.phoneResponding = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (user *User) HasSession() bool {
|
func (user *User) HasSession() bool {
|
||||||
|
|
Loading…
Reference in a new issue