diff options
author | Mario <mario@mariovavti.com> | 2024-02-29 21:11:39 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-02-29 21:11:39 +0000 |
commit | 4bbeb224f67848cbdd4b07ed4f90341e0a6460c9 (patch) | |
tree | e5175bdbb2e3610b545df6ca9650845aaee6f5e4 | |
parent | 8435d9eb1305d9678ef730c5a4924769b830e7d2 (diff) | |
download | volse-hubzilla-4bbeb224f67848cbdd4b07ed4f90341e0a6460c9.tar.gz volse-hubzilla-4bbeb224f67848cbdd4b07ed4f90341e0a6460c9.tar.bz2 volse-hubzilla-4bbeb224f67848cbdd4b07ed4f90341e0a6460c9.zip |
more cleanup
-rw-r--r-- | Zotlabs/Module/Like.php | 21 | ||||
-rw-r--r-- | Zotlabs/Module/Profile_photo.php | 1 | ||||
-rw-r--r-- | Zotlabs/Widget/Messages.php | 2 | ||||
-rw-r--r-- | include/activities.php | 11 | ||||
-rw-r--r-- | include/channel.php | 3 |
5 files changed, 20 insertions, 18 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']), 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) { diff --git a/include/activities.php b/include/activities.php index 7bf808dbb..c06a8f6c4 100644 --- a/include/activities.php +++ b/include/activities.php @@ -55,15 +55,14 @@ function profile_activity($changed, $value) { if ($photo) { $value = "\n\n" . '[zmg=' . z_root() . '/photo/' . $value . '-' . $photo_size . ']' . $ch . ' ' . $channel['xchan_name'] . '[/zmg]'; } - - $message = sprintf(t('%1$s\'s %2$s has been updated to %3$s'), $channel_link, $changes, $value); - - if (!$photo) { - $message .= "\n\n" . sprintf(t('Visit %1$s\'s %2$s'), $channel_link, $profile_link); + else { + $value = '"' . $value . '"'; } + $message = sprintf(t('%1$s %2$s has been updated to %3$s.'), $channel_link . '\'s' . (($photo) ? '' : ' ' . $profile_link), strtolower($changes), $value); + } else { - $message = sprintf(t('%1$s has an updated %2$s, changing %3$s.'), $channel_link, $profile_link, $changes); + $message = sprintf(t('%1$s updated the %2$s. Changed %3$s.'), $channel_link, $profile_link, strtolower($changes)); } $arr['body'] = $message; diff --git a/include/channel.php b/include/channel.php index b8affa3ca..a82794bfd 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1771,6 +1771,7 @@ function advanced_profile() { if(App::$profile['gender']) $profile['gender'] = array( t('Gender:'), App::$profile['gender'] ); $ob_hash = get_observer_hash(); +/* TODO: AS2 compatibility if($ob_hash && perm_is_allowed(App::$profile['profile_uid'],$ob_hash,'post_like')) { $profile['canlike'] = true; $profile['likethis'] = t('Like this channel'); @@ -1790,7 +1791,7 @@ function advanced_profile() { foreach($likers as $l) $profile['likers'][] = array('name' => $l['xchan_name'],'photo' => zid($l['xchan_photo_s']), 'url' => zid($l['xchan_url'])); } - +*/ if((App::$profile['dob']) && (App::$profile['dob'] != '0000-00-00')) { $val = ''; |