mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-02 20:58:07 -06:00
federate status deletes properly
This commit is contained in:
parent
5d2b69c256
commit
197ef03ead
19 changed files with 154 additions and 143 deletions
|
|
@ -334,27 +334,31 @@ func (t *timeline) Remove(statusID string) error {
|
|||
t.Lock()
|
||||
defer t.Unlock()
|
||||
|
||||
// remove the entry from the post index
|
||||
for e := t.postIndex.data.Front(); e != nil; e = e.Next() {
|
||||
entry, ok := e.Value.(*postIndexEntry)
|
||||
if !ok {
|
||||
return errors.New("Remove: could not parse e as a postIndexEntry")
|
||||
}
|
||||
if entry.statusID == statusID {
|
||||
t.postIndex.data.Remove(e)
|
||||
break // bail once we found and removed it
|
||||
if t.postIndex != nil && t.postIndex.data != nil {
|
||||
// remove the entry from the post index
|
||||
for e := t.postIndex.data.Front(); e != nil; e = e.Next() {
|
||||
entry, ok := e.Value.(*postIndexEntry)
|
||||
if !ok {
|
||||
return errors.New("Remove: could not parse e as a postIndexEntry")
|
||||
}
|
||||
if entry.statusID == statusID {
|
||||
t.postIndex.data.Remove(e)
|
||||
break // bail once we found and removed it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove the entry from prepared posts
|
||||
for e := t.preparedPosts.data.Front(); e != nil; e = e.Next() {
|
||||
entry, ok := e.Value.(*preparedPostsEntry)
|
||||
if !ok {
|
||||
return errors.New("Remove: could not parse e as a preparedPostsEntry")
|
||||
}
|
||||
if entry.statusID == statusID {
|
||||
t.preparedPosts.data.Remove(e)
|
||||
break // bail once we found and removed it
|
||||
if t.preparedPosts != nil && t.preparedPosts.data != nil {
|
||||
for e := t.preparedPosts.data.Front(); e != nil; e = e.Next() {
|
||||
entry, ok := e.Value.(*preparedPostsEntry)
|
||||
if !ok {
|
||||
return errors.New("Remove: could not parse e as a preparedPostsEntry")
|
||||
}
|
||||
if entry.statusID == statusID {
|
||||
t.preparedPosts.data.Remove(e)
|
||||
break // bail once we found and removed it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue