allow checkins with no post body if they have location info

This commit is contained in:
Mike Macgirvin 2022-11-17 19:40:51 +11:00
parent 2b63670eda
commit 990f04bdcc
4 changed files with 13 additions and 18 deletions

View file

@ -1396,7 +1396,7 @@ class Libzot
logger('unsupported sync packet encoding ignored.');
}
}
if ($result) {
$return = array_merge($return, $result);
}

View file

@ -3,10 +3,7 @@
namespace Code\Lib;
use App;
use Code\Lib\Libzot;
use Code\Lib\Webfinger;
use Code\Lib\Zotfinger;
use Code\Lib\Channel;
use Code\Extend\Hook;
use Code\Render\Theme;
@ -89,12 +86,12 @@ class Libzotdir
$o = replace_macros(Theme::get_template('dir_sort_links.tpl'), [
'$header' => t('Directory Options'),
'$forumsurl' => $forumsurl,
'$safemode' => array('safemode', t('Safe Mode'), $safe_mode, '', array(t('No'), t('Yes')), ' onchange=\'window.location.href="' . $forumsurl . '&safe="+(this.checked ? 1 : 0)\''),
'$pubforums' => array('pubforums', t('Groups Only'), (($pubforums == 1) ? true : false), '', array(t('No'), t('Yes')), ' onchange=\'window.location.href="' . $forumsurl . '&type="+(this.checked ? 1 : 0)\''),
'$safemode' => ['safemode', t('Safe Mode'), $safe_mode, '', [t('No'), t('Yes')], ' onchange=\'window.location.href="' . $forumsurl . '&safe="+(this.checked ? 1 : 0)\''],
'$pubforums' => ['pubforums', t('Groups Only'), (($pubforums == 1) ? true : false), '', [t('No'), t('Yes')], ' onchange=\'window.location.href="' . $forumsurl . '&type="+(this.checked ? 1 : 0)\''],
// '$collections' => array('collections', t('Collections Only'),(($pubforums == 2) ? true : false),'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&type="+(this.checked ? 2 : 0)\''),
'$hide_local' => $hide_local,
'$globaldir' => array('globaldir', t('This Website Only'), 1 - intval($globaldir), '', array(t('No'), t('Yes')), ' onchange=\'window.location.href="' . $forumsurl . '&global="+(this.checked ? 0 : 1)\''),
'$activedir' => array('activedir', t('Recently Updated'), intval($activedir), '', array(t('No'), t('Yes')), ' onchange=\'window.location.href="' . $forumsurl . '&active="+(this.checked ? 1 : 0)\''),
'$globaldir' => ['globaldir', t('This Website Only'), 1 - intval($globaldir), '', [t('No'), t('Yes')], ' onchange=\'window.location.href="' . $forumsurl . '&global="+(this.checked ? 0 : 1)\''],
'$activedir' => ['activedir', t('Recently Updated'), intval($activedir), '', [t('No'), t('Yes')], ' onchange=\'window.location.href="' . $forumsurl . '&active="+(this.checked ? 1 : 0)\''],
'$covers' => (Config::Get('system','remote_cover_photos')) ? [ 'covers', t('Show cover photos'), intval($covers), t('May slow page loading'), [ t('No'), t('Yes')], ' onchange=\'window.location.href="' . $forumsurl . '&covers="+(this.checked ? 1 : 0)\''] : '',
]);

View file

@ -882,9 +882,8 @@ class Item extends Controller
$body = ((isset($_REQUEST['body'])) ? trim($_REQUEST['body']) : EMPTY_STR);
$body .= ((isset($_REQUEST['attachment'])) ? trim($_REQUEST['attachment']) : EMPTY_STR);
$postopts = '';
$allow_empty = ((array_key_exists('allow_empty', $_REQUEST)) ? intval($_REQUEST['allow_empty']) : 0);
$haslocation = $lat || $lon;
$allow_empty = (($checkin && $haslocation) || $_REQUEST['allow_empty']);
$private = ((isset($private) && $private) ? $private : intval($acl->is_private() || ($public_policy)));
// If this is a comment, set the permissions from the parent.

View file

@ -131,7 +131,6 @@
<button type="button" id="profile-poll-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$poll}}" onclick="initPoll();">
<i id="profile-poll" class="fa fa-bar-chart jot-icons"></i>
</button>
</div>
<div class="btn-group mr-2 d-none d-lg-flex">
{{if $setloc}}
@ -144,6 +143,11 @@
<i id="profile-nolocation" class="fa fa-circle-o jot-icons"></i>
</button>
{{/if}}
{{if $feature_checkin}}
<button id="profile-checkin-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$checkin}}" onclick="jotCheckin(); return false;">
<i id="profile-checkin" class="fa fa-map-marker jot-icons"></i>
</button>
{{/if}}
{{else}}
<div class="btn-group d-none d-lg-flex">
{{/if}}
@ -169,11 +173,6 @@
<i id="profile-encrypt" class="fa fa-key jot-icons"></i>
</button>
{{/if}}
{{if $feature_checkin}}
<button id="profile-checkin-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$checkin}}" onclick="jotCheckin(); return false;">
<i id="profile-checkin" class="fa fa-map-marker jot-icons"></i>
</button>
{{/if}}
</div>
{{if $writefiles || $weblink || $setloc || $clearloc || $feature_expire || $feature_encrypt }}