From 4bbeb224f67848cbdd4b07ed4f90341e0a6460c9 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 29 Feb 2024 21:11:39 +0000 Subject: more cleanup --- Zotlabs/Module/Like.php | 21 ++++++++++++--------- Zotlabs/Module/Profile_photo.php | 1 - Zotlabs/Widget/Messages.php | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'Zotlabs') 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']), diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index 8601a7508..dc47d213b 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -269,7 +269,6 @@ class Profile_photo extends Controller { // Update directory in background Master::Summon(['Directory', $channel['channel_id']]); - } else notice(t('Unable to process image') . EOL); diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index 519bb27fe..0ddbebbcc 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -85,7 +85,7 @@ class Messages { } if($author) { - $author_sql = " AND (i.owner_xchan = '" . protect_sprintf(dbesc($author)) . "' OR i.source_xchan = '" . protect_sprintf(dbesc($author)) . "') "; + $author_sql = " AND (i.owner_xchan = '" . protect_sprintf(dbesc($author)) . "') "; } switch($type) { -- cgit v1.2.3