allow folks to update Mastodon polls manually by entering the ActivityPub id in the search bar; since Mastodon doesn't set the updated timestamp nor track 3rd party conversation subscriptions

This commit is contained in:
nobody 2021-12-28 12:35:40 -08:00
parent 5233df734f
commit 143a4166b2

View file

@ -2975,8 +2975,10 @@ class Activity
$s['verb'] = self::activity_mapper($act->type);
// Mastodon does not provide update timestamps when updating poll tallies which means race conditions may occur here.
if ($act->type === 'Update' && $act->obj['type'] === 'Question' && $s['edited'] === $s['created']) {
$s['edited'] = datetime_convert();
if (in_array($act->type,['Create','Update']) && $act->obj['type'] === 'Question' && $s['edited'] === $s['created']) {
if (isset($act->obj['votersCount']) && intval($act->obj['votersCount'])) {
$s['edited'] = datetime_convert();
}
}