Merge branch 'dev' of /home/macgirvin/roadhouse into dev

This commit is contained in:
nobody 2021-03-07 17:00:41 -08:00
commit 2f65519cf7
7 changed files with 42 additions and 18 deletions

View file

@ -27,7 +27,8 @@ class AccessList {
q('UPDATE pgrp SET deleted = 0 WHERE id = %d', intval($z[0]['id']));
notice( t('A deleted list with this name was revived. Existing item permissions <strong>may</strong> apply to this list and any future members. If this is not what you intended, please create another list with a different name.') . EOL);
}
return true;
$hash = self::by_id($uid,$r);
return $hash;
}
$hash = new_uuid();
@ -43,7 +44,8 @@ class AccessList {
}
Libsync::build_sync_packet($uid,null,true);
return $ret;
return (($ret) ? $hash : $ret);
}

View file

@ -3460,7 +3460,7 @@ class Activity {
if (array_path_exists('source/mediaType',$act) && array_path_exists('source/content',$act)) {
if ($act['source']['mediaType'] === 'text/bbcode') {
if (is_string($act['source']['content']) && strpos('<',$act['source']['content']) !== false) {
if (is_string($act['source']['content']) && strpos($act['source']['content'],'<') !== false) {
$content['bbcode'] = multicode_purify($act['source']['content']);
}
else {

View file

@ -856,6 +856,9 @@ class ThreadItem {
$comment_buttons = $arr['comment_buttons'];
$feature_auto_save_draft = ((feature_enabled($conv->get_profile_owner(), 'auto_save_draft')) ? "true" : "false");
$permanent_draft = ((intval($conv->get_profile_owner()) === intval(local_channel()) && Apps::system_app_installed($conv->get_profile_owner(),'Drafts')) ? ('Save draft') : EMPTY_STR);
$comment_box = replace_macros($template,array(
'$return_path' => '',
@ -896,6 +899,7 @@ class ThreadItem {
'$anonmail' => [ 'anonmail', t('Your email address (required)') ],
'$anonurl' => [ 'anonurl', t('Your website URL (optional)') ],
'$auto_save_draft' => $feature_auto_save_draft,
'$save' => $permanent_draft,
));
return $comment_box;

View file

@ -39,7 +39,9 @@ Installed by default. Lets you discover others in the network. This displays eve
### Drafts
This optional app allows you to save a post you are composing and finish it later. After installing, click the 'disk' icon in the post editor to save a draft. Click the app itself to display your current drafts, and 'Edit Post' to continue editing. Important: please use the 'disk' icon to continue saving the draft if you wish to continue working on it. As soon as you click 'Share', the post will be published.
This optional app allows you to save a post or comment you are composing and finish it later. After installing, click the 'disk' icon in the post/comment editor to save a draft. Click the app itself to display your current drafts, and 'Edit' from the article dropdown menu to continue editing.
Important: please use the Draft icon (looks like a floppy disk in the default theme) to continue saving the draft if you wish to continue working on it. As soon as you click 'Share' (posts) or 'Submit' (comments), it will be published.
### Events

View file

@ -437,23 +437,20 @@ function create_identity($arr) {
// Create a group with yourself as a member. This allows somebody to use it
// right away as a default group for new contacts.
AccessList::add($newuid, t('Friends'));
AccessList::member_add($newuid,t('Friends'),$ret['channel']['channel_hash']);
$group_hash = AccessList::add($newuid, t('Friends'));
if ($group_hash) {
AccessList::member_add($newuid,t('Friends'),$ret['channel']['channel_hash']);
// if our role_permissions indicate that we're using a default collection ACL, add it.
// if our role_permissions indicate that we're using a default collection ACL, add it.
if(is_array($role_permissions) && $role_permissions['default_collection']) {
$r = q("select hash from pgrp where uid = %d and gname = '%s' limit 1",
intval($newuid),
dbesc( t('Friends') )
);
if($r) {
q("update channel set channel_default_group = '%s', channel_allow_gid = '%s' where channel_id = %d",
dbesc($r[0]['hash']),
dbesc('<' . $r[0]['hash'] . '>'),
intval($newuid)
);
if(is_array($role_permissions) && $role_permissions['default_collection']) {
$default_collection_str = '<' . $group_hash . '>';
}
q("update channel set channel_default_group = '%s', channel_allow_gid = '%s' where channel_id = %d",
dbesc($group_hash),
dbesc(($default_collection_str) ? $default_collection_str : EMPTY_STR),
intval($newuid)
);
}
if(! $system) {

View file

@ -1425,6 +1425,19 @@ function save_draft() {
return true;
}
function save_draft_comment(id) {
$("#comment-draft-" + id).val("1");
$.post(
"item",
$("#comment-edit-form-" + id).serialize(),
function() {
commentCancel(id);
document.location.href=document.location.href;
},
);
return true;
}
function preview_mail() {
$("#mail-preview").val("1");

View file

@ -13,6 +13,7 @@
<input type="hidden" name="return" value="{{$return_path}}" />
<input type="hidden" name="jsreload" value="{{$jsreload}}" />
<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
<input type="hidden" name="draft" id="comment-draft-{{$id}}" value="0" />
<input type="hidden" name="hidden_mentions" id="hidden-mentions-{{$id}}" value="" />
{{if $anoncomments && ! $observer}}
<div id="comment-edit-anon-{{$id}}" style="display: none;" >
@ -69,6 +70,11 @@
<i class="fa fa-eye comment-icon" ></i>
</button>
{{/if}}
{{if $save}}
<button class="btn btn-outline-secondary btn-sm" onclick="save_draft_comment({{$id}});return false;" title="{{$save}}">
<i class="fa fa-floppy-o comment-icon" ></i>
</button>
{{/if}}
<button id="comment-edit-submit-{{$id}}" class="btn btn-primary btn-sm" type="submit" name="button-submit" onclick="post_comment({{$id}}); return false;">{{$submit}}</button>
</div>
{{if $reset}}