]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/subs.php
Tidying up getUser calls to profiles and some events
[quix0rs-gnu-social.git] / lib / subs.php
index 165bbaa8ff7a4bbdc09429f3b703e55d6407846d..6ac448b9546b8ffa56c897e2ee1180ca4e2b03f4 100644 (file)
@@ -26,6 +26,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
 function subs_subscribe_to($user, $other)
 {
+    if (is_a($other, 'User')) {
+        $other = $other->getProfile();
+    }
     try {
         Subscription::start($user->getProfile(), $other);
         return true;
@@ -36,6 +39,9 @@ function subs_subscribe_to($user, $other)
 
 function subs_unsubscribe_to($user, $other)
 {
+    if (is_a($other, 'User')) {
+        $other = $other->getProfile();
+    }
     try {
         Subscription::cancel($user->getProfile(), $other);
         return true;