]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/shownotice.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / actions / shownotice.php
index 7be9618f864f7bc99f9e7199d4b9bf2c82101fa0..5b3ec93de10b64082bceb30bc5de46a4c3693c2d 100644 (file)
@@ -151,6 +151,7 @@ class ShownoticeAction extends OwnerDesignAction
           strtotime($this->avatar->modified) : 0;
 
         return 'W/"' . implode(':', array($this->arg('action'),
+                                          common_user_cache_hash(),
                                           common_language(),
                                           $this->notice->id,
                                           strtotime($this->notice->created),
@@ -167,7 +168,7 @@ class ShownoticeAction extends OwnerDesignAction
     function title()
     {
         if (!empty($this->profile->fullname)) {
-            $base = $this->profile->fullname . ' (' . $this->profile->nickname . ') ';
+            $base = $this->profile->fullname . ' (' . $this->profile->nickname . ')';
         } else {
             $base = $this->profile->nickname;
         }
@@ -277,12 +278,6 @@ class ShownoticeAction extends OwnerDesignAction
                                          'content' => $id->toString()));
         }
 
-        if ($user->jabbermicroid && $user->jabber && $this->notice->uri) {
-            $id = new Microid('xmpp:', $user->jabber,
-                              $this->notice->uri);
-            $this->element('meta', array('name' => 'microid',
-                                         'content' => $id->toString()));
-        }
         $this->element('link',array('rel'=>'alternate',
             'type'=>'application/json+oembed',
             'href'=>common_local_url(
@@ -297,10 +292,20 @@ 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_PROFILE_SIZE);
+        $this->element('meta', array('property' => 'og:image',
+                                     'content' => $avatarUrl));
+        $this->element('meta', array('property' => 'og:description',
+                                     'content' => $this->notice->content));
     }
 }
 
-class SingleNoticeItem extends NoticeListItem
+class SingleNoticeItem extends DoFollowListItem
 {
     /**
      * recipe function for displaying a single notice.
@@ -313,10 +318,14 @@ class SingleNoticeItem extends NoticeListItem
     function show()
     {
         $this->showStart();
-        $this->showNotice();
-        $this->showNoticeAttachments();
-        $this->showNoticeInfo();
-        $this->showNoticeOptions();
+        if (Event::handle('StartShowNoticeItem', array($this))) {
+            $this->showNotice();
+            $this->showNoticeAttachments();
+            $this->showNoticeInfo();
+            $this->showNoticeOptions();
+            Event::handle('EndShowNoticeItem', array($this));
+        }
+
         $this->showEnd();
     }