X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FProfile.php;h=78ef18484c7e0d9f7c9f2559cb419783f39fd1ad;hb=20592f184d759c3e6f68165ea7b94a330853eaef;hp=09f9ca71d109933db6509cb883ec1bee866d222c;hpb=6f62adedfc44306e1df2a63e030f8b29e334f3a2;p=quix0rs-gnu-social.git diff --git a/classes/Profile.php b/classes/Profile.php index 09f9ca71d1..78ef18484c 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -144,7 +144,7 @@ class Profile extends Managed_DataObject public function hasPassword() { try { - return !empty($this->getUser()->hasPassword()); + return $this->getUser()->hasPassword(); } catch (NoSuchUserException $e) { return false; } @@ -1242,8 +1242,9 @@ class Profile extends Managed_DataObject { // XXX: not really a pkey, but should work - $notice = Notice::pkeyGet(array('profile_id' => $this->id, - 'repeat_of' => $notice->id)); + $notice = Notice::pkeyGet(array('profile_id' => $this->getID(), + 'repeat_of' => $notice->getID(), + 'verb' => ActivityVerb::SHARE)); return !empty($notice); } @@ -1593,8 +1594,20 @@ class Profile extends Managed_DataObject return $this; } - public function sameAs(Profile $other) + /** + * Test whether the given profile is the same as the current class, + * for testing identities. + * + * @param Profile $other The other profile, usually from Action's $this->scoped + * + * @return boolean + */ + public function sameAs(Profile $other=null) { + if (is_null($other)) { + // In case $this->scoped is null or something, i.e. not a current/legitimate profile. + return false; + } return $this->getID() === $other->getID(); }