public function hasPassword()
{
try {
- return !empty($this->getUser()->hasPassword());
+ return $this->getUser()->hasPassword();
} catch (NoSuchUserException $e) {
return false;
}
{
// 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);
}
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();
}