aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-01 12:35:35 +0200
committerMario <mario@mariovavti.com>2020-10-01 12:35:35 +0200
commit4b0d32eb147c8993ba7ff15ddc1276f752971d2a (patch)
treefa878a8ab64ebc06674404838b0c132167292dc4 /Zotlabs/Lib
parent8605aee53378075956753f6b06487d8d8129df3e (diff)
parent1d705b9805457b7c5f1b55023b7348712cc52604 (diff)
downloadvolse-hubzilla-4b0d32eb147c8993ba7ff15ddc1276f752971d2a.tar.gz
volse-hubzilla-4b0d32eb147c8993ba7ff15ddc1276f752971d2a.tar.bz2
volse-hubzilla-4b0d32eb147c8993ba7ff15ddc1276f752971d2a.zip
Merge branch 'deletefixes' into 'dev'
deleting like/dislike/accept/reject/etc. activities should be Undo rather than Delete per the spec See merge request hubzilla/core!1879
Diffstat (limited to 'Zotlabs/Lib')
-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 ae52fa216..3f4875e93 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)
@@ -2070,12 +2075,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;