aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php29
1 files changed, 20 insertions, 9 deletions
diff --git a/include/zot.php b/include/zot.php
index 34e7f3e42..a677da808 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1110,13 +1110,18 @@ function zot_import($arr, $sender_url) {
logger('specific recipients');
$recip_arr = array();
foreach($i['notify']['recipients'] as $recip) {
- $recip_arr[] = make_xchan_hash($recip['guid'],$recip['guid_sig']);
+ if(is_array($recip)) {
+ $recip_arr[] = make_xchan_hash($recip['guid'],$recip['guid_sig']);
+ }
+ }
+ $r = false;
+ if($recip_arr) {
+ stringify_array_elms($recip_arr);
+ $recips = implode(',',$recip_arr);
+ $r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and not ( channel_pageflags & %d ) > 0 ",
+ intval(PAGE_REMOVED)
+ );
}
- stringify_array_elms($recip_arr);
- $recips = implode(',',$recip_arr);
- $r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and not ( channel_pageflags & %d ) > 0 ",
- intval(PAGE_REMOVED)
- );
if(! $r) {
logger('recips: no recipients on this site');
continue;
@@ -1272,7 +1277,8 @@ function public_recips($msg) {
$include_sys = false;
if($msg['message']['type'] === 'activity') {
- $include_sys = true;
+ if(! get_config('system','disable_discover_tab'))
+ $include_sys = true;
$col = 'channel_w_stream';
$field = PERMS_W_STREAM;
if(array_key_exists('flags',$msg['message']) && in_array('thread_parent', $msg['message']['flags'])) {
@@ -2887,7 +2893,12 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
}
if(array_key_exists('channel',$arr) && is_array($arr['channel']) && count($arr['channel'])) {
- $disallowed = array('channel_id','channel_account_id','channel_primary','channel_prvkey', 'channel_address', 'channel_notifyflags');
+ if(array_key_exists('channel_removed',$arr['channel']))
+ $arr['channel_pageflags'] |= PAGE_REMOVED;
+ if(array_key_exists('channel_system',$arr['channel']))
+ $arr['channel_pageflags'] |= PAGE_SYSTEM;
+
+ $disallowed = array('channel_id','channel_account_id','channel_primary','channel_prvkey', 'channel_address', 'channel_notifyflags', 'channel_removed', 'channel_system');
$clean = array();
foreach($arr['channel'] as $k => $v) {
@@ -3200,7 +3211,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
}
if(count($clean)) {
foreach($clean as $k => $v) {
- $r = dbq("UPDATE profile set " . dbesc($k) . " = '" . dbesc($v)
+ $r = dbq("UPDATE profile set `" . dbesc($k) . "` = '" . dbesc($v)
. "' where profile_guid = '" . dbesc($profile['profile_guid']) . "' and uid = " . intval($channel['channel_id']));
}
}