aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-05-05 14:51:00 +0000
committerMario <mario@mariovavti.com>2020-05-05 14:51:00 +0000
commit06d1cf83d2b1acfef5529fe388d2502bea381881 (patch)
tree4a387d86ecfd5dfd72b311ca9aa95be4a61f63bc
parentde058901c2a8dd5fea09b1594c2ace0b8bd2c90f (diff)
downloadvolse-hubzilla-06d1cf83d2b1acfef5529fe388d2502bea381881.tar.gz
volse-hubzilla-06d1cf83d2b1acfef5529fe388d2502bea381881.tar.bz2
volse-hubzilla-06d1cf83d2b1acfef5529fe388d2502bea381881.zip
deal with polls and votes in enotify
-rw-r--r--Zotlabs/Lib/Enotify.php27
-rw-r--r--Zotlabs/Module/Sse_bs.php1
-rw-r--r--include/text.php3
3 files changed, 21 insertions, 10 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index a4fc8aa75..f706b0fb9 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -143,19 +143,26 @@ class Enotify {
$action = t('commented on');
- if(array_key_exists('item',$params) && in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
+ if(array_key_exists('item',$params)) {
- if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
- logger('notification: not a visible activity. Ignoring.');
- pop_lang();
- return;
- }
+ if(in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
- if(activity_match($params['verb'], ACTIVITY_LIKE))
- $action = t('liked');
+ if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
+ logger('notification: not a visible activity. Ignoring.');
+ pop_lang();
+ return;
+ }
+
+ if(activity_match($params['verb'], ACTIVITY_LIKE))
+ $action = t('liked');
+
+ if(activity_match($params['verb'], ACTIVITY_DISLIKE))
+ $action = t('disliked');
+
+ }
- if(activity_match($params['verb'], ACTIVITY_DISLIKE))
- $action = t('disliked');
+ if($params['item']['obj_type'] === 'Answer')
+ $action = t('voted on');
}
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index a8c0b2299..23bc3c96b 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -327,6 +327,7 @@ class Sse_bs extends Controller {
$r = q("SELECT * FROM notify WHERE uid = %d AND seen = 0 ORDER BY created DESC",
intval(self::$uid)
);
+
if($r) {
foreach($r as $rr) {
$result['notify']['notifications'][] = Enotify::format_notify($rr);
diff --git a/include/text.php b/include/text.php
index b13458e99..a2e5ce37a 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2240,6 +2240,9 @@ function item_post_type($item) {
if(strlen($item['verb']) && (! activity_match($item['verb'],ACTIVITY_POST)))
$post_type = t('activity');
+ if($item['obj_type'] === 'Question')
+ $post_type = t('poll');
+
return $post_type;
}