. */ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } /* Subscribe user $user to other user $other. * Note: $other must be a local user, not a remote profile. * Because the other way is quite a bit more complicated. */ function subs_subscribe_to($user, $other) { if (is_a($other, 'User')) { $other = $other->getProfile(); } try { Subscription::start($user->getProfile(), $other); return true; } catch (Exception $e) { return $e->getMessage(); } } function subs_unsubscribe_to($user, $other) { if (is_a($other, 'User')) { $other = $other->getProfile(); } try { Subscription::cancel($user->getProfile(), $other); return true; } catch (Exception $e) { return $e->getMessage(); } }