From 2a287e6def5ab54037222c963ab0875faf62fc1a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 14 Jan 2020 13:29:45 -0800 Subject: event compatibility work --- Zotlabs/Module/Like.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Like.php') diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index 052d51d43..ff7554b7e 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -75,7 +75,12 @@ class Like extends \Zotlabs\Web\Controller { return EMPTY_STR; } - + $is_rsvp = false; + if (in_array($activity, [ ACTVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE ])) { + $is_rsvp = true; + } + + $extended_like = false; $object = $target = null; $post_type = EMPTY_STR; @@ -381,7 +386,7 @@ class Like extends \Zotlabs\Web\Controller { $arr = array(); $arr['uuid'] = $uuid; - $arr['mid'] = z_root() . '/item/' . $uuid; + $arr['mid'] = z_root() . (($is_rsvp) ? '/activity/' : '/item/') . $uuid; if($extended_like) { $arr['item_thread_top'] = 1; -- cgit v1.2.3 From ccaa93655a6b44834d04c536d809c4b2c69c354b Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 15 Jan 2020 09:48:10 +0000 Subject: fix typo --- Zotlabs/Module/Like.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module/Like.php') diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index ff7554b7e..e4636a4a6 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -76,7 +76,7 @@ class Like extends \Zotlabs\Web\Controller { } $is_rsvp = false; - if (in_array($activity, [ ACTVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE ])) { + if (in_array($activity, [ ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE ])) { $is_rsvp = true; } -- cgit v1.2.3 From 328685d2fbe505fd5b1bf9892a0cce993210ac52 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 9 Apr 2020 09:38:36 +0000 Subject: move from build_sync_packet() to Libsync::build_sync_packet() --- Zotlabs/Module/Like.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Like.php') diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index e4636a4a6..61f73bfd5 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module; use Zotlabs\Lib\Activity; +use Zotlabs\Lib\Libsync; require_once('include/security.php'); require_once('include/bbcode.php'); @@ -235,7 +236,7 @@ class Like extends \Zotlabs\Web\Controller { if($z) { $z[0]['deleted'] = 1; - build_sync_packet($ch[0]['channel_id'],array('likes' => $z)); + Libsync::build_sync_packet($ch[0]['channel_id'],array('likes' => $z)); q("delete from likes where id = %d", intval($z[0]['id']) @@ -566,7 +567,7 @@ class Like extends \Zotlabs\Web\Controller { dbesc($obj_id) ); if($r) - build_sync_packet($ch[0]['channel_id'],array('likes' => $r)); + Libsync::build_sync_packet($ch[0]['channel_id'],array('likes' => $r)); } -- cgit v1.2.3 From ce77f82966d921e144e84506374875dec8965127 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 13 Jul 2020 20:52:15 +0000 Subject: more zot6 --- Zotlabs/Module/Like.php | 39 ++++----------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) (limited to 'Zotlabs/Module/Like.php') diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index 61f73bfd5..edd4cfac8 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -210,20 +210,8 @@ class Like extends \Zotlabs\Web\Controller { if(! $plink) $plink = '[zrl=' . z_root() . '/profile/' . $ch[0]['channel_address'] . ']' . $post_type . '[/zrl]'; - $links = array(); - $links[] = array('rel' => 'alternate', 'type' => 'text/html', - 'href' => z_root() . '/profile/' . $ch[0]['channel_address']); - $links[] = array('rel' => 'photo', 'type' => $ch[0]['xchan_photo_mimetype'], - 'href' => $ch[0]['xchan_photo_l']); - - $object = json_encode(array( - 'type' => ACTIVITY_OBJ_PROFILE, - 'title' => $ch[0]['channel_name'], - 'id' => $ch[0]['xchan_url'] . '/' . $ch[0]['xchan_hash'], - 'link' => $links - )); - - + $object = json_encode(Activity::fetch_profile([ 'id' => channel_url($ch[0]) ])); + // second like of the same thing is "undo" for the first like $z = q("select * from likes where channel_id = %d and liker = '%s' and verb = '%s' and target_type = '%s' and target_id = '%s' limit 1", @@ -408,27 +396,8 @@ class Like extends \Zotlabs\Web\Controller { $body = $item['body']; - $object = json_encode(array( - 'type' => $objtype, - 'id' => $item['mid'], - 'asld' => Activity::fetch_item( [ 'id' => $item['mid'] ] ), - 'parent' => (($item['thr_parent']) ? $item['thr_parent'] : $item['parent_mid']), - 'link' => $links, - 'title' => $item['title'], - 'content' => $item['body'], - 'created' => $item['created'], - 'edited' => $item['edited'], - 'author' => array( - 'name' => $item_author['xchan_name'], - 'address' => $item_author['xchan_addr'], - 'guid' => $item_author['xchan_guid'], - 'guid_sig' => $item_author['xchan_guid_sig'], - 'link' => array( - array('rel' => 'alternate', 'type' => 'text/html', 'href' => $item_author['xchan_url']), - array('rel' => 'photo', 'type' => $item_author['xchan_photo_mimetype'], 'href' => $item_author['xchan_photo_m'])), - ), - )); - + $object = json_encode(Activity::fetch_item( [ 'id' => $item['mid'] ])); + if(! intval($item['item_thread_top'])) $post_type = 'comment'; -- cgit v1.2.3 From 3514f805ea93619cb7ea14961974b4d61c36d17d Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 7 Oct 2020 15:38:04 +0000 Subject: more bdi tags --- Zotlabs/Module/Like.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Zotlabs/Module/Like.php') diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index edd4cfac8..8ffa7f66c 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -441,15 +441,15 @@ class Like extends \Zotlabs\Web\Controller { if($extended_like) { - $ulink = '[zrl=' . $ch[0]['xchan_url'] . ']' . $ch[0]['xchan_name'] . '[/zrl]'; - $alink = '[zrl=' . $observer['xchan_url'] . ']' . $observer['xchan_name'] . '[/zrl]'; + $ulink = '[zrl=' . $ch[0]['xchan_url'] . '][bdi]' . $ch[0]['xchan_name'] . '[/bdi][/zrl]'; + $alink = '[zrl=' . $observer['xchan_url'] . '][bdi]' . $observer['xchan_name'] . '[/bdi][/zrl]'; $private = (($public) ? 0 : 1); } else { $arr['parent'] = $item['id']; $arr['thr_parent'] = $item['mid']; - $ulink = '[zrl=' . $item_author['xchan_url'] . ']' . $item_author['xchan_name'] . '[/zrl]'; - $alink = '[zrl=' . $observer['xchan_url'] . ']' . $observer['xchan_name'] . '[/zrl]'; + $ulink = '[zrl=' . $item_author['xchan_url'] . '][bdi]' . $item_author['xchan_name'] . '[/bdi][/zrl]'; + $alink = '[zrl=' . $observer['xchan_url'] . '][bdi]' . $observer['xchan_name'] . '[/bdi][/zrl]'; $plink = '[zrl=' . z_root() . '/display/' . gen_link_id($item['mid']) . ']' . $post_type . '[/zrl]'; $allow_cid = $item['allow_cid']; $allow_gid = $item['allow_gid']; -- cgit v1.2.3