feat(nest): @-addressing, addressed-crow-must-respond, deliver back to requester (#11)

This commit is contained in:
Smokey committed 2026-10-28 04:53:53 -06:00
1 parent a37e34cc9a
commit 4cfe9df6ba
5 files changed
+143 -21

No files matched your search

+14
View File
@@ -102,6 +102,20 @@ func (s *MessageStore) After(nestID string, lastID int) []Message {
// All returns every message in a nest, oldest first.
func (s *MessageStore) All(nestID string) []Message { return s.After(nestID, 0) }
// ByMsgID finds one stored message by its "<nest_id>-<n>" id.
func (s *MessageStore) ByMsgID(msgID string) (Message, bool) {
s.mu.Lock()
defer s.mu.Unlock()
for _, msgs := range s.log {
for _, m := range msgs {
if m.MsgID() == msgID {
return m, true
}
}
}
return Message{}, false
}
func (s *MessageStore) save(nestID string) error {
if err := os.MkdirAll(s.dir, 0o755); err != nil {
return err