diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/item.php | 15 | ||||
-rw-r--r-- | mod/photos.php | 18 |
2 files changed, 19 insertions, 14 deletions
diff --git a/mod/item.php b/mod/item.php index f1fbd53b3..d6a7789dd 100644 --- a/mod/item.php +++ b/mod/item.php @@ -588,7 +588,6 @@ function item_post(&$a) { $datarray['app'] = $app; $datarray['location'] = $location; $datarray['coord'] = $coord; - $datarray['inform'] = $inform; $datarray['verb'] = $verb; $datarray['allow_cid'] = $str_contact_allow; $datarray['allow_gid'] = $str_group_allow; @@ -642,6 +641,13 @@ function item_post(&$a) { $datarray['body'] = z_input_filter($datarray['uid'],$datarray['body'],$datarray['mimetype']); + if(local_user()) { + 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; + } + } + logger('Encrypting local storage'); $key = get_config('system','pubkey'); $datarray['item_flags'] = $datarray['item_flags'] | ITEM_OBSCURED; @@ -651,17 +657,16 @@ function item_post(&$a) { $datarray['body'] = json_encode(aes_encapsulate($datarray['body'],$key)); } - - - if($orig_post) { - $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `mimetype` = '%s', `attach` = '%s', `edited` = '%s', layout_mid = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", + $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `mimetype` = '%s', `attach` = '%s', `edited` = '%s', layout_mid = '%s', sig = '%s', item_flags = %d WHERE `id` = %d AND `uid` = %d LIMIT 1", dbesc($datarray['title']), dbesc($datarray['body']), dbesc($datarray['mimetype']), dbesc($datarray['attach']), dbesc(datetime_convert()), dbesc($layout_mid), + dbesc($datarray['sig']), + intval($item_flags), intval($post_id), intval($profile_uid) ); diff --git a/mod/photos.php b/mod/photos.php index 8e63a42ea..45c8e67c6 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -454,15 +454,15 @@ function photos_post(&$a) { if(strlen($newinform) && strlen($inform)) $newinform .= ','; $newinform .= $inform; - - $r = q("UPDATE `item` SET `tag` = '%s', `inform` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", - dbesc($newtag), - dbesc($newinform), - dbesc(datetime_convert()), - dbesc(datetime_convert()), - intval($item_id), - intval($page_owner_uid) - ); +//FIXME - inform is gone +// $r = q("UPDATE `item` SET `tag` = '%s', `inform` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", +// dbesc($newtag), +// dbesc($newinform), +// dbesc(datetime_convert()), +// dbesc(datetime_convert()), +// intval($item_id), +// intval($page_owner_uid) +// ); $best = 0; foreach($p as $scales) { |