Merge branch 'dev' of ../p3 into dev

This commit is contained in:
nobody 2021-11-10 17:24:09 -08:00
commit cad308c716
7 changed files with 40 additions and 7 deletions

View file

@ -147,7 +147,7 @@ class Enotify {
$itemlink = z_root() . '/display/' . gen_link_id($params['item']['mid']);
}
if ($params['type'] == NOTIFY_COMMENT) {
if (in_array(intval($params['type']), [ NOTIFY_COMMENT, NOTIFY_RESHARE ] ) {
// logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
$moderated = (($params['item']['item_blocked'] == ITEM_MODERATED) ? true : false);
@ -695,6 +695,7 @@ class Enotify {
case NOTIFY_WALL:
case NOTIFY_TAGSELF:
case NOTIFY_POKE:
case NOTIFY_RESHARE:
case NOTIFY_COMMENT:
if (! $private)
break;

View file

@ -61,10 +61,13 @@ class Editpost extends Controller {
$collections = [];
$catsenabled = ((Apps::system_app_installed($owner_uid,'Categories')) ? 'categories' : '');
$item = fetch_post_tags($item);
// we have a single item, but fetch_post_tags expects an array. Convert it before and after.
$item = array_shift(fetch_post_tags([$item]));
if ($catsenabled) {
$cats = get_terms_oftype($item['term'], TERM_CATEGORY);
if ($cats) {
foreach ($cats as $cat) {
if (strlen($category)) {
@ -74,7 +77,7 @@ class Editpost extends Controller {
}
}
}
$clcts = get_terms_oftype($item['term'], TERM_PCATEGORY);
if ($clcts) {
foreach ($clcts as $clct) {

View file

@ -214,6 +214,8 @@ class Channel {
$notify += intval($_POST['notify7']);
if(x($_POST,'notify8'))
$notify += intval($_POST['notify8']);
if(x($_POST,'notify10'))
$notify += intval($_POST['notify10']);
$vnotify = 0;
@ -658,6 +660,7 @@ class Channel {
// '$notify2' => array('notify2', t('Your connections are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, '', $yes_no),
'$notify3' => array('notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, '', $yes_no),
'$notify4' => array('notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, '', $yes_no),
'$notify10' => array('notify10', t('Someone shares a followed conversation'), ($notify & NOTIFY_RESHARE), NOTIFY_RESHARE, '', $yes_no),
'$notify5' => array('notify5', t('You receive a direct (private) message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, '', $yes_no),
// '$notify6' => array('notify6', t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, '', $yes_no),
'$notify7' => array('notify7', t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, '', $yes_no),

20
Zotlabs/Update/_1254.php Normal file
View file

@ -0,0 +1,20 @@
<?php
namespace Zotlabs\Update;
use Zotlabs\Lib\Config;
class _1254 {
function run() {
q("UPDATE channel SET channel_notifyflags = channel_notifyflags + %d WHERE true",
intval(NOTIFY_RESHARE)
);
return UPDATE_SUCCESS;
}
function verify() {
return true;
}
}

View file

@ -20,7 +20,7 @@ use Zotlabs\Daemon\Run;
define ( 'STD_VERSION', '21.11.11' );
define ( 'ZOT_REVISION', '10.0' );
define ( 'DB_UPDATE_VERSION', 1253 );
define ( 'DB_UPDATE_VERSION', 1254 );
define ( 'PLATFORM_NAME', 'zap' );
define ( 'PLATFORM_ARCHITECTURE', 'zap' );
@ -415,6 +415,7 @@ define ( 'NOTIFY_TAGSELF', 0x0080 );
define ( 'NOTIFY_TAGSHARE', 0x0100 );
define ( 'NOTIFY_POKE', 0x0200 );
define ( 'NOTIFY_LIKE', 0x0400 );
define ( 'NOTIFY_RESHARE', 0x0800 );
define ( 'NOTIFY_SYSTEM', 0x8000 );

View file

@ -2536,20 +2536,24 @@ function send_status_notifications($post_id,$item) {
intval($item['uid'])
);
if($y)
if ($y) {
$notify = false;
}
if (intval($item['item_private']) === 2) {
$notify_type = NOTIFY_MAIL;
}
elseif (item['verb'] === 'Announce' || strpos($item['body'],'[/share]') !== false) {
$notify_type = NOTIFY_RESHARE;
}
else {
$notify_type = NOTIFY_COMMENT;
}
if(! $notify)
if (! $notify) {
return;
}
Enotify::submit(array(

View file

@ -140,6 +140,7 @@
{{*include file="field_intcheckbox.tpl" field=$notify2*}}
{{include file="field_intcheckbox.tpl" field=$notify3}}
{{include file="field_intcheckbox.tpl" field=$notify4}}
{{include file="field_intcheckbox.tpl" field=$notify10}}
{{*include file="field_intcheckbox.tpl" field=$notify9*}}
{{include file="field_intcheckbox.tpl" field=$notify5}}
{{*include file="field_intcheckbox.tpl" field=$notify6*}}