This commit is contained in:
1 parent
46993aaef4
commit
5ff45f355a
2 files changed
+24
No files matched your search
+13
@@ -119,6 +119,19 @@ func (s *MessageStore) ByMsgID(msgID string) (Message, bool) {
|
||||
return Message{}, false
|
||||
}
|
||||
|
||||
// FirstClaim returns the author of the first claim against a message, and
|
||||
// whether any claim exists.
|
||||
func (s *MessageStore) FirstClaim(nestID, referentID string) (string, bool) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
for _, m := range s.log[nestID] {
|
||||
if m.Kind == "claim" && m.RefersTo == referentID {
|
||||
return m.Author, true
|
||||
}
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
func (s *MessageStore) save(nestID string) error {
|
||||
if err := os.MkdirAll(s.dir, 0o755); err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user