X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fimplugin.php;h=457c9dba5252d9528c3d5eb0568e97820d3d3cd6;hb=56e2b0007c00b85b80c85da072def1f9e832e05b;hp=6395ecbdb79155cde5cf9018e7418cbb4826c7ed;hpb=01a4ab30dc1dfbf4d6ee6a42a7f8f45a1a42894d;p=quix0rs-gnu-social.git diff --git a/lib/implugin.php b/lib/implugin.php index 6395ecbdb7..457c9dba52 100644 --- a/lib/implugin.php +++ b/lib/implugin.php @@ -243,11 +243,11 @@ abstract class ImPlugin extends Plugin * * @param string $screenname screenname sending to * @param string $code the confirmation code - * @param User $user user sending to + * @param Profile $target For whom the code is valid for * * @return boolean success value */ - function sendConfirmationCode($screenname, $code, $user) + function sendConfirmationCode($screenname, $code, Profile $target) { // TRANS: Body text for confirmation code e-mail. // TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename, @@ -258,7 +258,7 @@ abstract class ImPlugin extends Plugin ' . (If you cannot click it, copy-and-paste it into the ' . 'address bar of your browser). If that user is not you, ' . 'or if you did not request this confirmation, just ignore this message.'), - $user->nickname, common_config('site', 'name'), $this->getDisplayName(), common_local_url('confirmaddress', null, array('code' => $code))); + $target->getNickname(), common_config('site', 'name'), $this->getDisplayName(), common_local_url('confirmaddress', null, array('code' => $code))); return $this->sendMessage($screenname, $body); } @@ -364,13 +364,16 @@ abstract class ImPlugin extends Plugin protected function formatNotice(Notice $notice) { $profile = $notice->getProfile(); + $nicknames = $profile->getNickname(); try { $parent = $notice->getParent(); $orig_profile = $parent->getProfile(); - $nicknames = sprintf('%1$s => %2$s', $profile->nickname, $orig_profile->nickname); + $nicknames = sprintf('%1$s => %2$s', $profile->getNickname(), $orig_profile->getNickname()); } catch (NoParentNoticeException $e) { - $nicknames = $profile->nickname; + // Not a reply, no parent notice stored + } catch (NoResultException $e) { + // Parent notice was probably deleted } return sprintf('%1$s: %2$s [%3$u]', $nicknames, $notice->content, $notice->id); @@ -594,11 +597,11 @@ abstract class ImPlugin extends Plugin 'daemonScreenname' => $this->daemonScreenname()); } - function onSendImConfirmationCode($transport, $screenname, $code, $user) + function onSendImConfirmationCode($transport, $screenname, $code, Profile $target) { if($transport == $this->transport) { - $this->sendConfirmationCode($screenname, $code, $user); + $this->sendConfirmationCode($screenname, $code, $target); return false; } }