[PLUGINS][RepeatNote] Add onFilterNoteList event

Filters repeats out of Conversations, and replaces a repeat with the original Note on Actor feed

Added isNoteRepeat to plugin's entity, which returns true if a given
Note is a repeat of another Note
This commit is contained in:
2021-12-28 17:28:44 +00:00
parent 1d1d169a5c
commit 182c6265a3
2 changed files with 40 additions and 20 deletions

View File

@@ -76,6 +76,16 @@ class NoteRepeat extends Entity
return $this->repeat_of;
}
/**
* @param Note $note
* @return bool Returns true if Note provided is a repeat of another Note
*/
public static function isNoteRepeat(Note $note): bool
{
return DB::count(self::class, ['note_id' => $note->getId()]) > 0;
}
public static function getNoteRepeats(Note $note): array
{
return DB::dql(