Log conversation data when syncing (ref #6)

This commit is contained in:
Tulir Asokan 2023-08-02 14:37:01 +03:00
parent 107f164180
commit 7618afed7f
2 changed files with 5 additions and 1 deletions

View file

@ -724,7 +724,6 @@ func (portal *Portal) SyncParticipants(source *User, metadata *gmproto.Conversat
} else { } else {
manyParticipants = true manyParticipants = true
} }
portal.zlog.Trace().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 { if puppet == nil {
portal.zlog.Error().Any("participant_id", participant.ID).Msg("Failed to get puppet for participant") portal.zlog.Error().Any("participant_id", participant.ID).Msg("Failed to get puppet for participant")

View file

@ -28,6 +28,7 @@ import (
"time" "time"
"github.com/rs/zerolog" "github.com/rs/zerolog"
"google.golang.org/protobuf/proto"
"maunium.net/go/maulogger/v2" "maunium.net/go/maulogger/v2"
"maunium.net/go/maulogger/v2/maulogadapt" "maunium.net/go/maulogger/v2/maulogadapt"
"maunium.net/go/mautrix" "maunium.net/go/mautrix"
@ -795,9 +796,13 @@ func (user *User) Logout(state status.BridgeState, unpair bool) (logoutOK bool)
func (user *User) syncConversation(v *gmproto.Conversation) { func (user *User) syncConversation(v *gmproto.Conversation) {
updateType := v.GetStatus() updateType := v.GetStatus()
portal := user.GetPortalByID(v.GetConversationID()) portal := user.GetPortalByID(v.GetConversationID())
convCopy := proto.Clone(v).(*gmproto.Conversation)
convCopy.LatestMessage = nil
log := portal.zlog.With(). log := portal.zlog.With().
Str("action", "sync conversation"). Str("action", "sync conversation").
Str("conversation_status", updateType.String()). Str("conversation_status", updateType.String()).
Str("room_id", portal.MXID.String()).
Interface("conversation_data", convCopy).
Logger() Logger()
if portal.MXID != "" { if portal.MXID != "" {
switch updateType { switch updateType {