Fixes duplicated transmissions and not working undo of like/dislike

This commit is contained in:
Michael 2018-10-27 11:09:23 +00:00
parent f2ddcbe632
commit 73f596cc46
7 changed files with 30 additions and 43 deletions

View file

@ -549,15 +549,19 @@ class Transmitter
* Creates the activity or fetches it from the cache
*
* @param integer $item_id
* @param boolean $force Force new cache entry
*
* @return array with the activity
*/
public static function createCachedActivityFromItem($item_id)
public static function createCachedActivityFromItem($item_id, $force = false)
{
$cachekey = 'APDelivery:createActivity:' . $item_id;
$data = Cache::get($cachekey);
if (!is_null($data)) {
return $data;
if (!$force) {
$data = Cache::get($cachekey);
if (!is_null($data)) {
return $data;
}
}
$data = ActivityPub\Transmitter::createActivityFromItem($item_id);