X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fsubs.php;h=165bbaa8ff7a4bbdc09429f3b703e55d6407846d;hb=31b29fde50e9664e1b70064c043879ce87553883;hp=e2ce0667eb19f78e3c2e9f5aed9fb0fdcc76df47;hpb=ddf3614c843bcd8d9ecfd0850ac9a8cefae6dbba;p=quix0rs-gnu-social.git diff --git a/lib/subs.php b/lib/subs.php index e2ce0667eb..165bbaa8ff 100644 --- a/lib/subs.php +++ b/lib/subs.php @@ -43,46 +43,3 @@ function subs_unsubscribe_to($user, $other) return $e->getMessage(); } } - -function subs_unsubscribe_from($user, $other){ - $local = User::staticGet("nickname",$other); - if($local){ - return subs_unsubscribe_to($local,$user); - } else { - try { - $remote = Profile::staticGet("nickname",$other); - if(is_string($remote)){ - return $remote; - } - if (Event::handle('StartUnsubscribe', array($remote,$user))) { - - $sub = DB_DataObject::factory('subscription'); - - $sub->subscriber = $remote->id; - $sub->subscribed = $user->id; - - $sub->find(true); - - // note we checked for existence above - - if (!$sub->delete()) - return _('Couldn\'t delete subscription.'); - - $cache = common_memcache(); - - if ($cache) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $remote->id)); - } - - - $user->blowSubscribersCount(); - $remote->blowSubscribersCount(); - - Event::handle('EndUnsubscribe', array($remote, $user)); - } - } catch (Exception $e) { - return $e->getMessage(); - } - } -} -