X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fimplugin.php;h=4ee9d854663e22cd240df05d189da15b28a938b4;hb=d2104b89d93d40bf68884055196340465f3f6497;hp=3eba3469fd80517704f964d910736a52789da5a7;hpb=2a4dc77a633cc78907934fd93200ac16d55be78e;p=quix0rs-gnu-social.git diff --git a/lib/implugin.php b/lib/implugin.php index 3eba3469fd..4ee9d85466 100644 --- a/lib/implugin.php +++ b/lib/implugin.php @@ -84,7 +84,7 @@ abstract class ImPlugin extends Plugin * * @return boolean success value */ - function sendNotice($screenname, $notice) + function sendNotice($screenname, Notice $notice) { return $this->sendMessage($screenname, $this->formatNotice($notice)); } @@ -370,10 +370,19 @@ abstract class ImPlugin extends Plugin * @return string plain-text version of the notice, with user nickname prefixed */ - function formatNotice($notice) + protected function formatNotice(Notice $notice) { $profile = $notice->getProfile(); - return $profile->nickname . ': ' . $notice->content . ' [' . $notice->id . ']'; + + try { + $parent = $notice->getParent(); + $orig_profile = $parent->getProfile(); + $nicknames = sprintf('%1$s => %2$s', $profile->nickname, $orig_profile->nickname); + } catch (Exception $e) { + $nicknames = $profile->nickname; + } + + return sprintf('%1$s: %2$s [%3$u]', $nicknames, $notice->content, $notice->id); } //========================UTILITY FUNCTIONS USEFUL TO IMPLEMENTATIONS - RECEIVING ========================\