mirror of
https://github.com/friendica/friendica
synced 2025-04-29 09:04:24 +02:00
Fixes duplicated transmissions and not working undo of like/dislike
This commit is contained in:
parent
f2ddcbe632
commit
73f596cc46
7 changed files with 30 additions and 43 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue