mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 01:35:12 +00:00
simplify permalink selection logic
This commit is contained in:
parent
db8ebc9f37
commit
a78d9b973d
4 changed files with 7 additions and 5 deletions
|
@ -232,7 +232,7 @@ class Item extends BaseObject {
|
||||||
'like' => $like,
|
'like' => $like,
|
||||||
'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike : ''),
|
'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike : ''),
|
||||||
'share' => $share,
|
'share' => $share,
|
||||||
'plink' => get_plink($item,$mode),
|
'plink' => get_plink($item),
|
||||||
'edpost' => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
|
'edpost' => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
|
||||||
'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
|
'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
|
||||||
'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''),
|
'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''),
|
||||||
|
|
|
@ -692,7 +692,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
|
||||||
'owner_name' => $owner_name,
|
'owner_name' => $owner_name,
|
||||||
'owner_url' => $owner_url,
|
'owner_url' => $owner_url,
|
||||||
'owner_photo' => $owner_photo,
|
'owner_photo' => $owner_photo,
|
||||||
'plink' => get_plink($item,$mode),
|
'plink' => get_plink($item,false),
|
||||||
'edpost' => false,
|
'edpost' => false,
|
||||||
'isstarred' => $isstarred,
|
'isstarred' => $isstarred,
|
||||||
'star' => $star,
|
'star' => $star,
|
||||||
|
|
|
@ -94,6 +94,9 @@ function notification($params) {
|
||||||
if($params['type'] == NOTIFY_COMMENT) {
|
if($params['type'] == NOTIFY_COMMENT) {
|
||||||
// logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
|
// logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
|
||||||
|
|
||||||
|
$itemlink = $params['link'];
|
||||||
|
|
||||||
|
|
||||||
// ignore like/unlike activity on posts - they probably require a sepearate notification preference
|
// ignore like/unlike activity on posts - they probably require a sepearate notification preference
|
||||||
|
|
||||||
if(array_key_exists('item',$params) && (! visible_activity($params['item'])))
|
if(array_key_exists('item',$params) && (! visible_activity($params['item'])))
|
||||||
|
@ -171,7 +174,6 @@ function notification($params) {
|
||||||
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
|
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
|
||||||
$tsitelink = sprintf( $sitelink, $siteurl );
|
$tsitelink = sprintf( $sitelink, $siteurl );
|
||||||
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
|
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
|
||||||
$itemlink = $params['link'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($params['type'] == NOTIFY_WALL) {
|
if($params['type'] == NOTIFY_WALL) {
|
||||||
|
|
|
@ -1389,9 +1389,9 @@ function feed_salmonlinks($nick) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_plink($item,$mode) {
|
function get_plink($item,$conversation_mode = true) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
if(($mode == 'display') || ($mode == 'channel') || ($mode == 'network'))
|
if($conversation_mode)
|
||||||
$key = 'plink';
|
$key = 'plink';
|
||||||
else
|
else
|
||||||
$key = 'llink';
|
$key = 'llink';
|
||||||
|
|
Loading…
Reference in a new issue