]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
JOINs and FOLLOWs would have null titles in Activity representation of notices
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 29 Jul 2014 22:21:00 +0000 (00:21 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 29 Jul 2014 22:21:00 +0000 (00:21 +0200)
plugins/Activity/ActivityPlugin.php

index 59fb674fba7d58e35ac1c5d9325a2697752f8a32..0d8508e06d9cf5bbc1427cf188b60377ac3e9049 100644 (file)
@@ -311,9 +311,10 @@ class ActivityPlugin extends Plugin
             // FIXME: do something here
             break;
         case ActivityVerb::JOIN:
-            $mem = Group_member::getKV('uri', $stored->uri);
-            if (!empty($mem)) {
+            $mem = Group_member::getKV('uri', $stored->getUri());
+            if ($mem instanceof Group_member) {
                 $group = $mem->getGroup();
+                $act->title = $stored->getTitle();
                 $act->objects = array(ActivityObject::fromGroup($group));
             }
             break;
@@ -322,9 +323,10 @@ class ActivityPlugin extends Plugin
             break;
         case ActivityVerb::FOLLOW:
             $sub = Subscription::getKV('uri', $stored->uri);
-            if (!empty($sub)) {
+            if ($sub instanceof Subscription) {
                 $profile = Profile::getKV('id', $sub->subscribed);
-                if (!empty($profile)) {
+                if ($profile instanceof Profile) {
+                    $act->title = $stored->getTitle();
                     $act->objects = array($profile->asActivityObject());
                 }
             }