diff --git a/app/Http/Controllers/DirectMessageController.php b/app/Http/Controllers/DirectMessageController.php index 5346be845..1f7e04e59 100644 --- a/app/Http/Controllers/DirectMessageController.php +++ b/app/Http/Controllers/DirectMessageController.php @@ -368,8 +368,6 @@ class DirectMessageController extends Controller $notification->profile_id = $recipient->id; $notification->actor_id = $profile->id; $notification->action = 'dm'; - $notification->message = $dm->toText(); - $notification->rendered = $dm->toHtml(); $notification->item_id = $dm->id; $notification->item_type = "App\DirectMessage"; $notification->save(); diff --git a/app/Http/Controllers/Stories/StoryApiV1Controller.php b/app/Http/Controllers/Stories/StoryApiV1Controller.php index 16d1805b9..e32fffa26 100644 --- a/app/Http/Controllers/Stories/StoryApiV1Controller.php +++ b/app/Http/Controllers/Stories/StoryApiV1Controller.php @@ -328,8 +328,6 @@ class StoryApiV1Controller extends Controller $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:comment'; - $n->message = "{$request->user()->username} commented on story"; - $n->rendered = "{$request->user()->username} commented on story"; $n->save(); } else { StoryReplyDeliver::dispatch($story, $status)->onQueue('story'); diff --git a/app/Http/Controllers/StoryComposeController.php b/app/Http/Controllers/StoryComposeController.php index f913d859f..8f9358b74 100644 --- a/app/Http/Controllers/StoryComposeController.php +++ b/app/Http/Controllers/StoryComposeController.php @@ -442,8 +442,6 @@ class StoryComposeController extends Controller $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:react'; - $n->message = "{$request->user()->username} reacted to your story"; - $n->rendered = "{$request->user()->username} reacted to your story"; $n->save(); } else { StoryReactionDeliver::dispatch($story, $status)->onQueue('story'); @@ -516,8 +514,6 @@ class StoryComposeController extends Controller $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:comment'; - $n->message = "{$request->user()->username} commented on story"; - $n->rendered = "{$request->user()->username} commented on story"; $n->save(); } else { StoryReplyDeliver::dispatch($story, $status)->onQueue('story'); diff --git a/app/Jobs/CommentPipeline/CommentPipeline.php b/app/Jobs/CommentPipeline/CommentPipeline.php index 0ae4ed4a2..064795de8 100644 --- a/app/Jobs/CommentPipeline/CommentPipeline.php +++ b/app/Jobs/CommentPipeline/CommentPipeline.php @@ -94,8 +94,6 @@ class CommentPipeline implements ShouldQueue $notification->profile_id = $target->id; $notification->actor_id = $actor->id; $notification->action = 'comment'; - $notification->message = $comment->replyToText(); - $notification->rendered = $comment->replyToHtml(); $notification->item_id = $comment->id; $notification->item_type = "App\Status"; $notification->save(); diff --git a/app/Jobs/FollowPipeline/FollowPipeline.php b/app/Jobs/FollowPipeline/FollowPipeline.php index 2bda4057f..6db85fa6a 100644 --- a/app/Jobs/FollowPipeline/FollowPipeline.php +++ b/app/Jobs/FollowPipeline/FollowPipeline.php @@ -97,8 +97,6 @@ class FollowPipeline implements ShouldQueue $notification->profile_id = $target->id; $notification->actor_id = $actor->id; $notification->action = 'follow'; - $notification->message = $follower->toText(); - $notification->rendered = $follower->toHtml(); $notification->item_id = $target->id; $notification->item_type = "App\Profile"; $notification->save(); diff --git a/app/Jobs/LikePipeline/LikePipeline.php b/app/Jobs/LikePipeline/LikePipeline.php index d2be251ac..b44c90c8b 100644 --- a/app/Jobs/LikePipeline/LikePipeline.php +++ b/app/Jobs/LikePipeline/LikePipeline.php @@ -84,8 +84,6 @@ class LikePipeline implements ShouldQueue $notification->profile_id = $status->profile_id; $notification->actor_id = $actor->id; $notification->action = 'like'; - $notification->message = $like->toText($status->in_reply_to_id ? 'comment' : 'post'); - $notification->rendered = $like->toHtml($status->in_reply_to_id ? 'comment' : 'post'); $notification->item_id = $status->id; $notification->item_type = "App\Status"; $notification->save(); diff --git a/app/Jobs/MentionPipeline/MentionPipeline.php b/app/Jobs/MentionPipeline/MentionPipeline.php index 2186af9d5..cec42f09d 100644 --- a/app/Jobs/MentionPipeline/MentionPipeline.php +++ b/app/Jobs/MentionPipeline/MentionPipeline.php @@ -67,10 +67,6 @@ class MentionPipeline implements ShouldQueue 'action' => 'mention', 'item_type' => 'App\Status', 'item_id' => $status->id, - ], - [ - 'message' => $mention->toText(), - 'rendered' => $mention->toHtml() ] ); diff --git a/app/Jobs/SharePipeline/SharePipeline.php b/app/Jobs/SharePipeline/SharePipeline.php index 528c78ca2..0b580500b 100644 --- a/app/Jobs/SharePipeline/SharePipeline.php +++ b/app/Jobs/SharePipeline/SharePipeline.php @@ -76,10 +76,6 @@ class SharePipeline implements ShouldQueue 'action' => 'share', 'item_type' => 'App\Status', 'item_id' => $status->reblog_of_id ?? $status->id, - ], - [ - 'message' => $status->shareToText(), - 'rendered' => $status->shareToHtml() ] ); diff --git a/app/Jobs/StatusPipeline/StatusReplyPipeline.php b/app/Jobs/StatusPipeline/StatusReplyPipeline.php index 2c41aa146..755faba8f 100644 --- a/app/Jobs/StatusPipeline/StatusReplyPipeline.php +++ b/app/Jobs/StatusPipeline/StatusReplyPipeline.php @@ -90,8 +90,6 @@ class StatusReplyPipeline implements ShouldQueue $notification->profile_id = $target->id; $notification->actor_id = $actor->id; $notification->action = 'comment'; - $notification->message = $status->replyToText(); - $notification->rendered = $status->replyToHtml(); $notification->item_id = $status->id; $notification->item_type = "App\Status"; $notification->save(); diff --git a/app/Services/MediaTagService.php b/app/Services/MediaTagService.php index ef436ec0a..e974d258c 100644 --- a/app/Services/MediaTagService.php +++ b/app/Services/MediaTagService.php @@ -74,16 +74,13 @@ class MediaTagService { $p = $tag->status->profile; $actor = $p->username; - $message = "{$actor} tagged you in a post."; - $rendered = "{$actor} tagged you in a post."; + $n = new Notification; $n->profile_id = $tag->profile_id; $n->actor_id = $p->id; $n->item_id = $tag->id; $n->item_type = 'App\MediaTag'; $n->action = 'tagged'; - $n->message = $message; - $n->rendered = $rendered; $n->save(); return; } diff --git a/app/Transformer/Api/NotificationTransformer.php b/app/Transformer/Api/NotificationTransformer.php index d4f84bbef..837c027af 100644 --- a/app/Transformer/Api/NotificationTransformer.php +++ b/app/Transformer/Api/NotificationTransformer.php @@ -23,7 +23,9 @@ class NotificationTransformer extends Fractal\TransformerAbstract if($n->actor_id) { $res['account'] = AccountService::get($n->actor_id); - $res['relationship'] = RelationshipService::get($n->actor_id, $n->profile_id); + if($n->profile_id != $n->actor_id) { + $res['relationship'] = RelationshipService::get($n->actor_id, $n->profile_id); + } } if($n->item_id && $n->item_type == 'App\Status') { @@ -66,11 +68,8 @@ class NotificationTransformer extends Fractal\TransformerAbstract 'comment' => 'comment', 'admin.user.modlog.comment' => 'modlog', 'tagged' => 'tagged', - 'group:comment' => 'group:comment', 'story:react' => 'story:react', 'story:comment' => 'story:comment', - 'group:join:approved' => 'group:join:approved', - 'group:join:rejected' => 'group:join:rejected' ]; if(!isset($verbs[$verb])) { diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index a852e75cc..70dea452a 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -483,8 +483,6 @@ class Inbox $notification->profile_id = $profile->id; $notification->actor_id = $actor->id; $notification->action = 'dm'; - $notification->message = $dm->toText(); - $notification->rendered = $dm->toHtml(); $notification->item_id = $dm->id; $notification->item_type = "App\DirectMessage"; $notification->save(); @@ -594,9 +592,6 @@ class Inbox 'action' => 'share', 'item_id' => $parent->id, 'item_type' => 'App\Status', - ], [ - 'message' => $status->replyToText(), - 'rendered' => $status->replyToHtml(), ] ); @@ -1023,8 +1018,6 @@ class Inbox $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:react'; - $n->message = "{$actorProfile->username} reacted to your story"; - $n->rendered = "{$actorProfile->username} reacted to your story"; $n->save(); return; @@ -1134,8 +1127,6 @@ class Inbox $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:comment'; - $n->message = "{$actorProfile->username} commented on story"; - $n->rendered = "{$actorProfile->username} commented on story"; $n->save(); return;