Add preview card storing to the database

This commit is contained in:
kaimanhub 2025-03-30 20:24:15 +03:00
commit 6169351d22
12 changed files with 228 additions and 55 deletions

View file

@ -175,6 +175,24 @@ func (s *Status) EditsPopulated() bool {
return true
}
// CardPopulated returns whether card is
// populated according to current CardID.
func (s *Status) CardPopulated() bool {
if s.CardID == "" {
return true
}
if s.Card == nil {
return false
}
if s.Card.ID != s.CardID {
return false
}
return true
}
// EmojisUpToDate returns whether status emoji attachments of receiving status are up-to-date
// according to emoji attachments of the passed status, by comparing their emoji URIs. We don't
// use IDs as this is used to determine whether there are new emojis to fetch.