summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-03-18 20:57:38 -0500
committerEvan Prodromou <evan@status.net>2010-03-18 20:57:38 -0500
commitac609e804078cf70fcc02b36aa1eb40115354715 (patch)
treec206723a0fe28fd62f8d2838f589a42ec7523af5 /classes/User.php
parent17c50f338ceb574780476f6b788f48e2d7d06017 (diff)
parent4a6c9e445149e42a4f81d5140296e7770c60bc6c (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Conflicts: plugins/OStatus/extlib/hkit/hkit.class.php plugins/OStatus/lib/discoveryhints.php
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php27
1 files changed, 5 insertions, 22 deletions
diff --git a/classes/User.php b/classes/User.php
index 16c256535..8ad2ec63d 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -153,19 +153,12 @@ class User extends Memcached_DataObject
return Sms_carrier::staticGet('id', $this->carrier);
}
+ /**
+ * @deprecated use Subscription::start($sub, $other);
+ */
function subscribeTo($other)
{
- $sub = new Subscription();
- $sub->subscriber = $this->id;
- $sub->subscribed = $other->id;
-
- $sub->created = common_sql_now(); // current time
-
- if (!$sub->insert()) {
- return false;
- }
-
- return true;
+ return Subscription::start($this->getProfile(), $other);
}
function hasBlocked($other)
@@ -346,17 +339,7 @@ class User extends Memcached_DataObject
common_log(LOG_WARNING, sprintf("Default user %s does not exist.", $defnick),
__FILE__);
} else {
- $defsub = new Subscription();
- $defsub->subscriber = $user->id;
- $defsub->subscribed = $defuser->id;
- $defsub->created = $user->created;
-
- $result = $defsub->insert();
-
- if (!$result) {
- common_log_db_error($defsub, 'INSERT', __FILE__);
- return false;
- }
+ Subscription::start($user, $defuser);
}
}