undo comment policy override - there are a handful of stored posts from the 17th-June with a broken policy (which won't have a comment box) but it seems to be working for both recent and older posts.

This commit is contained in:
friendica 2013-06-18 18:48:41 -07:00
parent 6220ab4b54
commit 40c8e89d84
3 changed files with 17 additions and 14 deletions

View File

@ -45,10 +45,10 @@ class Item extends BaseObject {
if(($this->observer) && (! $this->writable)) { if(($this->observer) && (! $this->writable)) {
$this->commentable = can_comment_on_post($this->observer['xchan_hash'],$data); $this->commentable = can_comment_on_post($this->observer['xchan_hash'],$data);
if(! $this->commentable) { // if(! $this->commentable) {
logger('commentable: ' . $data['comment_policy']); // logger('commentable: ' . $data['comment_policy']);
$this->commentable = true; // $this->commentable = true;
} // }
} }
// logger('writable: ' . $this->writable); // logger('writable: ' . $this->writable);

View File

@ -6,7 +6,7 @@ require_once('include/items.php');
// is identical to the code in mod/message.php for 'item_extract_images' and // is identical to the code in mod/message.php for 'item_extract_images' and
// 'item_redir_and_replace_images' // 'item_redir_and_replace_images'
if(! function_exists('item_extract_images')) {
function item_extract_images($body) { function item_extract_images($body) {
$saved_image = array(); $saved_image = array();
@ -46,9 +46,9 @@ function item_extract_images($body) {
$new_body = $new_body . $orig_body; $new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image); return array('body' => $new_body, 'images' => $saved_image);
}} }
if(! function_exists('item_redir_and_replace_images')) {
function item_redir_and_replace_images($body, $images, $cid) { function item_redir_and_replace_images($body, $images, $cid) {
$origbody = $body; $origbody = $body;
@ -81,7 +81,7 @@ function item_redir_and_replace_images($body, $images, $cid) {
} }
return $newbody; return $newbody;
}} }
@ -826,7 +826,7 @@ function best_link_url($item) {
} }
if(! function_exists('item_photo_menu')){
function item_photo_menu($item){ function item_photo_menu($item){
$a = get_app(); $a = get_app();
$contact = null; $contact = null;
@ -893,9 +893,9 @@ function item_photo_menu($item){
elseif ($v!="") $o .= "<li><a href=\"$v\">$k</a></li>\n"; elseif ($v!="") $o .= "<li><a href=\"$v\">$k</a></li>\n";
} }
return $o; return $o;
}} }
if(! function_exists('like_puller')) {
function like_puller($a,$item,&$arr,$mode) { function like_puller($a,$item,&$arr,$mode) {
$url = ''; $url = '';
@ -923,7 +923,7 @@ function like_puller($a,$item,&$arr,$mode) {
$arr[$item['thr_parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author']['xchan_name'] . '</a>'; $arr[$item['thr_parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author']['xchan_name'] . '</a>';
} }
return; return;
}} }
// Format the like/dislike text for a profile item // Format the like/dislike text for a profile item
// $cnt = number of people who like/dislike the item // $cnt = number of people who like/dislike the item
@ -932,7 +932,7 @@ function like_puller($a,$item,&$arr,$mode) {
// $id = item id // $id = item id
// returns formatted text // returns formatted text
if(! function_exists('format_like')) {
function format_like($cnt,$arr,$type,$id) { function format_like($cnt,$arr,$type,$id) {
$o = ''; $o = '';
if($cnt == 1) if($cnt == 1)
@ -956,7 +956,7 @@ function format_like($cnt,$arr,$type,$id) {
$o .= "\t" . '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>'; $o .= "\t" . '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
} }
return $o; return $o;
}} }
function status_editor($a,$x,$popup=false) { function status_editor($a,$x,$popup=false) {

View File

@ -50,6 +50,8 @@ function notification($params) {
$additional_mail_header = ""; $additional_mail_header = "";
// We really should pass this through localize_item - but only if we have a complete item. We may only have a couple of elements.
if(array_key_exists('item',$params)) { if(array_key_exists('item',$params)) {
$title = $params['item']['title']; $title = $params['item']['title'];
$body = $params['item']['body']; $body = $params['item']['body'];
@ -352,6 +354,7 @@ function notification($params) {
logger('notification: sending notification email'); logger('notification: sending notification email');
$textversion = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n", $textversion = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n",
$body))),ENT_QUOTES,'UTF-8')); $body))),ENT_QUOTES,'UTF-8'));