mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Prepare Dislike/Flag/View fixes
For now we Create these activities, but we should just send them directly. This fix handles correctly direct Dislikes/Flags/Views, we'll implement the sending correctly these activities in the next peertube version
This commit is contained in:
parent
44b9c0ba31
commit
848f499def
30 changed files with 330 additions and 755 deletions
|
@ -26,6 +26,10 @@ async function processUndoActivity (activity: ActivityUndo, byActor: ActorModel)
|
|||
}
|
||||
}
|
||||
|
||||
if (activityToUndo.type === 'Dislike') {
|
||||
return retryTransactionWrapper(processUndoDislike, byActor, activity)
|
||||
}
|
||||
|
||||
if (activityToUndo.type === 'Follow') {
|
||||
return retryTransactionWrapper(processUndoFollow, byActor, activityToUndo)
|
||||
}
|
||||
|
@ -72,7 +76,9 @@ async function processUndoLike (byActor: ActorModel, activity: ActivityUndo) {
|
|||
}
|
||||
|
||||
async function processUndoDislike (byActor: ActorModel, activity: ActivityUndo) {
|
||||
const dislike = activity.object.object as DislikeObject
|
||||
const dislike = activity.object.type === 'Dislike'
|
||||
? activity.object
|
||||
: activity.object.object as DislikeObject
|
||||
|
||||
const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: dislike.object })
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue