aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-12-07 20:47:53 -0800
committerFriendika <info@friendika.com>2010-12-07 20:47:53 -0800
commita42b9ea3dea5e1490dd4aa4852760354d569ea51 (patch)
treec0a99dd7bbc6b479b040a8ef08cabee5f0f56e38 /mod/item.php
parente241c401cf21108f39f67e54f64f50ad139af221 (diff)
downloadvolse-hubzilla-a42b9ea3dea5e1490dd4aa4852760354d569ea51.tar.gz
volse-hubzilla-a42b9ea3dea5e1490dd4aa4852760354d569ea51.tar.bz2
volse-hubzilla-a42b9ea3dea5e1490dd4aa4852760354d569ea51.zip
display the fact that a conversation is private without disclosing the details of who can/cannot see it.
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/mod/item.php b/mod/item.php
index 504856d7d..ea88e6c31 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -53,6 +53,8 @@ function item_post(&$a) {
$str_group_deny = perms2str($_POST['group_deny']);
$str_contact_deny = perms2str($_POST['contact_deny']);
+ $private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0);
+
$title = notags(trim($_POST['title']));
$body = escape_tags(trim($_POST['body']));
$location = notags(trim($_POST['location']));
@@ -195,8 +197,8 @@ function item_post(&$a) {
$r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`,
- `tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
- VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
+ `tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private` )
+ VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d )",
intval($profile_uid),
dbesc($post_type),
intval($wall),
@@ -222,7 +224,8 @@ function item_post(&$a) {
dbesc($str_contact_allow),
dbesc($str_group_allow),
dbesc($str_contact_deny),
- dbesc($str_group_deny)
+ dbesc($str_group_deny),
+ intval($private)
);
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",
dbesc($uri));
@@ -241,12 +244,13 @@ function item_post(&$a) {
// Inherit ACL's from the parent item.
// TODO merge with subsequent UPDATE operation and save a db write
- $r = q("UPDATE `item` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'
+ $r = q("UPDATE `item` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `private` = %d
WHERE `id` = %d LIMIT 1",
dbesc($parent_item['allow_cid']),
dbesc($parent_item['allow_gid']),
dbesc($parent_item['deny_cid']),
dbesc($parent_item['deny_gid']),
+ intval($parent_item['private']),
intval($post_id)
);