forked from GNUsocial/gnu-social
Make better use of Subscription class
removed lib/subs.php as it was essentially only a wrapper for Subscription
This commit is contained in:
@@ -203,7 +203,7 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = $flink->getUser();
|
||||
$profile = $flink->getProfile();
|
||||
|
||||
foreach ($friends as $friend) {
|
||||
|
||||
@@ -228,20 +228,20 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
|
||||
|
||||
// Get associated user and subscribe her
|
||||
|
||||
$friend_user = User::getKV('id', $friend_flink->user_id);
|
||||
$friend_profile = Profile::getKV('id', $friend_flink->user_id);
|
||||
|
||||
if (!empty($friend_user)) {
|
||||
$result = subs_subscribe_to($user, $friend_user);
|
||||
|
||||
if ($result === true) {
|
||||
if ($friend_profile instanceof Profile) {
|
||||
try {
|
||||
$other = Profile::getKV('id', $invites->user_id);
|
||||
Subscription::start($profile, $friend_profile);
|
||||
common_log(LOG_INFO,
|
||||
$this->name() . ' - Subscribed ' .
|
||||
"$friend_user->nickname to $user->nickname.");
|
||||
} else {
|
||||
"{$friend_profile->nickname} to {$profile->nickname}.");
|
||||
} catch (Exception $e) {
|
||||
common_debug($this->name() .
|
||||
' - Tried subscribing ' .
|
||||
"$friend_user->nickname to $user->nickname - " .
|
||||
$result);
|
||||
' - Tried and failed subscribing ' .
|
||||
"{$friend_profile->nickname} to {$profile->nickname} - " .
|
||||
$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user