more cleanup

This commit is contained in:
Mario
2024-02-29 21:11:39 +00:00
parent 8435d9eb13
commit 4bbeb224f6
5 changed files with 20 additions and 18 deletions

View File

@@ -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']),

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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 = '';