aboutsummaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-04-26 16:37:26 -0700
committerFriendika <info@friendika.com>2011-04-26 16:37:26 -0700
commit1222362ba0e441c0a63c27db7f257527bf643939 (patch)
tree4bc3b4cac57ee9e0ba30039e0c8cf6dc77bdddbb /addon
parent5c34a8b21920871cf35fe1ff00e54f2d446a60ca (diff)
downloadvolse-hubzilla-1222362ba0e441c0a63c27db7f257527bf643939.tar.gz
volse-hubzilla-1222362ba0e441c0a63c27db7f257527bf643939.tar.bz2
volse-hubzilla-1222362ba0e441c0a63c27db7f257527bf643939.zip
better handling of FB like activity object
Diffstat (limited to 'addon')
-rw-r--r--addon/facebook/facebook.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php
index c48621e2c..e3b15c528 100644
--- a/addon/facebook/facebook.php
+++ b/addon/facebook/facebook.php
@@ -646,7 +646,17 @@ function fb_consume_stream($uid,$j,$wall = false) {
$likedata['author-name'] = $likes->name;
$likedata['author-link'] = 'http://facebook.com/profile.php?id=' . $likes->id;
$likedata['author-avatar'] = 'https://graph.facebook.com/' . $likes->id . '/picture';
- $likedata['body'] = sprintf( t('%1$s likes %2$s\'s %3$s'), $likes->name, $orig_post['author-name'], t('post'));
+
+ $author = '[url=' . $likedata['author-link'] . ']' . $likedata['author-name'] . '[/url]';
+ $objauthor = '[url=' . $orig_post['author-link'] . ']' . $orig_post['author-name'] . '[/url]';
+ $post_type = t('status');
+ $plink = '[url=' . $orig_post['plink'] . ']' . $post_type . '[/url]';
+ $likedata['object-type'] = ACTIVITY_OBJ_NOTE;
+
+ $likedata['body'] = sprintf( t('%1$s likes %2$s\'s %3$s'), $author, $objauthor, $plink);
+ $likedata['object'] = '<object><type>' . ACTIVITY_OBJ_NOTE . '</type><local>1</local>' .
+ '<id>' . $orig_post['uri'] . '</id><link>' . xmlify('<link rel="alternate" type="text/html" href="' . $orig_post['plink'] . '">') . '</link><title>' . $orig_post['title'] . '</title><content>' . $orig_post['body'] . '</content></object>';
+
$item = item_store($likedata);
}
}