Better event comments
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2021-03-24 13:16:50 -07:00
parent 044f726ae4
commit 5881fd459c
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import (
"sync" "sync"
) )
// Events are the core struct passed around between various subsystems, they consist of a type which can be // Event is the core struct type passed around between various subsystems. Events consist of a type which can be
// filtered on, an event ID for tracing and a map of Fields to string values. // filtered on, an event ID for tracing and a map of Fields to string values.
type Event struct { type Event struct {
EventType Type EventType Type

View File

@ -383,7 +383,7 @@ func (ps *ProfileStoreV1) eventHandler() {
log.Errorf("error storing new group invite: %v (%v)", err, ev) log.Errorf("error storing new group invite: %v (%v)", err, ev)
} }
case event.SendMessageToPeer: // cache the message till an ack, then it's given to stream store. case event.SendMessageToPeer: // cache the message till an ack, then it's given to stream store.
// stream store doesn't support updates, so we don't want to commit it till ack'd // stream store doesn't support updates, so we don't want to commit it till ack'd
ps.profile.AddSentMessageToContactTimeline(ev.Data[event.RemotePeer], ev.Data[event.Data], time.Now(), ev.EventID) ps.profile.AddSentMessageToContactTimeline(ev.Data[event.RemotePeer], ev.Data[event.Data], time.Now(), ev.EventID)
case event.NewMessageFromPeer: case event.NewMessageFromPeer:
ps.attemptSavePeerMessage(ev.Data[event.RemotePeer], ev.Data[event.Data], ev.Data[event.TimestampReceived], true) ps.attemptSavePeerMessage(ev.Data[event.RemotePeer], ev.Data[event.Data], ev.Data[event.TimestampReceived], true)