Tidying up getUser calls to profiles and some events

getUser calls are much more strict, and one place where this was found was
in the (un)subscribe start/end event handlers, which resulted in making the
Subscription class a bit stricter, regarding ::start and ::cancel at least.
Several minor fixes in many files were made due to this.

This does NOT touch the Foreign_link function, which should also have a more
strict getUser call. That is a future project.
This commit is contained in:
Mikael Nordfeldth
2013-09-09 21:35:16 +02:00
parent c5bf6cb05e
commit 747fe9d59b
20 changed files with 317 additions and 236 deletions

View File

@@ -225,14 +225,6 @@ class User extends Managed_DataObject
return Sms_carrier::getKV('id', $this->carrier);
}
/**
* @deprecated use Subscription::start($sub, $other);
*/
function subscribeTo($other)
{
return Subscription::start($this->getProfile(), $other);
}
function hasBlocked($other)
{
$profile = $this->getProfile();
@@ -437,7 +429,7 @@ class User extends Managed_DataObject
common_log(LOG_WARNING, sprintf("Default user %s does not exist.", $defnick),
__FILE__);
} else {
Subscription::start($user, $defuser);
Subscription::start($profile, $defuser->getProfile());
}
}
@@ -594,7 +586,7 @@ class User extends Managed_DataObject
return Profile_tag::setTags($this->id, $this->id, $newtags, $privacy);
}
function block($other)
function block(Profile $other)
{
// Add a new block record