aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael Vogel <icarus@dabo.de>2012-04-11 19:31:01 +0200
committerMichael Vogel <icarus@dabo.de>2012-04-11 19:31:01 +0200
commitc88c2515e43f7a446a9b358fb657290a8a6c847a (patch)
treed3be51f9fc24d2a735b55cf4f32fece22b9ceb6b /include
parentfe257a20324fe68838e5829e19d18777045a41b4 (diff)
downloadvolse-hubzilla-c88c2515e43f7a446a9b358fb657290a8a6c847a.tar.gz
volse-hubzilla-c88c2515e43f7a446a9b358fb657290a8a6c847a.tar.bz2
volse-hubzilla-c88c2515e43f7a446a9b358fb657290a8a6c847a.zip
API: Improved the timeline. Several (disabled) tests with caching of photos.
Diffstat (limited to 'include')
-rw-r--r--include/api.php15
-rw-r--r--include/conversation.php5
2 files changed, 12 insertions, 8 deletions
diff --git a/include/api.php b/include/api.php
index ab83d63be..0885a1434 100644
--- a/include/api.php
+++ b/include/api.php
@@ -1233,8 +1233,17 @@
$in_reply_to_status_id = 0;
}
+ // Workaround for ostatus messages where the title is identically to the body
+ $statusbody = trim(html2plain(bbcode($item['body']), 0));
+ $statustitle = trim($item['title']);
+
+ if (($statustitle != '') and (strpos($statusbody, $statustitle) !== false))
+ $statustext = trim($statusbody);
+ else
+ $statustext = trim($statustitle."\n\n".$statusbody);
+
$status = array(
- 'text' => trim($item['title']." \n".html2plain(bbcode($item['body']), 0)),
+ 'text' => $statustext,
'truncated' => False,
'created_at'=> api_date($item['created']),
'in_reply_to_status_id' => $in_reply_to_status_id,
@@ -1245,8 +1254,8 @@
'geo' => '',
'favorited' => $item['starred'] ? true : false,
'user' => $status_user ,
- 'statusnet_html' => bbcode($item['body']),
- 'statusnet_conversation_id' => 0,
+ 'statusnet_html' => trim(bbcode($item['body'])),
+ 'statusnet_conversation_id' => $item['parent'],
);
// Seesmic doesn't like the following content
diff --git a/include/conversation.php b/include/conversation.php
index df92a40ed..a32cbeb8b 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -626,10 +626,6 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
else
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb);
-
-
-
-
$like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
$dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
@@ -1089,4 +1085,3 @@ function render_location_google($item) {
}
return $location;
}
-