if always_show_in_notices is set to 1 also show likes and dislikes
This commit is contained in:
parent
571a9642a5
commit
b7fb78245a
@ -112,6 +112,8 @@ class Enotify {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
|
||||||
|
|
||||||
// e.g. "your post", "David's photo", etc.
|
// e.g. "your post", "David's photo", etc.
|
||||||
$possess_desc = t('%s <!item_type!>');
|
$possess_desc = t('%s <!item_type!>');
|
||||||
|
|
||||||
@ -134,12 +136,22 @@ class Enotify {
|
|||||||
|
|
||||||
$itemlink = $params['link'];
|
$itemlink = $params['link'];
|
||||||
|
|
||||||
// ignore like/unlike activity on posts - they probably require a separate notification preference
|
$action = 'commented on';
|
||||||
|
|
||||||
|
if(array_key_exists('item',$params) && (! visible_activity($params['item']))) {
|
||||||
|
|
||||||
|
if(! $always_show_in_notices) {
|
||||||
|
logger('notification: not a visible activity. Ignoring.');
|
||||||
|
pop_lang();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(activity_match($params['item']['verb'], ACTIVITY_LIKE))
|
||||||
|
$action = 'liked';
|
||||||
|
|
||||||
|
if(activity_match($params['item']['verb'], ACTIVITY_DISLIKE))
|
||||||
|
$action = 'disliked';
|
||||||
|
|
||||||
if (array_key_exists('item',$params) && (! visible_activity($params['item']))) {
|
|
||||||
logger('notification: not a visible activity. Ignoring.');
|
|
||||||
pop_lang();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$parent_mid = $params['parent_mid'];
|
$parent_mid = $params['parent_mid'];
|
||||||
@ -181,26 +193,29 @@ class Enotify {
|
|||||||
//$possess_desc = str_replace('<!item_type!>',$possess_desc);
|
//$possess_desc = str_replace('<!item_type!>',$possess_desc);
|
||||||
|
|
||||||
// "a post"
|
// "a post"
|
||||||
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]a %4$s[/zrl]'),
|
$dest_str = sprintf(t('%1$s, %2$s %3$s [zrl=%4$s]a %5$s[/zrl]'),
|
||||||
$recip['channel_name'],
|
$recip['channel_name'],
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
|
$action,
|
||||||
$itemlink,
|
$itemlink,
|
||||||
$item_post_type);
|
$item_post_type);
|
||||||
|
|
||||||
// "George Bull's post"
|
// "George Bull's post"
|
||||||
if($p)
|
if($p)
|
||||||
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]%4$s\'s %5$s[/zrl]'),
|
$dest_str = sprintf(t('%1$s, %2$s %3$s [zrl=%4$s]%5$s\'s %6$s[/zrl]'),
|
||||||
$recip['channel_name'],
|
$recip['channel_name'],
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
|
$action,
|
||||||
$itemlink,
|
$itemlink,
|
||||||
$p[0]['author']['xchan_name'],
|
$p[0]['author']['xchan_name'],
|
||||||
$item_post_type);
|
$item_post_type);
|
||||||
|
|
||||||
// "your post"
|
// "your post"
|
||||||
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
|
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
|
||||||
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]your %4$s[/zrl]'),
|
$dest_str = sprintf(t('%1$s, %2$s %3$s [zrl=%3$s]your %5$s[/zrl]'),
|
||||||
$recip['channel_name'],
|
$recip['channel_name'],
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
|
$action,
|
||||||
$itemlink,
|
$itemlink,
|
||||||
$item_post_type);
|
$item_post_type);
|
||||||
|
|
||||||
@ -231,12 +246,12 @@ class Enotify {
|
|||||||
|
|
||||||
$itemlink = $params['link'];
|
$itemlink = $params['link'];
|
||||||
|
|
||||||
// ignore like/unlike activity on posts - they probably require a separate notification preference
|
|
||||||
|
|
||||||
if (array_key_exists('item',$params) && (! activity_match($params['item']['verb'],ACTIVITY_LIKE))) {
|
if (array_key_exists('item',$params) && (! activity_match($params['item']['verb'],ACTIVITY_LIKE))) {
|
||||||
logger('notification: not a like activity. Ignoring.');
|
if(! $always_show_in_notices) {
|
||||||
pop_lang();
|
logger('notification: not a visible activity. Ignoring.');
|
||||||
return;
|
pop_lang();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$parent_mid = $params['parent_mid'];
|
$parent_mid = $params['parent_mid'];
|
||||||
@ -496,8 +511,6 @@ class Enotify {
|
|||||||
// Another option would be to not add them to the DB, and change how emails are handled
|
// Another option would be to not add them to the DB, and change how emails are handled
|
||||||
// (probably would be better that way)
|
// (probably would be better that way)
|
||||||
|
|
||||||
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
|
|
||||||
|
|
||||||
if (!$always_show_in_notices) {
|
if (!$always_show_in_notices) {
|
||||||
if (($params['type'] == NOTIFY_WALL) || ($params['type'] == NOTIFY_MAIL) || ($params['type'] == NOTIFY_INTRO)) {
|
if (($params['type'] == NOTIFY_WALL) || ($params['type'] == NOTIFY_MAIL) || ($params['type'] == NOTIFY_INTRO)) {
|
||||||
$seen = 1;
|
$seen = 1;
|
||||||
|
Reference in New Issue
Block a user