diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 20698cc42..01ca6617f 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -401,10 +401,35 @@ class Activity { $reply = false; if(intval($i['item_deleted'])) { - $ret['type'] = 'Tombstone'; - $ret['formerType'] = self::activity_obj_mapper($i['obj_type']); - $ret['id'] = $i['mid']; + $ret['type'] = 'Delete'; + $ret['id'] = str_replace('/item/','/activity/',$i['mid']) . '#delete'; + $actor = self::encode_person($i['author'],false); + if($actor) + $ret['actor'] = $actor; + else + return []; + + if($i['obj']) { + if(! is_array($i['obj'])) { + $i['obj'] = json_decode($i['obj'],true); + } + $obj = self::encode_object($i['obj']); + if($obj) + $ret['object'] = $obj; + else + return []; + } + else { + $obj = self::encode_item($i,$activitypub); + if($obj) + $ret['object'] = $obj; + else + return []; + } + + $ret['to'] = [ ACTIVITY_PUBLIC_INBOX ]; return $ret; + } $ret['type'] = self::activity_mapper($i['verb']); @@ -1201,6 +1226,25 @@ class Activity { } + static function drop($channel,$observer,$act) { + $r = q("select * from item where mid = '%s' and uid = %d limit 1", + $act->obj['id'], + $channel['channel_id'] + ); + + if(! $r) { + return; + } + + if(in_array($observer,[ $r[0]['author_xchan'], $r[0]['owner_xchan'] ])) { + drop_item($r[0]['id'],false); + } + elseif(in_array($act->actor['id'],[ $r[0]['author_xchan'], $r[0]['owner_xchan'] ])) { + drop_item($r[0]['id'],false); + } + + } + static function create_action($channel,$observer_hash,$act) { diff --git a/Zotlabs/Module/Inbox.php b/Zotlabs/Module/Inbox.php index 8af8f7f21..7bb9bcfe7 100644 --- a/Zotlabs/Module/Inbox.php +++ b/Zotlabs/Module/Inbox.php @@ -195,6 +195,8 @@ class Inbox extends Controller { break; } case 'Delete': + Activity::drop($channel,$observer_hash,$AS); + break; case 'Add': case 'Remove': default: diff --git a/view/theme/redbasic/schema/Focus-Light.css b/view/theme/redbasic/schema/Focus-Light.css index d23fc0fd8..7289acffe 100644 --- a/view/theme/redbasic/schema/Focus-Light.css +++ b/view/theme/redbasic/schema/Focus-Light.css @@ -1,3 +1,4 @@ +.dropdown-header.text-white-50, .navbar-dark .navbar-toggler, .navbar-dark .nav-link.active { color: rgba(0,0,0,0.7) !important; diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css index dbee67c84..71f7bc393 100644 --- a/view/theme/redbasic/schema/dark.css +++ b/view/theme/redbasic/schema/dark.css @@ -152,6 +152,7 @@ option { background-color: #111; } +.dropdown-header.text-black-50, .nav-link.active { color:#fff !important; } @@ -373,7 +374,7 @@ pre { } .dropdown-menu >li > a { - color: #ccc; + color: #ccc !important; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {