fixing conversation updates

This commit is contained in:
friendica 2011-11-24 16:42:12 -08:00
parent 8aae7f047d
commit 9e8053e3bd
6 changed files with 17 additions and 19 deletions

View file

@ -291,7 +291,8 @@ function conversation(&$a, $items, $mode, $update) {
$arr = array('item' => $item, 'output' => $tmp_item); $arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr); call_hooks('display_item', $arr);
$threads[$threadsid] .= $arr['output']; $threads[$threadsid]['id'] = $threadsid;
$threads[$threadsid]['html'] .= $arr['output'];
} }
@ -374,7 +375,9 @@ function conversation(&$a, $items, $mode, $update) {
$comments_collapsed = false; $comments_collapsed = false;
$threadsid++; $threadsid++;
$threads[$threadsid] = ""; $threads[$threadsid]['id'] = $threadsid;
$threads[$threadsid]['html'] = "";
} }
else { else {
// prevent private email from leaking into public conversation // prevent private email from leaking into public conversation
@ -393,7 +396,7 @@ function conversation(&$a, $items, $mode, $update) {
// IMPORTANT: the closing </div> in the hide_comments template // IMPORTANT: the closing </div> in the hide_comments template
// is supplied below in code. // is supplied below in code.
$threads[$threadsid] .= replace_macros($hide_comments_tpl,array( $threads[$threadsid]['html'] .= replace_macros($hide_comments_tpl,array(
'$id' => $item['parent'], '$id' => $item['parent'],
'$num_comments' => sprintf( tt('%d comment','%d comments',$comments[$item['parent']]), '$num_comments' => sprintf( tt('%d comment','%d comments',$comments[$item['parent']]),
$comments[$item['parent']]), $comments[$item['parent']]),
@ -404,7 +407,7 @@ function conversation(&$a, $items, $mode, $update) {
} }
} }
if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) { if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) {
$threads[$threadsid] .= '</div>'; $threads[$threadsid]['html'] .= '</div>';
} }
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
@ -621,17 +624,12 @@ function conversation(&$a, $items, $mode, $update) {
$arr = array('item' => $item, 'output' => $tmp_item); $arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr); call_hooks('display_item', $arr);
$threads[$threadsid] .= $arr['output']; $threads[$threadsid]['html'] .= $arr['output'];
} }
} }
} }
// if author collapsing is in force but didn't get closed, close it off now.
/*if($blowhard_count >= 3)
$threads[$threadsid] .= '</div>';*/
$page_template = get_markup_template("conversation.tpl"); $page_template = get_markup_template("conversation.tpl");
$o .= replace_macros($page_template, array( $o .= replace_macros($page_template, array(
'$threads' => $threads, '$threads' => $threads,

View file

@ -233,7 +233,7 @@
// $('#' + ident).hide(); // $('#' + ident).hide();
// } // }
//}); //});
$('.wall-item-outside-wrapper',data).each(function() { $('.tread-wrapper',data).each(function() {
var ident = $(this).attr('id'); var ident = $(this).attr('id');
if($('#' + ident).length == 0) { if($('#' + ident).length == 0) {
$('img',this).each(function() { $('img',this).each(function() {

View file

@ -1,6 +1,6 @@
{{ for $threads as $thread }} {{ for $threads as $thread }}
<div class="tread-wrapper"> <div id="tread-wrapper-$thread.id" class="tread-wrapper">
$thread $thread.html
</div> </div>
{{ endfor }} {{ endfor }}

View file

@ -1,6 +1,6 @@
{{ for $threads as $thread }} {{ for $threads as $thread }}
<div class="tread-wrapper"> <div id="tread-wrapper-$thread.id" class="tread-wrapper">
$thread $thread.html
</div> </div>
{{ endfor }} {{ endfor }}

View file

@ -1,6 +1,6 @@
{{ for $threads as $thread }} {{ for $threads as $thread }}
<div class="tread-wrapper"> <div id="tread-wrapper-$thread.id" class="tread-wrapper">
$thread $thread.html
</div> </div>
{{ endfor }} {{ endfor }}

View file

@ -1,6 +1,6 @@
{{ for $threads as $thread }} {{ for $threads as $thread }}
<div class="tread-wrapper"> <div id="tread-wrapper-$thread.id" class="tread-wrapper">
$thread $thread.html
</div> </div>
{{ endfor }} {{ endfor }}