Store Messages and Send when Online #553

Merged
sarah merged 2 commits from offline-messages into master 2024-04-16 18:35:02 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit e55f342324 - Show all commits

View File

@ -47,7 +47,7 @@ func (soe SendWhenOnlineExtension) OnEvent(ev event.Event, profile peer.CwtchPee
ev := event.NewEvent(event.SendMessageToPeer, map[event.Field]string{event.ConversationID: strconv.Itoa(ci.ID), event.RemotePeer: ci.Handle, event.Data: body})
ev.EventID = message.Signature // we need this ensure that we correctly ack this in the db when it comes back
// TODO: The EventBus is becoming very noisy...we may want to consider a one-way shortcut to Engine i.e. profile.Engine.SendMessageToPeer
sarah marked this conversation as resolved
Review

FWIW engine is the only thing subbed to this message? so its prlly fine?

FWIW engine is the only thing subbed to this message? so its prlly fine?
Review

i mean the event bus itself it becoming clogged, generally for forward feeding messages Peer->Engine we only have 1 sub so replacing with an actual function call relieves some of the pressure that we get.

i mean the event bus itself it becoming clogged, generally for forward feeding messages Peer->Engine we only have 1 sub so replacing with an actual function call relieves some of the pressure that we get.
log.Infof("resending message that was sent when peer was offline")
log.Debugf("resending message that was sent when peer was offline")
profile.PublishEvent(ev)
}
}

View File

@ -58,7 +58,7 @@ func TestFileSharing(t *testing.T) {
os.RemoveAll("cwtch.out.png")
os.RemoveAll("cwtch.out.png.manifest")
log.SetLevel(log.LevelInfo)
log.SetLevel(log.LevelDebug)
log.ExcludeFromPattern("tapir")
os.Mkdir("tordir", 0700)