]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add helper metadata on individual notice pages to aid sharing to Facebook (use poster...
authorBrion Vibber <brion@pobox.com>
Fri, 1 Oct 2010 01:21:38 +0000 (18:21 -0700)
committerBrion Vibber <brion@pobox.com>
Fri, 1 Oct 2010 01:21:38 +0000 (18:21 -0700)
actions/shownotice.php

index c8e9cfe66a5ceb80d9154239b2d42febeff8879e..005335e3b4b281831bb2a01dada39c9733392d37 100644 (file)
@@ -298,6 +298,16 @@ class ShownoticeAction extends OwnerDesignAction
                 array(),
                 array('format'=>'xml','url'=>$this->notice->uri)),
             'title'=>'oEmbed'),null);
+
+        // Extras to aid in sharing notices to Facebook
+        $avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
+        $avatarUrl = ($avatar) ?
+                     $avatar->displayUrl() :
+                     Avatar::defaultImage($avatar_size);
+        $this->element('meta', array('property' => 'og:image',
+                                     'content' => $avatarUrl));
+        $this->element('meta', array('property' => 'og:description',
+                                     'content' => $this->notice->content));
     }
 }