summaryrefslogtreecommitdiff
path: root/classes/Subscription.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-03-18 17:11:06 -0700
committerZach Copley <zach@status.net>2010-03-18 17:11:06 -0700
commita6c9445f0de1a74ffc81dda12eaba6ee36410716 (patch)
tree873d6a67626ef324c0102153c6a027291767b878 /classes/Subscription.php
parent051bee988caa4a8d3648fae9f963cb35d26c13c5 (diff)
parent1301877dfe89c57c182246c0d7ba0ff6335fd17b (diff)
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline: OStatus discover fixes: Remove xpm support (no one really uses it, and IMAGETYPE_XPM is undefined, causing warnings) Fix notice warning about unused var -- was renamed during refactoring.
Diffstat (limited to 'classes/Subscription.php')
-rw-r--r--classes/Subscription.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/classes/Subscription.php b/classes/Subscription.php
index 97c44a2e4..60c12cccc 100644
--- a/classes/Subscription.php
+++ b/classes/Subscription.php
@@ -62,6 +62,14 @@ class Subscription extends Memcached_DataObject
static function start($subscriber, $other)
{
+ // @fixme should we enforce this as profiles in callers instead?
+ if ($subscriber instanceof User) {
+ $subscriber = $subscriber->getProfile();
+ }
+ if ($other instanceof User) {
+ $other = $other->getProfile();
+ }
+
if (!$subscriber->hasRight(Right::SUBSCRIBE)) {
throw new Exception(_('You have been banned from subscribing.'));
}