From 8435d9eb1305d9678ef730c5a4924769b830e7d2 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 29 Feb 2024 17:35:05 +0000 Subject: some cleanup --- Zotlabs/Lib/Activity.php | 2 -- Zotlabs/Module/Contactedit.php | 16 +--------------- include/activities.php | 16 ++++++++++------ 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index eef4f8036..1e0ce6ae2 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -2304,8 +2304,6 @@ class Activity { if ($act->objprop('type') === 'Profile') { $s['parent_mid'] = $s['mid']; $s['item_thread_top'] = 1; - $s['summary'] = ''; - $s['body'] = self::bb_content($content, 'summary'); } diff --git a/Zotlabs/Module/Contactedit.php b/Zotlabs/Module/Contactedit.php index e20e90872..3527e9380 100644 --- a/Zotlabs/Module/Contactedit.php +++ b/Zotlabs/Module/Contactedit.php @@ -177,22 +177,8 @@ class Contactedit extends Controller { intval($channel['channel_id']) ); if (($pr) && (!intval($contact['abook_hidden'])) && (intval(get_pconfig($channel['channel_id'], 'system', 'post_newfriend')))) { - $xarr = []; - - $xarr['item_wall'] = 1; - $xarr['item_origin'] = 1; - $xarr['item_thread_top'] = 1; - $xarr['owner_xchan'] = $xarr['author_xchan'] = $channel['channel_hash']; - $xarr['allow_cid'] = $channel['channel_allow_cid']; - $xarr['allow_gid'] = $channel['channel_allow_gid']; - $xarr['deny_cid'] = $channel['channel_deny_cid']; - $xarr['deny_gid'] = $channel['channel_deny_gid']; - $xarr['item_private'] = (($xarr['allow_cid'] || $xarr['allow_gid'] || $xarr['deny_cid'] || $xarr['deny_gid']) ? 1 : 0); - $xarr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t('is now connected to') . ' ' . '[zrl=' . $contact['xchan_url'] . ']' . $contact['xchan_name'] . '[/zrl]'; - - $xarr['body'] .= "\n\n\n" . '[zrl=' . $contact['xchan_url'] . '][zmg=80x80]' . $contact['xchan_photo_m'] . '[/zmg][/zrl]'; - + $xarr['body'] .= "\n\n\n" . '[zrl=' . $contact['xchan_url'] . '][zmg=' . $contact['xchan_photo_m'] . ']' . $contact['xchan_name'] . '[/zmg][/zrl]'; post_activity_item($xarr); } diff --git a/include/activities.php b/include/activities.php index bb80e7906..7bf808dbb 100644 --- a/include/activities.php +++ b/include/activities.php @@ -53,22 +53,26 @@ function profile_activity($changed, $value) { } if ($photo) { - $value = "\n\n" . '[zmg=' . z_root() . '/photo/' . $value . '-' . $photo_size . ']' . $ch . '[/zmg]'; + $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); } - $message = sprintf(t('%1$s updated %2$s to %3$s'), $channel_link, $changes, $value); - $message .= "\n\n" . sprintf(t('Visit %1$s\'s %2$s'), $channel_link, $profile_link); } else { - $message = sprintf(t('%1$s has updated %2$s, changing %3$s.'), $channel_link, $profile_link, $changes); + $message = sprintf(t('%1$s has an updated %2$s, changing %3$s.'), $channel_link, $profile_link, $changes); } $arr['body'] = $message; $arr['obj'] = [ 'type' => 'Profile', - 'summary' => bbcode($message), + 'content' => bbcode($message), 'source' => [ - 'summary' => $message, + 'content' => $message, 'mediaType' => 'text/bbcode' ], 'describes' => Activity::encode_person($channel), -- cgit v1.2.3