diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Daemon/Master.php | 5 | ||||
-rw-r--r-- | Zotlabs/Module/Ping.php | 14 |
2 files changed, 11 insertions, 8 deletions
diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php index 3a71ee578..0656ca05b 100644 --- a/Zotlabs/Daemon/Master.php +++ b/Zotlabs/Daemon/Master.php @@ -60,7 +60,8 @@ class Master { $k = explode('_',$worker['k']); q("delete from config where cat='queueworkers' and k='%s'", 'workerstarted_'.$k[1]); - q("update config set k='workitem' where cat='queuework' and k='%s'", + q("update config set k='%s' where cat='queuework' and k='%s'", + dbesc(uniqid('workitem:',true)), 'workitem_'.$k[1]); unset($workers[$idx]); } @@ -69,7 +70,7 @@ class Master { return false; } } - return uniqid(); + return uniqid('',true); } diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index bc6985301..2ad4f1277 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -634,18 +634,20 @@ class Ping extends \Zotlabs\Web\Controller { if($vnotify & VNOTIFY_FORUMS) { $forums = get_forum_channels(local_channel()); - if(! $forums) { - $result['forums'] = 0; - } - else { - + if($forums) { $perms_sql = item_permissions_sql(local_channel()) . item_normal(); $fcount = count($forums); $forums['total'] = 0; for($x = 0; $x < $fcount; $x ++) { + $ttype = TERM_FORUM; + $p = q("SELECT oid AS parent FROM term WHERE uid = " . intval(local_channel()) . " AND ttype = $ttype AND term = '" . dbesc($forums[$x]['xchan_name']) . "'"); + $p = ids_to_querystr($p, 'parent'); + + $pquery = (($p) ? "OR parent IN ( $p )" : ''); + $r = q("select sum(item_unseen) as unseen from item - where uid = %d and owner_xchan = '%s' and item_unseen = 1 $perms_sql ", + where uid = %d and ( owner_xchan = '%s' $pquery ) and item_unseen = 1 $perms_sql ", intval(local_channel()), dbesc($forums[$x]['xchan_hash']) ); |