From 0532d639c29ad03d235fd93b5e442ec7a7a88f48 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Tue, 3 Dec 2019 10:26:49 +0100 Subject: Optimize pinned item verbs based activity processing --- Zotlabs/Widget/Pinned.php | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Pinned.php b/Zotlabs/Widget/Pinned.php index e2dc49018..f200e1378 100644 --- a/Zotlabs/Widget/Pinned.php +++ b/Zotlabs/Widget/Pinned.php @@ -55,12 +55,12 @@ class Pinned { $attend = null; $canvote = false; - $response_verbs = []; + $conv_responses = []; if($item['obj_type'] === ACTIVITY_OBJ_EVENT) { - $response_verbs[] = 'attendyes'; - $response_verbs[] = 'attendno'; - $response_verbs[] = 'attendmaybe'; + $conv_responses['attendyes'] = [ 'title' => t('Attending','title') ]; + $conv_responses['attendno'] = [ 'title' => t('Not attending','title') ]; + $conv_responses['attendmaybe'] = [ 'title' => t('Might attend','title') ]; if($commentable && $observer) { $attend = array( t('I will attend'), t('I will not attend'), t('I might attend')); $isevent = true; @@ -69,24 +69,15 @@ class Pinned { $consensus = (intval($item['item_consensus']) ? true : false); if($consensus) { - $response_verbs[] = 'agree'; - $response_verbs[] = 'disagree'; - $response_verbs[] = 'abstain'; + $conv_responses['agree'] = [ 'title' => t('Agree','title') ]; + $conv_responses['disagree'] = [ 'title' => t('Disagree','title') ]; + $conv_responses['abstain'] = [ 'title' => t('Abstain','title') ]; if($commentable && $observer) { $conlabels = array( t('I agree'), t('I disagree'), t('I abstain')); $canvote = true; } } - $conv_responses = [ - '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') ] - ]; - $this->activity($item, $conv_responses); $verified = (intval($item['item_verified']) ? t('Message signature validated') : ''); -- cgit v1.2.3