aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Enotify.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-06-01 07:00:21 +0000
committerMario <mario@mariovavti.com>2022-06-01 07:00:21 +0000
commite63f0438415bb364f3085286ca2f199e83ab187b (patch)
treeb107429276ebfc92dc9b4f78e302a4967e5bf0a6 /Zotlabs/Lib/Enotify.php
parentc5f33baf27d80e2a7ad7307eacd3137609eeb089 (diff)
parent33dd0c83e377b8adf00559337d13784ec136cecb (diff)
downloadvolse-hubzilla-e63f0438415bb364f3085286ca2f199e83ab187b.tar.gz
volse-hubzilla-e63f0438415bb364f3085286ca2f199e83ab187b.tar.bz2
volse-hubzilla-e63f0438415bb364f3085286ca2f199e83ab187b.zip
Merge branch '7.4RC'7.4
Diffstat (limited to 'Zotlabs/Lib/Enotify.php')
-rw-r--r--Zotlabs/Lib/Enotify.php25
1 files changed, 20 insertions, 5 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index 1421c72ae..59e4d9a4e 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -256,8 +256,8 @@ class Enotify {
$itemlink = $params['link'];
- if (array_key_exists('item',$params) && activity_match($params['item']['verb'],ACTIVITY_LIKE)) {
- if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
+ if (array_key_exists('item',$params) && (activity_match($params['item']['verb'], ACTIVITY_LIKE) || activity_match($params['item']['verb'], ACTIVITY_DISLIKE))) {
+ if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE) || !feature_enabled($recip['channel_id'], 'dislike')) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
@@ -291,22 +291,29 @@ class Enotify {
);
}
+ if (!$p) {
+ pop_lang();
+ return;
+ }
+
xchan_query($p);
-//@@FIXME $p can be null (line 285)
$item_post_type = item_post_type($p[0]);
// $private = $p[0]['item_private'];
$parent_id = $p[0]['id'];
$parent_item = $p[0];
+ $verb = ((activity_match($params['item']['verb'], ACTIVITY_DISLIKE)) ? t('disliked') : t('liked'));
// "your post"
if($p[0]['owner']['xchan_name'] === $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
- $dest_str = sprintf(t('%1$s liked [zrl=%2$s]your %3$s[/zrl]'),
+ $dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'),
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
+ $verb,
$itemlink,
- $item_post_type);
+ $item_post_type
+ );
else {
pop_lang();
return;
@@ -824,6 +831,14 @@ class Enotify {
$itemem_text = sprintf( t('repeated %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
}
+ if($item['verb'] === ACTIVITY_LIKE) {
+ $itemem_text = sprintf( t('liked %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
+ }
+
+ if($item['verb'] === ACTIVITY_DISLIKE) {
+ $itemem_text = sprintf( t('disliked %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
+ }
+
if(in_array($item['obj_type'], ['Document', 'Video', 'Audio', 'Image'])) {
$itemem_text = t('shared a file with you');
}