diff options
author | Mario <mario@mariovavti.com> | 2020-02-11 09:20:32 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-02-11 09:20:32 +0000 |
commit | 9f029336cab322e04d29af842ba0a666189c8683 (patch) | |
tree | 27c267bb8297d4f79ea5b360e05a63d7d7e577c0 /include/conversation.php | |
parent | 95476cf33cf7c7971e018f9136d1c64dfc901d17 (diff) | |
download | volse-hubzilla-9f029336cab322e04d29af842ba0a666189c8683.tar.gz volse-hubzilla-9f029336cab322e04d29af842ba0a666189c8683.tar.bz2 volse-hubzilla-9f029336cab322e04d29af842ba0a666189c8683.zip |
fix notifications for polls
Diffstat (limited to 'include/conversation.php')
-rw-r--r-- | include/conversation.php | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/include/conversation.php b/include/conversation.php index 327d89e53..0098a694d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -625,11 +625,17 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa $items = $cb['items']; - $conv_responses = array( - 'like' => array('title' => t('Likes','title')),'dislike' => array('title' => t('Dislikes','title')), - 'agree' => array('title' => t('Agree','title')),'disagree' => array('title' => t('Disagree','title')), 'abstain' => array('title' => t('Abstain','title')), - 'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title')) - ); + $conv_responses = [ + 'like' => ['title' => t('Likes','title')], + 'dislike' => ['title' => t('Dislikes','title')], + 'agree' => ['title' => t('Agree','title')], + 'disagree' => ['title' => t('Disagree','title')], + 'abstain' => ['title' => t('Abstain','title')], + 'attendyes' => ['title' => t('Attending','title')], + 'attendno' => ['title' => t('Not attending','title')], + 'attendmaybe' => ['title' => t('Might attend','title')], + 'answer' => [] + ]; // array with html for each thread (parent+comments) @@ -1136,7 +1142,7 @@ function builtin_activity_puller($item, &$conv_responses) { // if this item is a post or comment there's nothing for us to do here, just return. - if(activity_match($item['verb'],ACTIVITY_POST)) + if(activity_match($item['verb'],ACTIVITY_POST) && $item['obj_type'] !== 'Answer') return; foreach($conv_responses as $mode => $v) { @@ -1168,6 +1174,9 @@ function builtin_activity_puller($item, &$conv_responses) { case 'attendmaybe': $verb = ACTIVITY_ATTENDMAYBE; break; + case 'answer': + $verb = ACTIVITY_POST; + break; default: return; break; @@ -1183,9 +1192,11 @@ function builtin_activity_puller($item, &$conv_responses) { if(! $item['thr_parent']) $item['thr_parent'] = $item['parent_mid']; - $conv_responses[$mode]['mids'][$item['thr_parent']][] = 'b64.' . base64url_encode($item['mid']); + if($item['obj_type'] === 'Answer') + continue; + if(! ((isset($conv_responses[$mode][$item['thr_parent'] . '-l'])) && (is_array($conv_responses[$mode][$item['thr_parent'] . '-l'])))) $conv_responses[$mode][$item['thr_parent'] . '-l'] = array(); |