-
- $friend_profile = Profile::getKV('id', $friend_flink->user_id);
-
- 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_profile->nickname} to {$profile->nickname}.");
- } catch (Exception $e) {
- common_debug($this->name() .
- ' - Tried and failed subscribing ' .
- "{$friend_profile->nickname} to {$profile->nickname} - " .
- $e->getMessage());
- }
- }
+ $friend_profile = $friend_flink->getProfile();
+
+ Subscription::start($profile, $friend_profile);
+ common_log(LOG_INFO,
+ $this->name() . ' - Subscribed ' .
+ "{$friend_profile->nickname} to {$profile->nickname}.");
+ } catch (NoResultException $e) {
+ // either no foreign link for this friend's foreign ID or no profile found on local ID.
+ } catch (Exception $e) {
+ common_debug($this->name() .
+ ' - Tried and failed subscribing ' .
+ "{$friend_profile->nickname} to {$profile->nickname} - " .
+ $e->getMessage());