Merge branch 'dev'

This commit is contained in:
zotlabs 2020-02-09 21:39:48 -08:00
commit 9c7cbcbdfa
2 changed files with 22 additions and 13 deletions

View file

@ -1858,8 +1858,8 @@ class Activity {
// These activities should have been handled separately in the Inbox module and should not be turned into posts // These activities should have been handled separately in the Inbox module and should not be turned into posts
if (in_array($act->type, ['Follow', 'Accept', 'Reject', 'Create', 'Update']) if (in_array($act->type, ['Follow', 'Accept', 'Reject', 'Create', 'Update']) && is_array($act->obj) && array_key_exists('type',$act->obj)
&& is_array($a->obj) && array_key_exists('type',$a->obj) && ($a->obj['type'] === 'Follow' || ActivityStreams::is_an_actor($a->obj['type']))) { && ($act->obj['type'] === 'Follow' || ActivityStreams::is_an_actor($act->obj['type']))) {
return false; return false;
} }

View file

@ -1680,6 +1680,18 @@ function format_poll($item,$s,$opts) {
$activated = ((local_channel() && local_channel() == $item['uid']) ? true : false); $activated = ((local_channel() && local_channel() == $item['uid']) ? true : false);
$output = $s . EOL. EOL; $output = $s . EOL. EOL;
$closed = false;
$closing = false;
if ($item['comments_closed'] > NULL_DATE) {
$closing = true;
$t = datetime_convert('UTC',date_default_timezone_get(), $item['comments_closed'], 'Y-m-d H:i');
$closed = ((datetime_convert() > $item['comments_closed']) ? true : false);
if ($closed) {
$commentable = false;
}
}
if ($act['type'] === 'Question') { if ($act['type'] === 'Question') {
if ($activated and $commentable) { if ($activated and $commentable) {
$output .= '<form id="question-form-' . $item['id'] . '" >'; $output .= '<form id="question-form-' . $item['id'] . '" >';
@ -1722,17 +1734,14 @@ function format_poll($item,$s,$opts) {
} }
} }
} }
if ($item['comments_closed'] > NULL_DATE) {
$t = datetime_convert('UTC',date_default_timezone_get(), $item['comments_closed'], 'Y-m-d h:i');
$closed = ((datetime_convert() > $item['comments_closed']) ? true : false);
if ($closed) { if ($closed) {
$message = t('Poll has ended.'); $message = t('Poll has ended.');
} }
else { elseif ($closing) {
$message = sprintf(t('Poll ends: %s'),$t); $message = sprintf(t('Poll ends: %s'),$t);
} }
$output .= EOL . '<div>' . $message . '</div>'; $output .= EOL . '<div>' . $message . '</div>';
}
if ($activated and $commentable) { if ($activated and $commentable) {
$output .= EOL . '<input type="button" class="btn btn-std btn-success" name="vote" value="vote" onclick="submitPoll(' . $item['id'] . '); return false;">'. '</form>'; $output .= EOL . '<input type="button" class="btn btn-std btn-success" name="vote" value="vote" onclick="submitPoll(' . $item['id'] . '); return false;">'. '</form>';
} }