]> git.mxchange.org Git - friendica.git/commitdiff
better handling of FB like activity object
authorFriendika <info@friendika.com>
Tue, 26 Apr 2011 23:37:26 +0000 (16:37 -0700)
committerFriendika <info@friendika.com>
Tue, 26 Apr 2011 23:37:26 +0000 (16:37 -0700)
addon/facebook/facebook.php
boot.php

index c48621e2cc60a3af03dea31f8b2a010079f7262b..e3b15c528455ef3263282b8ae68161602950fabe 100644 (file)
@@ -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);                  
                        }
                }
index b521735f885faedcbb27186812ddc80f7651500f..ed68a11d348564fb5f523049ce939f9557b68504 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
 
 set_time_limit(0);
 
-define ( 'FRIENDIKA_VERSION',      '2.1.960' );
+define ( 'FRIENDIKA_VERSION',      '2.1.961' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1053      );