check comment permissions against observer, unbold email subject links for read messages

This commit is contained in:
friendica 2013-01-24 20:05:23 -08:00
parent 566dd55146
commit 99c40ce388
2 changed files with 13 additions and 16 deletions

View File

@ -512,29 +512,26 @@ class Item extends BaseObject {
* _ false on failure * _ false on failure
*/ */
private function get_comment_box($indent) { private function get_comment_box($indent) {
if(!$this->is_toplevel() && !get_config('system','thread_allow')) { if(!$this->is_toplevel() && !get_config('system','thread_allow')) {
return ''; return '';
} }
$comment_box = ''; $comment_box = '';
$conv = $this->get_conversation(); $conv = $this->get_conversation();
$template = get_markup_template($this->get_comment_box_template());
$ww = ''; $observer = get_app()->get_observer();
if( ($conv->get_mode() === 'network') && $this->is_wall_to_wall() ) if(! perm_is_allowed($conv->get_profile_owner(),$observer['xchan_hash'],'post_comments'))
$ww = 'ww'; return '';
if($conv->is_writable() && $this->is_writable()) { if($conv->is_writable() && $this->is_writable()) {
$a = $this->get_app(); $template = get_markup_template($this->get_comment_box_template());
$qc = $qcomment = null;
$a = $this->get_app();
$qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
$qcomment = (($qc) ? explode("\n",$qc) : null);
/*
* Hmmm, code depending on the presence of a particular plugin?
* This should be better if done by a hook
*/
if(in_array('qcomment',$a->plugins)) {
$qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
$qcomment = (($qc) ? explode("\n",$qc) : null);
}
$comment_box = replace_macros($template,array( $comment_box = replace_macros($template,array(
'$return_path' => '', '$return_path' => '',
'$threaded' => $this->is_threaded(), '$threaded' => $this->is_threaded(),
@ -559,8 +556,7 @@ class Item extends BaseObject {
'$edvideo' => t('Video'), '$edvideo' => t('Video'),
'$preview' => ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''), '$preview' => ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),
'$indent' => $indent, '$indent' => $indent,
'$sourceapp' => t($a->sourcename), '$sourceapp' => get_app()->sourcename
'$ww' => (($conv->get_mode() === 'network') ? $ww : '')
)); ));
} }

View File

@ -2244,6 +2244,7 @@ tr.mceLast {
margin-top: 10px; margin-top: 10px;
} }
a.mail-list-link { a.mail-list-link {
font-weight: normal;
display: block; display: block;
font-size: 1.3em; font-size: 1.3em;
padding: 4px 0; padding: 4px 0;