aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-22 18:41:10 -0800
committerfriendica <info@friendica.com>2015-01-22 18:41:10 -0800
commit6e0e3b2433fc426b758a55811f56536d58705813 (patch)
treea8d8fb7c63216cea94765e93be935f2b9d2fe227 /mod
parente46eba125888704b4381aa8418495e91eeb565c8 (diff)
downloadvolse-hubzilla-6e0e3b2433fc426b758a55811f56536d58705813.tar.gz
volse-hubzilla-6e0e3b2433fc426b758a55811f56536d58705813.tar.bz2
volse-hubzilla-6e0e3b2433fc426b758a55811f56536d58705813.zip
more expanding item flags
Diffstat (limited to 'mod')
-rw-r--r--mod/editpost.php2
-rw-r--r--mod/editwebpage.php2
-rw-r--r--mod/filer.php3
-rw-r--r--mod/item.php9
-rw-r--r--mod/viewsrc.php4
5 files changed, 7 insertions, 13 deletions
diff --git a/mod/editpost.php b/mod/editpost.php
index dfbc8766e..4ea0c9f2b 100644
--- a/mod/editpost.php
+++ b/mod/editpost.php
@@ -55,7 +55,7 @@ function editpost_content(&$a) {
- if($itm[0]['item_flags'] & ITEM_OBSCURED) {
+ if(intval($itm[0]['item_obscured'])) {
$key = get_config('system','prvkey');
if($itm[0]['title'])
$itm[0]['title'] = crypto_unencapsulate(json_decode_plus($itm[0]['title']),$key);
diff --git a/mod/editwebpage.php b/mod/editwebpage.php
index 191c9a9ac..d7969fb2d 100644
--- a/mod/editwebpage.php
+++ b/mod/editwebpage.php
@@ -95,7 +95,7 @@ function editwebpage_content(&$a) {
intval($owner)
);
- if($itm[0]['item_flags'] & ITEM_OBSCURED) {
+ if(intval($itm[0]['item_obscured'])) {
$key = get_config('system','prvkey');
if($itm[0]['title'])
$itm[0]['title'] = crypto_unencapsulate(json_decode_plus($itm[0]['title']),$key);
diff --git a/mod/filer.php b/mod/filer.php
index 9a409177c..e243687e3 100644
--- a/mod/filer.php
+++ b/mod/filer.php
@@ -27,8 +27,7 @@ function filer_content(&$a) {
intval(local_user())
);
if($r) {
- $x = q("update item set item_flags = ( item_flags | %d ) where id = %d and uid = %d",
- intval(ITEM_RETAINED),
+ $x = q("update item set item_retained = 1 where id = %d and uid = %d",
intval($r[0]['parent']),
intval(local_user())
);
diff --git a/mod/item.php b/mod/item.php
index a6ab99ef5..26985dea4 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -330,11 +330,6 @@ function item_post(&$a) {
$body = $_REQUEST['body'];
$item_flags = $orig_post['item_flags'];
- // force us to recalculate if we need to obscure this post
-
- if($item_flags & ITEM_OBSCURED)
- $item_flags = ($item_flags ^ ITEM_OBSCURED);
-
$item_restrict = $orig_post['item_restrict'];
$postopts = $orig_post['postopts'];
$created = $orig_post['created'];
@@ -765,13 +760,13 @@ function item_post(&$a) {
if($uid) {
if($channel['channel_hash'] === $datarray['author_xchan']) {
$datarray['sig'] = base64url_encode(rsa_sign($datarray['body'],$channel['channel_prvkey']));
- $datarray['item_flags'] = $datarray['item_flags'] | ITEM_VERIFIED;
+ $datarray['item_verified'] = 1;
}
}
logger('Encrypting local storage');
$key = get_config('system','pubkey');
- $datarray['item_flags'] = $datarray['item_flags'] | ITEM_OBSCURED;
+ $datarray['item_obscured'] = 1;
if($datarray['title'])
$datarray['title'] = json_encode(crypto_encapsulate($datarray['title'],$key));
if($datarray['body'])
diff --git a/mod/viewsrc.php b/mod/viewsrc.php
index 982d1c417..83acb1c23 100644
--- a/mod/viewsrc.php
+++ b/mod/viewsrc.php
@@ -21,14 +21,14 @@ function viewsrc_content(&$a) {
}
if(local_user() && $item_id) {
- $r = q("select item_flags, body from item where item_restrict = 0 and uid in (%d , %d) and id = %d limit 1",
+ $r = q("select id, item_flags, item_obscured, body from item where item_restrict = 0 and uid in (%d , %d) and id = %d limit 1",
intval(local_user()),
intval($sys['channel_id']),
intval($item_id)
);
if($r) {
- if($r[0]['item_flags'] & ITEM_OBSCURED)
+ if(intval($r[0]['item_obscured']))
$r[0]['body'] = crypto_unencapsulate(json_decode($r[0]['body'],true),get_config('system','prvkey'));
$o = (($json) ? json_encode($r[0]['body']) : str_replace("\n",'<br />',$r[0]['body']));
}