]> git.mxchange.org Git - friendica.git/blobdiff - mod/like.php
Merge branch 'pull'
[friendica.git] / mod / like.php
index c07f3097ea43fbdf6c8ae6f77c2ab2d5edc75f4b..2876302122d78db7dbcb9df87f3ddcf75f92c215 100644 (file)
@@ -19,14 +19,10 @@ function like_content(&$a) {
 
        switch($verb) {
                case 'like':
-                       $activity = ACTIVITY_LIKE;
-                       break;
-               case 'dislike':
-                       $activity = ACTIVITY_DISLIKE;
-                       break;
                case 'unlike':
                        $activity = ACTIVITY_LIKE;
                        break;
+               case 'dislike':
                case 'undislike':
                        $activity = ACTIVITY_DISLIKE;
                        break;
@@ -124,9 +120,9 @@ function like_content(&$a) {
        </object>
 EOT;
        if($verb === 'like')
-               $bodyverb = t('likes');
+               $bodyverb = t('%1$s likes %2$s\'s %3$s');
        if($verb === 'dislike')
-               $bodyverb = t('doesn\'t like');
+               $bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
 
        if(! isset($bodyverb))
                        return; 
@@ -147,9 +143,11 @@ EOT;
        $arr['author-name'] = $contact['name'];
        $arr['author-link'] = $contact['url'];
        $arr['author-avatar'] = $contact['thumb'];
-       $arr['body'] = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' . ' ' . $bodyverb . ' ' 
-               . '[url=' . $item['author-link'] . ']' . sprintf(t("%s's"),$item['author-name']) . '[/url]' . ' '
-               . '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]' ;
+       
+       $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
+       $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
+       $plink = '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
+       $arr['body'] =  sprintf( $bodyverb, $ulink, $alink, $plink );
 
        $arr['verb'] = $activity;
        $arr['object-type'] = $objtype;
@@ -171,6 +169,10 @@ EOT;
                );
        }                       
 
+       $arr['id'] = $post_id;
+
+       call_hooks('post_local_end', $arr);
+
        proc_run('php',"include/notifier.php","like","$post_id");
 
        return; // NOTREACHED