}
$condition = DBA::mergeConditions($condition,
- ["`uid` IN (0, ?) AND (NOT `vid` IN (?, ?) OR `vid` IS NULL)", $uid, Verb::getID(Activity::FOLLOW), Verb::getID(Activity::VIEW)]);
+ ["`uid` IN (0, ?) AND (NOT `vid` IN (?, ?, ?) OR `vid` IS NULL)", $uid, Verb::getID(Activity::FOLLOW), Verb::getID(Activity::VIEW), Verb::getID(Activity::READ)]);
$thread_parents = Post::select(['uri-id', 'causer-id'], $condition, ['order' => ['uri-id' => false, 'uid']]);
* @var string
*/
const ANNOUNCE = ActivityNamespace::ACTIVITY2 . 'Announce';
+ /**
+ * Indicates that the actor has read the object.
+ *
+ * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-read
+ * @var string
+ */
+ const READ = ActivityNamespace::ACTIVITY2 . 'read';
const O_UNFOLLOW = ActivityNamespace::OSTATUS . '/unfollow';
const O_UNFAVOURITE = ActivityNamespace::OSTATUS . '/unfavorite';
self::ANNOUNCE,
self::EMOJIREACT,
self::VIEW,
+ self::READ,
];
/**
const PUBLIC_COLLECTION = 'as:Public';
const ACCOUNT_TYPES = ['as:Person', 'as:Organization', 'as:Service', 'as:Group', 'as:Application'];
const CONTENT_TYPES = ['as:Note', 'as:Article', 'as:Video', 'as:Image', 'as:Event', 'as:Audio', 'as:Page', 'as:Question'];
- const ACTIVITY_TYPES = ['as:Like', 'as:Dislike', 'as:Accept', 'as:Reject', 'as:TentativeAccept'];
+ const ACTIVITY_TYPES = ['as:Like', 'as:Dislike', 'as:Accept', 'as:Reject', 'as:TentativeAccept', 'as:Read'];
const TARGET_UNKNOWN = 0;
const TARGET_TO = 1;
} elseif (in_array($object_data['object_type'], ['as:Delete'])) {
// We cannot undo deletions, so we just ignore this
Queue::remove($object_data);
+ } elseif (in_array($object_data['object_object_type'], ['as:Tombstone'])) {
+ // The object is a tombstone, we ignore any actions on it.
+ Queue::remove($object_data);
} else {
return false;
}
return false;
}
break;
+ case 'as:Read':
+ if (in_array($object_data['object_type'], self::CONTENT_TYPES)) {
+ ActivityPub\Processor::createActivity($object_data, Activity::READ);
+ } elseif ($object_data['object_type'] == '') {
+ // The object type couldn't be determined. Most likely we don't have it here. We ignore this activity.
+ Queue::remove($object_data);
+ } else {
+ return false;
+ }
+ break;
case 'litepub:EmojiReact':
if (in_array($object_data['object_type'], self::CONTENT_TYPES)) {