]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Adopted merge request #232 from statusnet to gnusocial
authorpztrn <pztrn@pztrn.name>
Sat, 5 Oct 2013 08:36:48 +0000 (12:36 +0400)
committerpztrn <pztrn@pztrn.name>
Sat, 5 Oct 2013 08:36:48 +0000 (12:36 +0400)
lib/implugin.php
plugins/Xmpp/XmppPlugin.php

index 3eba3469fd80517704f964d910736a52789da5a7..a6a9a3dad95fde75e94de6a7dca3f0b1b5242b68 100644 (file)
@@ -373,7 +373,16 @@ abstract class ImPlugin extends Plugin
     function formatNotice($notice)
     {
         $profile = $notice->getProfile();
-        return $profile->nickname . ': ' . $notice->content . ' [' . $notice->id . ']';
+        $nicknames = $profile->nickname;
+        if (!empty($notice->reply_to)) {
+            $orig_notice = $notice->getParent();
+            $orig_profile = $orig_notice->getProfile();
+            $nicknames = $nicknames . " => " . $orig_profile->nickname;
+        }
+        common_log(LOG_INFO, "Notice: " . $notice->content, __FILE__);
+        $data = $nicknames . ': ' . $notice->content . ' [' . $notice->id . ']';
+        return $data;
+
     }
     //========================UTILITY FUNCTIONS USEFUL TO IMPLEMENTATIONS - RECEIVING ========================\
 
index 51139a6684d095740cd999eaf0f3e843944dd928..3d20c14c4c82bc178e07254d4bac48c64a628c36 100644 (file)
@@ -346,8 +346,18 @@ class XmppPlugin extends ImPlugin
         $xs->elementStart('body', array('xmlns' => 'http://www.w3.org/1999/xhtml'));
         $xs->element('a', array('href' => $profile->profileurl),
                      $profile->nickname);
-        $xs->text(": ");
+        if (!empty($notice->reply_to)) {
+            $orig_notice = Notice::getKV('id', $notice->reply_to);
+            $orig_profile = $orig_notice->getProfile();
+            $xs->text(" => ");
+            $xs->element('a', array('href' => $orig_profile->profileurl),
+                $orig_profile->nickname);
+            $xs->text(": ");
+        } else {
+            $xs->text(": ");
+        }
         if (!empty($notice->rendered)) {
+            $notice->rendered = str_replace("\t", "", $notice->rendered);
             $xs->raw($notice->rendered);
         } else {
             $xs->raw(common_render_content($notice->content, $notice));