]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Use information about activityschema public mention for Notice scope
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Mar 2016 16:47:35 +0000 (17:47 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Mar 2016 16:47:35 +0000 (17:47 +0100)
classes/Notice.php

index 748489767932d50a7bc64a1f7a0aa34da10069a3..67336bd3dc85b73cb861a739d38742ee18f98e9a 100644 (file)
@@ -931,7 +931,14 @@ class Notice extends Managed_DataObject
             $act->context = new ActivityContext();
         }
 
-        $stored->scope = self::figureOutScope($actor, $groups, $scope);
+        if (array_key_exists('http://activityschema.org/collection/public', $act->context->attention)) {
+            common_debug('URI "http://activityschema.org/collection/public" was in notice attention, so we scope this public.');
+            $stored->scope = Notice::PUBLIC_SCOPE;
+            // TODO: maybe we should actually keep this? if the saveAttentions thing wants to use it...
+            unset($act->context->attention['http://activityschema.org/collection/public']);
+        } else {
+            $stored->scope = self::figureOutScope($actor, $groups, $scope);
+        }
 
         foreach ($act->categories as $cat) {
             if ($cat->term) {