Activity "Read" is now stored
This commit is contained in:
parent
d8fe7e22b0
commit
e05cbf46e1
3 changed files with 23 additions and 2 deletions
|
@ -970,7 +970,7 @@ class Conversation
|
|||
}
|
||||
|
||||
$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']]);
|
||||
|
||||
|
|
|
@ -163,6 +163,13 @@ final class Activity
|
|||
* @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';
|
||||
|
@ -194,6 +201,7 @@ final class Activity
|
|||
self::ANNOUNCE,
|
||||
self::EMOJIREACT,
|
||||
self::VIEW,
|
||||
self::READ,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -63,7 +63,7 @@ class Receiver
|
|||
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;
|
||||
|
@ -934,6 +934,9 @@ class Receiver
|
|||
} 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;
|
||||
}
|
||||
|
@ -949,6 +952,16 @@ class Receiver
|
|||
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)) {
|
||||
|
|
Loading…
Reference in a new issue