aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authornobody <nobody@zotlabs.com>2020-09-30 23:38:05 -0700
committernobody <nobody@zotlabs.com>2020-09-30 23:38:05 -0700
commit1d705b9805457b7c5f1b55023b7348712cc52604 (patch)
treeb11853f665008cdaac152d8f92e6d629fc85ad32 /Zotlabs/Lib/Activity.php
parente529635952c9a10f56d3bc90a666eccd9c5b9842 (diff)
downloadvolse-hubzilla-1d705b9805457b7c5f1b55023b7348712cc52604.tar.gz
volse-hubzilla-1d705b9805457b7c5f1b55023b7348712cc52604.tar.bz2
volse-hubzilla-1d705b9805457b7c5f1b55023b7348712cc52604.zip
deleting like/dislike/accept/reject/etc. activities should be Undo rather than Delete per the spec
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 7ad6c91ae..b084b1da8 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -644,7 +644,12 @@ class Activity {
}
if (intval($i['item_deleted'])) {
- $ret['type'] = 'Delete';
+ if (in_array($ret['type'], [ 'Like', 'Dislike', 'Accept', 'Reject', 'TentativeAccept', 'TentativeReject' ])) {
+ $ret['type'] = 'Undo';
+ }
+ else {
+ $ret['type'] = 'Delete';
+ }
$ret['id'] = str_replace('/item/','/activity/',$i['mid']) . '#delete';
$actor = self::encode_person($i['author'],false);
if ($actor)
@@ -2087,12 +2092,10 @@ class Activity {
$s['edited'] = datetime_convert();
}
- if($act->type === 'Tombstone' || $act->type === 'Delete' || ($act->type === 'Create' && $act->obj['type'] === 'Tombstone')) {
+ if(in_array($act->type, [ 'Delete', 'Undo', 'Tombstone' ]) || ($act->type === 'Create' && $act->obj['type'] === 'Tombstone')) {
$s['item_deleted'] = 1;
}
-
-
$s['obj_type'] = self::activity_obj_decode_mapper($act->obj['type']);
if($s['obj_type'] === ACTIVITY_OBJ_NOTE && $s['mid'] !== $s['parent_mid']) {
$s['obj_type'] = ACTIVITY_OBJ_COMMENT;