aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-01-23 20:56:11 -0800
committerfriendica <info@friendica.com>2012-01-23 20:56:11 -0800
commita76a497d924a16b8b07b126408db21655aac3bd6 (patch)
treeda677488f3ad710d223ae7e3ad68d1c695f46ada /include
parent1f074cb44c5deda5b480f5ff814ff3640ec843d0 (diff)
downloadvolse-hubzilla-a76a497d924a16b8b07b126408db21655aac3bd6.tar.gz
volse-hubzilla-a76a497d924a16b8b07b126408db21655aac3bd6.tar.bz2
volse-hubzilla-a76a497d924a16b8b07b126408db21655aac3bd6.zip
implement "moderate" flag on items
Diffstat (limited to 'include')
-rwxr-xr-xinclude/api.php6
-rwxr-xr-xinclude/delivery.php4
-rwxr-xr-xinclude/items.php4
-rwxr-xr-xinclude/notifier.php4
4 files changed, 9 insertions, 9 deletions
diff --git a/include/api.php b/include/api.php
index 08b28265c..7b8709659 100755
--- a/include/api.php
+++ b/include/api.php
@@ -650,7 +650,7 @@
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item`, `contact`
WHERE `item`.`uid` = %d
- AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+ AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra
@@ -707,7 +707,7 @@
FROM `item`, `contact`
WHERE `item`.`uid` = %d
AND `item`.`contact-id` = %d
- AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+ AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra
@@ -761,7 +761,7 @@
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item`, `contact`
WHERE `item`.`uid` = %d
- AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+ AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
AND `item`.`starred` = 1
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
diff --git a/include/delivery.php b/include/delivery.php
index 5441ac510..c05358868 100755
--- a/include/delivery.php
+++ b/include/delivery.php
@@ -84,7 +84,7 @@ function delivery_run($argv, $argc){
else {
// find ancestors
- $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
+ $r = q("SELECT * FROM `item` WHERE `id` = %d and visible = 1 and moderated = 0 LIMIT 1",
intval($item_id)
);
@@ -102,7 +102,7 @@ function delivery_run($argv, $argc){
$items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer`
- FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d ORDER BY `id` ASC",
+ FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d and visible = 1 and moderated = 0 ORDER BY `id` ASC",
intval($parent_id)
);
diff --git a/include/items.php b/include/items.php
index a939bfc88..21ee994dc 100755
--- a/include/items.php
+++ b/include/items.php
@@ -118,7 +118,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
`sign`.`signed_text`, `sign`.`signature`, `sign`.`signer`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id`
- WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`parent` != 0
+ WHERE `item`.`uid` = %d AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`parent` != 0
AND `item`.`wall` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND ( `item`.`edited` > '%s' OR `item`.`changed` > '%s' )
$sql_extra
@@ -1414,7 +1414,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
intval($item['uid'])
);
// who is the last child now?
- $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 AND `uid` = %d
+ $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 AND `moderated` = 0 AND `uid` = %d
ORDER BY `created` DESC LIMIT 1",
dbesc($item['parent-uri']),
intval($importer['uid'])
diff --git a/include/notifier.php b/include/notifier.php
index 1db1b09da..ead7aebad 100755
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -111,7 +111,7 @@ function notifier_run($argv, $argc){
else {
// find ancestors
- $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
+ $r = q("SELECT * FROM `item` WHERE `id` = %d and visible = 1 and moderated = 0 LIMIT 1",
intval($item_id)
);
@@ -128,7 +128,7 @@ function notifier_run($argv, $argc){
return;
$items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer`
- FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d ORDER BY `id` ASC",
+ FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d and visible = 1 and moderated = 0 ORDER BY `id` ASC",
intval($parent_id)
);