likes not synced between clones

This commit is contained in:
Mario Vavti
2023-03-31 09:31:28 +02:00
parent 24568c0e2f
commit 5ec721b978

View File

@@ -407,12 +407,20 @@ class Like extends Controller {
if (activity_match($rr['verb'], $activity))
$multi_undo = false;
$d = q("select * from item where id = %d",
intval($rr['id'])
);
if ($d) {
xchan_query($d);
$sync_item = fetch_post_tags($d);
Libsync::build_sync_packet($profile_uid, ['item' => [encode_item($sync_item[0], true)]]);
}
// drop_item was not done interactively, so we need to invoke the notifier
// in order to push the changes to connections
Master::Summon(array('Notifier', 'drop', $rr['id']));
}
if ($interactive)
@@ -562,6 +570,15 @@ class Like extends Controller {
call_hooks('post_local_end', $arr);
$r = q("select * from item where id = %d",
intval($post_id)
);
if ($r) {
xchan_query($r);
$sync_item = fetch_post_tags($r);
Libsync::build_sync_packet($profile_uid, ['item' => [encode_item($sync_item[0], true)]]);
}
if ($extended_like) {
$r = q("insert into likes (channel_id,liker,likee,iid,i_mid,verb,target_type,target_id,target) values (%d,'%s','%s',%d,'%s','%s','%s','%s','%s')",
intval($ch[0]['channel_id']),