aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Like.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-02-29 21:11:39 +0000
committerMario <mario@mariovavti.com>2024-02-29 21:11:39 +0000
commit4bbeb224f67848cbdd4b07ed4f90341e0a6460c9 (patch)
treee5175bdbb2e3610b545df6ca9650845aaee6f5e4 /Zotlabs/Module/Like.php
parent8435d9eb1305d9678ef730c5a4924769b830e7d2 (diff)
downloadvolse-hubzilla-4bbeb224f67848cbdd4b07ed4f90341e0a6460c9.tar.gz
volse-hubzilla-4bbeb224f67848cbdd4b07ed4f90341e0a6460c9.tar.bz2
volse-hubzilla-4bbeb224f67848cbdd4b07ed4f90341e0a6460c9.zip
more cleanup
Diffstat (limited to 'Zotlabs/Module/Like.php')
-rw-r--r--Zotlabs/Module/Like.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php
index 4c9828b2c..86ae48365 100644
--- a/Zotlabs/Module/Like.php
+++ b/Zotlabs/Module/Like.php
@@ -322,6 +322,8 @@ class Like extends Controller {
// parent, copy that as well.
if ($r) {
+ $obj_type = $r[0]['obj_type'];
+
if ($r[0]['uid'] === $sys_channel['channel_id'] && local_channel()) {
$r = [copy_of_pubitem(App::get_channel(), $r[0]['mid'])];
}
@@ -432,7 +434,7 @@ class Like extends Controller {
}
}
- $uuid = item_message_id();
+ $uuid = new_uuid();
$arr = array();
@@ -445,17 +447,17 @@ class Like extends Controller {
$arr['item_wall'] = 1;
}
else {
- switch ($item['resource_type']) {
- case 'photo':
- $obj_type = 'Image';
- $post_type = t('photo');
+ switch ($item['object_type']) {
+ case 'Image':
+ $post_type = t('image');
break;
- case 'event':
- $obj_type = 'Invite';
+ case 'Invite':
$post_type = t('event');
break;
+ case 'Profile':
+ $post_type = t('profile');
+ break;
default:
- $obj_type = 'Note';
$post_type = t('status');
break;
}
@@ -527,7 +529,7 @@ class Like extends Controller {
if ($obj_type === 'thing' && $r[0]['imgurl']) {
$arr['body'] .= "\n\n[zmg=80x80]" . $r[0]['imgurl'] . '[/zmg]';
}
- if ($obj_type === 'profile') {
+ if ($obj_type === 'Profile') {
if ($public) {
$arr['body'] .= "\n\n" . '[embed]' . z_root() . '/profile/' . $ch[0]['channel_address'] . '[/embed]';
}
@@ -581,6 +583,7 @@ class Like extends Controller {
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']),