Merge remote-tracking branch 'upstream/2020.03-rc' into issue-8371-a
This commit is contained in:
commit
d04c9b4930
|
@ -174,39 +174,39 @@ function notification($params)
|
|||
|
||||
// "George Bull's post"
|
||||
if ($params['activity']['origin_comment']) {
|
||||
$message = '%1$s replied to you on %2$s\'s %3$s %4$s';
|
||||
$message = $l10n->t('%1$s replied to you on %2$s\'s %3$s %4$s');
|
||||
} elseif ($params['activity']['explicit_tagged']) {
|
||||
$message = '%1$s tagged you on %2$s\'s %3$s %4$s';
|
||||
$message = $l10n->t('$l10n->t(%1$s tagged you on %2$s\'s %3$s %4$s');
|
||||
} else {
|
||||
$message = '%1$s commented on %2$s\'s %3$s %4$s';
|
||||
$message = $l10n->t('%1$s commented on %2$s\'s %3$s %4$s');
|
||||
}
|
||||
|
||||
$dest_str = $l10n->t($message, $params['source_name'], $item['author-name'], $item_post_type, $title);
|
||||
$dest_str = sprintf($message, $params['source_name'], $item['author-name'], $item_post_type, $title);
|
||||
|
||||
// Then look for the special cases
|
||||
|
||||
// "your post"
|
||||
if ($params['activity']['origin_thread']) {
|
||||
if ($params['activity']['origin_comment']) {
|
||||
$message = '%1$s replied to you on your %2$s %3$s';
|
||||
$message = $l10n->t('%1$s replied to you on your %2$s %3$s');
|
||||
} elseif ($params['activity']['explicit_tagged']) {
|
||||
$message = '%1$s tagged you on your %2$s %3$s';
|
||||
$message = $l10n->t('%1$s tagged you on your %2$s %3$s');
|
||||
} else {
|
||||
$message = '%1$s commented on your %2$s %3$s';
|
||||
$message = $l10n->t('%1$s commented on your %2$s %3$s');
|
||||
}
|
||||
|
||||
$dest_str = $l10n->t($message, $params['source_name'], $item_post_type, $title);
|
||||
$dest_str = sprintf($message, $params['source_name'], $item_post_type, $title);
|
||||
// "their post"
|
||||
} elseif ($item['author-link'] == $params['source_link']) {
|
||||
if ($params['activity']['origin_comment']) {
|
||||
$message = '%1$s replied to you on their %2$s %3$s';
|
||||
$message = $l10n->t('%1$s replied to you on their %2$s %3$s');
|
||||
} elseif ($params['activity']['explicit_tagged']) {
|
||||
$message = '%1$s tagged you on their %2$s %3$s';
|
||||
$message = $l10n->t('%1$s tagged you on their %2$s %3$s');
|
||||
} else {
|
||||
$message = '%1$s commented on their %2$s %3$s';
|
||||
$message = $l10n->t('%1$s commented on their %2$s %3$s');
|
||||
}
|
||||
|
||||
$dest_str = $l10n->t($message, $params['source_name'], $item_post_type, $title);
|
||||
$dest_str = sprintf($message, $params['source_name'], $item_post_type, $title);
|
||||
}
|
||||
|
||||
// Some mail software relies on subject field for threading.
|
||||
|
|
48
mod/item.php
48
mod/item.php
|
@ -128,7 +128,7 @@ function item_post(App $a) {
|
|||
$thread_parent_contact = Contact::getDetailsByURL($toplevel_item["author-link"]);
|
||||
|
||||
if ($toplevel_item['id'] != $toplevel_item['parent']) {
|
||||
$toplevel_item = Item::selectFirst(Item::ITEM_FIELDLIST, ['id' => $toplevel_item['parent']]);
|
||||
$toplevel_item = Item::selectFirst([], ['id' => $toplevel_item['parent']]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -244,10 +244,10 @@ function item_post(App $a) {
|
|||
$body = preg_replace('#\[url=([^\]]*?)\]\[/url\]#ism', '[url]$1[/url]', $body);
|
||||
|
||||
if (!empty($orig_post)) {
|
||||
$str_group_allow = $orig_post['allow_gid'];
|
||||
$str_contact_allow = $orig_post['allow_cid'];
|
||||
$str_group_deny = $orig_post['deny_gid'];
|
||||
$str_contact_deny = $orig_post['deny_cid'];
|
||||
$str_group_allow = $orig_post['allow_gid'] ?? '';
|
||||
$str_contact_allow = $orig_post['allow_cid'] ?? '';
|
||||
$str_group_deny = $orig_post['deny_gid'] ?? '';
|
||||
$str_contact_deny = $orig_post['deny_cid'] ?? '';
|
||||
$location = $orig_post['location'];
|
||||
$coord = $orig_post['coord'];
|
||||
$verb = $orig_post['verb'];
|
||||
|
@ -261,33 +261,13 @@ function item_post(App $a) {
|
|||
$network = $orig_post['network'];
|
||||
$guid = $orig_post['guid'];
|
||||
$extid = $orig_post['extid'];
|
||||
|
||||
} else {
|
||||
$aclFormatter = DI::aclFormatter();
|
||||
|
||||
/*
|
||||
* if coming from the API and no privacy settings are set,
|
||||
* use the user default permissions - as they won't have
|
||||
* been supplied via a form.
|
||||
*/
|
||||
if ($api_source
|
||||
&& !array_key_exists('contact_allow', $_REQUEST)
|
||||
&& !array_key_exists('group_allow', $_REQUEST)
|
||||
&& !array_key_exists('contact_deny', $_REQUEST)
|
||||
&& !array_key_exists('group_deny', $_REQUEST)) {
|
||||
$str_group_allow = $user['allow_gid'];
|
||||
$str_contact_allow = $user['allow_cid'];
|
||||
$str_group_deny = $user['deny_gid'];
|
||||
$str_contact_deny = $user['deny_cid'];
|
||||
} else {
|
||||
// use the posted permissions
|
||||
|
||||
$aclFormatter = DI::aclFormatter();
|
||||
|
||||
$str_group_allow = $aclFormatter->toString($_REQUEST['group_allow'] ?? '');
|
||||
$str_contact_allow = $aclFormatter->toString($_REQUEST['contact_allow'] ?? '');
|
||||
$str_group_deny = $aclFormatter->toString($_REQUEST['group_deny'] ?? '');
|
||||
$str_contact_deny = $aclFormatter->toString($_REQUEST['contact_deny'] ?? '');
|
||||
}
|
||||
$str_group_allow = isset($_REQUEST['group_allow']) ? $aclFormatter->toString($_REQUEST['group_allow']) : $user['allow_gid'] ?? '';
|
||||
$str_contact_allow = isset($_REQUEST['contact_allow']) ? $aclFormatter->toString($_REQUEST['contact__allow']) : $user['allow_cid'] ?? '';
|
||||
$str_group_deny = isset($_REQUEST['group_deny']) ? $aclFormatter->toString($_REQUEST['group_deny']) : $user['deny_gid'] ?? '';
|
||||
$str_contact_deny = isset($_REQUEST['contact_deny']) ? $aclFormatter->toString($_REQUEST['contact_deny']) : $user['deny_cid'] ?? '';
|
||||
|
||||
$title = Strings::escapeTags(trim($_REQUEST['title'] ?? ''));
|
||||
$location = Strings::escapeTags(trim($_REQUEST['location'] ?? ''));
|
||||
|
@ -318,10 +298,10 @@ function item_post(App $a) {
|
|||
$network = $toplevel_item['network'];
|
||||
}
|
||||
|
||||
$str_contact_allow = $toplevel_item['allow_cid'];
|
||||
$str_group_allow = $toplevel_item['allow_gid'];
|
||||
$str_contact_deny = $toplevel_item['deny_cid'];
|
||||
$str_group_deny = $toplevel_item['deny_gid'];
|
||||
$str_contact_allow = $toplevel_item['allow_cid'] ?? '';
|
||||
$str_group_allow = $toplevel_item['allow_gid'] ?? '';
|
||||
$str_contact_deny = $toplevel_item['deny_cid'] ?? '';
|
||||
$str_group_deny = $toplevel_item['deny_gid'] ?? '';
|
||||
$private = $toplevel_item['private'];
|
||||
|
||||
$wall = $toplevel_item['wall'];
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue