mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 09:35:11 +00:00
Merge branch 'master' of /home/macgirvin/zap.macgirvin.com into zap
This commit is contained in:
commit
edb22f9244
3 changed files with 26 additions and 8 deletions
|
@ -1403,7 +1403,7 @@ class Activity {
|
|||
$s['edited'] = $s['created'];
|
||||
|
||||
if(in_array($act->type,['Announce'])) {
|
||||
$announced_actor = ((isset($act->obj['actor'])) ? $act->obj['actor'] : ActivityStreams::get_actor('attributedTo', $act['obj']));
|
||||
$announced_actor = ((isset($act->obj['actor'])) ? $act->obj['actor'] : ActivityStreams::get_actor('attributedTo', $act->obj));
|
||||
if(! $announced_actor) {
|
||||
return [];
|
||||
}
|
||||
|
|
|
@ -436,7 +436,6 @@ class Like extends \Zotlabs\Web\Controller {
|
|||
|
||||
call_hooks('post_local',$arr);
|
||||
|
||||
|
||||
$post = item_store($arr);
|
||||
$post_id = $post['item_id'];
|
||||
|
||||
|
@ -449,6 +448,14 @@ class Like extends \Zotlabs\Web\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($ch[0]['channel_id'], [ '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')",
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use App;
|
||||
use Zotlabs\Daemon\Master;
|
||||
use Zotlabs\Lib\Libsync;
|
||||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
|
@ -18,9 +22,9 @@ class Share extends \Zotlabs\Web\Controller {
|
|||
killme();
|
||||
}
|
||||
|
||||
$observer = \App::get_observer();
|
||||
$observer = App::get_observer();
|
||||
|
||||
$channel = \App::get_channel();
|
||||
$channel = App::get_channel();
|
||||
|
||||
|
||||
$r = q("SELECT * from item left join xchan on author_xchan = xchan_hash WHERE id = %d LIMIT 1",
|
||||
|
@ -110,11 +114,18 @@ class Share extends \Zotlabs\Web\Controller {
|
|||
|
||||
call_hooks('post_local_end', $arr);
|
||||
|
||||
info(t('Repeated and shared') . EOL);
|
||||
info( t('Post repeated') . EOL);
|
||||
|
||||
// fixme: sync to clones
|
||||
$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($channel['channel_id'], [ 'item' => [ encode_item($sync_item[0],true) ] ]);
|
||||
}
|
||||
|
||||
\Zotlabs\Daemon\Master::Summon(array('Notifier','like',$post_id));
|
||||
Master::Summon([ 'Notifier','like',$post_id ]);
|
||||
|
||||
killme();
|
||||
|
||||
|
|
Loading…
Reference in a new issue