Log incoming message metadata before processing it

This commit is contained in:
Tulir Asokan 2023-08-24 14:34:45 +03:00
parent c0fe4a16df
commit 2ec1dcda6c

View file

@ -604,6 +604,14 @@ func (user *User) syncHandleEvent(event any) {
case *gmproto.Conversation: case *gmproto.Conversation:
go user.syncConversation(v, "event") go user.syncConversation(v, "event")
case *gmproto.Message: case *gmproto.Message:
user.zlog.Debug().
Str("conversation_id", v.GetConversationID()).
Str("participant_id", v.GetParticipantID()).
Str("message_id", v.GetMessageID()).
Str("message_status", v.GetMessageStatus().GetStatus().String()).
Int64("message_ts", v.GetTimestamp()).
Str("tmp_id", v.GetTmpID()).
Msg("Received message")
portal := user.GetPortalByID(v.GetConversationID()) portal := user.GetPortalByID(v.GetConversationID())
portal.messages <- PortalMessage{evt: v, source: user} portal.messages <- PortalMessage{evt: v, source: user}
case *gmproto.UserAlertEvent: case *gmproto.UserAlertEvent: