diff --git a/README.md b/README.md
index 4538075ee..584868d7c 100644
--- a/README.md
+++ b/README.md
@@ -188,6 +188,8 @@ Customization details can be found in the [Customization doc](docs/customization
Soapbox FE is based on [Gab Social](https://code.gab.com/gab/social/gab-social)'s frontend which is in turn based on [Mastodon](https://github.com/tootsuite/mastodon/)'s frontend.
+- `static/sounds/chat.mp3` and `static/sounds/chat.oga` are from [notificationsounds.com](https://notificationsounds.com/notification-sounds/intuition-561) licensed under CC BY 4.0.
+
Soapbox FE is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
diff --git a/app/images/halloween/clouds.png b/app/images/halloween/clouds.png
new file mode 100644
index 000000000..29962c104
Binary files /dev/null and b/app/images/halloween/clouds.png differ
diff --git a/app/images/halloween/halloween-emblem.svg b/app/images/halloween/halloween-emblem.svg
new file mode 100644
index 000000000..ad23be14c
--- /dev/null
+++ b/app/images/halloween/halloween-emblem.svg
@@ -0,0 +1,311 @@
+
+
diff --git a/app/images/halloween/spider.svg b/app/images/halloween/spider.svg
new file mode 100644
index 000000000..077b60d65
--- /dev/null
+++ b/app/images/halloween/spider.svg
@@ -0,0 +1,69 @@
+
+
+
+
diff --git a/app/images/halloween/spiderweb.svg b/app/images/halloween/spiderweb.svg
new file mode 100644
index 000000000..16ae81984
--- /dev/null
+++ b/app/images/halloween/spiderweb.svg
@@ -0,0 +1,78 @@
+
+
diff --git a/app/images/halloween/starfield.png b/app/images/halloween/starfield.png
new file mode 100644
index 000000000..1e7995895
Binary files /dev/null and b/app/images/halloween/starfield.png differ
diff --git a/app/images/halloween/twinkle.svg b/app/images/halloween/twinkle.svg
new file mode 100644
index 000000000..9869cb094
--- /dev/null
+++ b/app/images/halloween/twinkle.svg
@@ -0,0 +1,34 @@
+
+
diff --git a/app/soapbox/__fixtures__/context_1.json b/app/soapbox/__fixtures__/context_1.json
new file mode 100644
index 000000000..2e37a5502
--- /dev/null
+++ b/app/soapbox/__fixtures__/context_1.json
@@ -0,0 +1,739 @@
+{
+ "ancestors": [
+ {
+ "account": {
+ "acct": "alex",
+ "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg",
+ "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg",
+ "bot": false,
+ "created_at": "2020-01-08T01:25:43.000Z",
+ "display_name": "Alex Gleason",
+ "emojis": [],
+ "fields": [
+ {
+ "name": "Website",
+ "value": "https://alexgleason.me"
+ },
+ {
+ "name": "Pleroma+Soapbox",
+ "value": "https://soapbox.pub"
+ },
+ {
+ "name": "Email",
+ "value": "alex@alexgleason.me"
+ },
+ {
+ "name": "Gender identity",
+ "value": "Soyboy"
+ }
+ ],
+ "follow_requests_count": 0,
+ "followers_count": 725,
+ "following_count": 1211,
+ "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png",
+ "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png",
+ "id": "9v5bmRalQvjOy0ECcC",
+ "locked": false,
+ "note": "Fediverse developer. I come in peace.
#vegan #freeculture #atheist #antiporn #gendercritical.
Boosts ≠endorsements.",
+ "pleroma": {
+ "accepts_chat_messages": true,
+ "allow_following_move": true,
+ "ap_id": "https://gleasonator.com/users/alex",
+ "background_image": null,
+ "confirmation_pending": false,
+ "deactivated": false,
+ "favicon": "https://gleasonator.com/favicon.png",
+ "hide_favorites": true,
+ "hide_followers": false,
+ "hide_followers_count": false,
+ "hide_follows": false,
+ "hide_follows_count": false,
+ "is_admin": true,
+ "is_moderator": false,
+ "notification_settings": {
+ "block_from_strangers": false,
+ "hide_notification_contents": false
+ },
+ "relationship": {},
+ "skip_thread_containment": false,
+ "tags": [],
+ "unread_conversation_count": 95,
+ "unread_notifications_count": 0
+ },
+ "source": {
+ "fields": [
+ {
+ "name": "Website",
+ "value": "https://alexgleason.me"
+ },
+ {
+ "name": "Pleroma+Soapbox",
+ "value": "https://soapbox.pub"
+ },
+ {
+ "name": "Email",
+ "value": "alex@alexgleason.me"
+ },
+ {
+ "name": "Gender identity",
+ "value": "Soyboy"
+ }
+ ],
+ "note": "Fediverse developer. I come in peace.\r\n\r\n#vegan #freeculture #atheist #antiporn #gendercritical.\r\n\r\nBoosts ≠endorsements.",
+ "pleroma": {
+ "actor_type": "Person",
+ "discoverable": false,
+ "no_rich_text": false,
+ "show_role": true
+ },
+ "privacy": "public",
+ "sensitive": false
+ },
+ "statuses_count": 9157,
+ "url": "https://gleasonator.com/users/alex",
+ "username": "alex"
+ },
+ "application": {
+ "name": "Web",
+ "website": null
+ },
+ "bookmarked": false,
+ "card": null,
+ "content": "
A
", + "created_at": "2020-09-18T20:07:10.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH6kDXA10YqhMKqO", + "in_reply_to_account_id": null, + "in_reply_to_id": null, + "language": null, + "media_attachments": [], + "mentions": [], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "A" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": null, + "local": true, + "parent_visible": false, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/9995c074-2ff6-4a01-b596-7ef6971ed5d2", + "url": "https://gleasonator.com/notice/9zIH6kDXA10YqhMKqO", + "visibility": "direct" + }, + { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Pleroma+Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + } + ], + "follow_requests_count": 0, + "followers_count": 725, + "following_count": 1211, + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "locked": false, + "note": "Fediverse developer. I come in peace.B
", + "created_at": "2020-09-18T20:07:18.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH7PUdhK3Ircg4hM", + "in_reply_to_account_id": "9v5bmRalQvjOy0ECcC", + "in_reply_to_id": "9zIH6kDXA10YqhMKqO", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "alex", + "id": "9v5bmRalQvjOy0ECcC", + "url": "https://gleasonator.com/users/alex", + "username": "alex" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "B" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "alex", + "local": true, + "parent_visible": true, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/992ca99a-425d-46eb-b094-60412e9fb141", + "url": "https://gleasonator.com/notice/9zIH7PUdhK3Ircg4hM", + "visibility": "direct" + }, + { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Pleroma+Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + } + ], + "follow_requests_count": 0, + "followers_count": 725, + "following_count": 1211, + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "locked": false, + "note": "Fediverse developer. I come in peace.C
", + "created_at": "2020-09-18T20:07:22.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH7mMGgc1RmJwDLM", + "in_reply_to_account_id": "9v5bmRalQvjOy0ECcC", + "in_reply_to_id": "9zIH6kDXA10YqhMKqO", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "alex", + "id": "9v5bmRalQvjOy0ECcC", + "url": "https://gleasonator.com/users/alex", + "username": "alex" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "C" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "alex", + "local": true, + "parent_visible": true, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/a2c25ef5-a40e-4098-b07e-b468989ef749", + "url": "https://gleasonator.com/notice/9zIH7mMGgc1RmJwDLM", + "visibility": "direct" + } + ], + "descendants": [ + { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Pleroma+Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + } + ], + "follow_requests_count": 0, + "followers_count": 725, + "following_count": 1211, + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "locked": false, + "note": "Fediverse developer. I come in peace.E
", + "created_at": "2020-09-18T20:07:38.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH9GTCDWEFSRt2um", + "in_reply_to_account_id": "9v5bmRalQvjOy0ECcC", + "in_reply_to_id": "9zIH7PUdhK3Ircg4hM", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "alex", + "id": "9v5bmRalQvjOy0ECcC", + "url": "https://gleasonator.com/users/alex", + "username": "alex" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "E" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "alex", + "local": true, + "parent_visible": true, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/a1e45493-2158-4f11-88ca-ba621429dbe5", + "url": "https://gleasonator.com/notice/9zIH9GTCDWEFSRt2um", + "visibility": "direct" + }, + { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Pleroma+Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + } + ], + "follow_requests_count": 0, + "followers_count": 725, + "following_count": 1211, + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "locked": false, + "note": "Fediverse developer. I come in peace.F
", + "created_at": "2020-09-18T20:07:42.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH9fhaP9atiJoOJc", + "in_reply_to_account_id": "9v5bmRalQvjOy0ECcC", + "in_reply_to_id": "9zIH8WYwtnUx4yDzUm", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "alex", + "id": "9v5bmRalQvjOy0ECcC", + "url": "https://gleasonator.com/users/alex", + "username": "alex" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "F" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "alex", + "local": true, + "parent_visible": true, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/ee661cf9-35d4-4e84-88ff-13b5950f7556", + "url": "https://gleasonator.com/notice/9zIH9fhaP9atiJoOJc", + "visibility": "direct" + } + ] +} diff --git a/app/soapbox/__fixtures__/context_2.json b/app/soapbox/__fixtures__/context_2.json new file mode 100644 index 000000000..c5cf2a813 --- /dev/null +++ b/app/soapbox/__fixtures__/context_2.json @@ -0,0 +1,739 @@ +{ + "ancestors": [ + { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Pleroma+Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + } + ], + "follow_requests_count": 0, + "followers_count": 725, + "following_count": 1211, + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "locked": false, + "note": "Fediverse developer. I come in peace.A
", + "created_at": "2020-09-18T20:07:10.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH6kDXA10YqhMKqO", + "in_reply_to_account_id": null, + "in_reply_to_id": null, + "language": null, + "media_attachments": [], + "mentions": [], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "A" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": null, + "local": true, + "parent_visible": false, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/9995c074-2ff6-4a01-b596-7ef6971ed5d2", + "url": "https://gleasonator.com/notice/9zIH6kDXA10YqhMKqO", + "visibility": "direct" + } + ], + "descendants": [ + { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Pleroma+Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + } + ], + "follow_requests_count": 0, + "followers_count": 725, + "following_count": 1211, + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "locked": false, + "note": "Fediverse developer. I come in peace.C
", + "created_at": "2020-09-18T20:07:22.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH7mMGgc1RmJwDLM", + "in_reply_to_account_id": "9v5bmRalQvjOy0ECcC", + "in_reply_to_id": "9zIH6kDXA10YqhMKqO", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "alex", + "id": "9v5bmRalQvjOy0ECcC", + "url": "https://gleasonator.com/users/alex", + "username": "alex" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "C" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "alex", + "local": true, + "parent_visible": true, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/a2c25ef5-a40e-4098-b07e-b468989ef749", + "url": "https://gleasonator.com/notice/9zIH7mMGgc1RmJwDLM", + "visibility": "direct" + }, + { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Pleroma+Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + } + ], + "follow_requests_count": 0, + "followers_count": 725, + "following_count": 1211, + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "locked": false, + "note": "Fediverse developer. I come in peace.D
", + "created_at": "2020-09-18T20:07:30.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH8WYwtnUx4yDzUm", + "in_reply_to_account_id": "9v5bmRalQvjOy0ECcC", + "in_reply_to_id": "9zIH7PUdhK3Ircg4hM", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "alex", + "id": "9v5bmRalQvjOy0ECcC", + "url": "https://gleasonator.com/users/alex", + "username": "alex" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "D" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "alex", + "local": true, + "parent_visible": true, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/bb423adc-ed86-42d8-942e-84efbe7b1acf", + "url": "https://gleasonator.com/notice/9zIH8WYwtnUx4yDzUm", + "visibility": "direct" + }, + { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Pleroma+Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + } + ], + "follow_requests_count": 0, + "followers_count": 725, + "following_count": 1211, + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "locked": false, + "note": "Fediverse developer. I come in peace.E
", + "created_at": "2020-09-18T20:07:38.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH9GTCDWEFSRt2um", + "in_reply_to_account_id": "9v5bmRalQvjOy0ECcC", + "in_reply_to_id": "9zIH7PUdhK3Ircg4hM", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "alex", + "id": "9v5bmRalQvjOy0ECcC", + "url": "https://gleasonator.com/users/alex", + "username": "alex" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "E" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "alex", + "local": true, + "parent_visible": true, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/a1e45493-2158-4f11-88ca-ba621429dbe5", + "url": "https://gleasonator.com/notice/9zIH9GTCDWEFSRt2um", + "visibility": "direct" + }, + { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "avatar_static": "https://media.gleasonator.com/26f0ca4ef51f7047829fdb65a43cb7d0304413ce0a5d00dd1638458994608718.jpg", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Pleroma+Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + } + ], + "follow_requests_count": 0, + "followers_count": 725, + "following_count": 1211, + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "locked": false, + "note": "Fediverse developer. I come in peace.F
", + "created_at": "2020-09-18T20:07:42.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "9zIH9fhaP9atiJoOJc", + "in_reply_to_account_id": "9v5bmRalQvjOy0ECcC", + "in_reply_to_id": "9zIH8WYwtnUx4yDzUm", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "alex", + "id": "9v5bmRalQvjOy0ECcC", + "url": "https://gleasonator.com/users/alex", + "username": "alex" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "F" + }, + "conversation_id": 5089485, + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "alex", + "local": true, + "parent_visible": true, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/ee661cf9-35d4-4e84-88ff-13b5950f7556", + "url": "https://gleasonator.com/notice/9zIH9fhaP9atiJoOJc", + "visibility": "direct" + } + ] +} diff --git a/app/soapbox/actions/chats.js b/app/soapbox/actions/chats.js index 729dc128e..6f8d1c788 100644 --- a/app/soapbox/actions/chats.js +++ b/app/soapbox/actions/chats.js @@ -23,6 +23,10 @@ export const CHAT_READ_REQUEST = 'CHAT_READ_REQUEST'; export const CHAT_READ_SUCCESS = 'CHAT_READ_SUCCESS'; export const CHAT_READ_FAIL = 'CHAT_READ_FAIL'; +export const CHAT_MESSAGE_DELETE_REQUEST = 'CHAT_MESSAGE_DELETE_REQUEST'; +export const CHAT_MESSAGE_DELETE_SUCCESS = 'CHAT_MESSAGE_DELETE_SUCCESS'; +export const CHAT_MESSAGE_DELETE_FAIL = 'CHAT_MESSAGE_DELETE_FAIL'; + export function fetchChats() { return (dispatch, getState) => { dispatch({ type: CHATS_FETCH_REQUEST }); @@ -150,3 +154,14 @@ export function markChatRead(chatId, lastReadId) { }); }; } + +export function deleteChatMessage(chatId, messageId) { + return (dispatch, getState) => { + dispatch({ type: CHAT_MESSAGE_DELETE_REQUEST, chatId, messageId }); + api(getState).delete(`/api/v1/pleroma/chats/${chatId}/messages/${messageId}`).then(({ data }) => { + dispatch({ type: CHAT_MESSAGE_DELETE_SUCCESS, chatId, messageId, chatMessage: data }); + }).catch(error => { + dispatch({ type: CHAT_MESSAGE_DELETE_FAIL, chatId, messageId, error }); + }); + }; +} diff --git a/app/soapbox/actions/importer/index.js b/app/soapbox/actions/importer/index.js index 0736dd7ce..44de245cf 100644 --- a/app/soapbox/actions/importer/index.js +++ b/app/soapbox/actions/importer/index.js @@ -46,6 +46,8 @@ export function importFetchedAccounts(accounts) { const normalAccounts = []; function processAccount(account) { + if (!account.id) return; + pushUnique(normalAccounts, normalizeAccount(account)); if (account.moved) { @@ -69,6 +71,8 @@ export function importFetchedStatuses(statuses) { const polls = []; function processStatus(status) { + if (!status.account.id) return; + const normalOldStatus = getState().getIn(['statuses', status.id]); const expandSpoilers = getSettings(getState()).get('expandSpoilers'); diff --git a/app/soapbox/actions/notifications.js b/app/soapbox/actions/notifications.js index 1346c36c0..1a1175700 100644 --- a/app/soapbox/actions/notifications.js +++ b/app/soapbox/actions/notifications.js @@ -10,7 +10,11 @@ import { } from './importer'; import { getSettings, saveSettings } from './settings'; import { defineMessages } from 'react-intl'; -import { List as ImmutableList } from 'immutable'; +import { + List as ImmutableList, + Map as ImmutableMap, + OrderedMap as ImmutableOrderedMap, +} from 'immutable'; import { unescapeHTML } from '../utils/html'; import { getFilters, regexFromFilters } from '../selectors'; @@ -121,7 +125,7 @@ export function updateNotificationsQueue(notification, intlMessages, intlLocale, export function dequeueNotifications() { return (dispatch, getState) => { - const queuedNotifications = getState().getIn(['notifications', 'queuedNotifications'], ImmutableList()); + const queuedNotifications = getState().getIn(['notifications', 'queuedNotifications'], ImmutableOrderedMap()); const totalQueuedNotificationsCount = getState().getIn(['notifications', 'totalQueuedNotificationsCount'], 0); if (totalQueuedNotificationsCount === 0) { @@ -252,9 +256,12 @@ export function setFilter(filterType) { export function markReadNotifications() { return (dispatch, getState) => { - if (!getState().get('me')) return; - const topNotification = parseInt(getState().getIn(['notifications', 'items', 0, 'id'])); - const lastRead = getState().getIn(['notifications', 'lastRead']); + const state = getState(); + if (!state.get('me')) return; + + const topNotification = state.getIn(['notifications', 'items'], ImmutableOrderedMap()).first(ImmutableMap()).get('id'); + const lastRead = state.getIn(['notifications', 'lastRead']); + if (!(topNotification && topNotification > lastRead)) return; dispatch({ diff --git a/app/soapbox/actions/reports.js b/app/soapbox/actions/reports.js index a1214fc56..9328e0141 100644 --- a/app/soapbox/actions/reports.js +++ b/app/soapbox/actions/reports.js @@ -25,6 +25,17 @@ export function initReport(account, status) { }; }; +export function initReportById(accountId) { + return (dispatch, getState) => { + dispatch({ + type: REPORT_INIT, + account: getState().getIn(['accounts', accountId]), + }); + + dispatch(openModal('REPORT')); + }; +}; + export function cancelReport() { return { type: REPORT_CANCEL, diff --git a/app/soapbox/actions/settings.js b/app/soapbox/actions/settings.js index 4432fa6e0..097265814 100644 --- a/app/soapbox/actions/settings.js +++ b/app/soapbox/actions/settings.js @@ -32,6 +32,7 @@ const defaultSettings = ImmutableMap({ chats: ImmutableMap({ panes: ImmutableList(), mainWindow: 'minimized', + sound: true, }), home: ImmutableMap({ diff --git a/app/soapbox/actions/statuses.js b/app/soapbox/actions/statuses.js index acbbea1f4..bdf31da8f 100644 --- a/app/soapbox/actions/statuses.js +++ b/app/soapbox/actions/statuses.js @@ -219,7 +219,6 @@ export function fetchContextSuccess(id, ancestors, descendants) { id, ancestors, descendants, - statuses: ancestors.concat(descendants), }; }; diff --git a/app/soapbox/actions/streaming.js b/app/soapbox/actions/streaming.js index a581ae0fe..b3ca60fb3 100644 --- a/app/soapbox/actions/streaming.js +++ b/app/soapbox/actions/streaming.js @@ -55,7 +55,17 @@ export function connectTimelineStream(timelineId, path, pollingRefresh = null, a dispatch(fetchFilters()); break; case 'pleroma:chat_update': - dispatch({ type: STREAMING_CHAT_UPDATE, chat: JSON.parse(data.payload), me: getState().get('me') }); + dispatch((dispatch, getState) => { + const chat = JSON.parse(data.payload); + const messageOwned = !(chat.last_message && chat.last_message.account_id !== getState().get('me')); + + dispatch({ + type: STREAMING_CHAT_UPDATE, + chat, + // Only play sounds for recipient messages + meta: !messageOwned && getSettings(getState()).getIn(['chats', 'sound']) && { sound: 'chat' }, + }); + }); break; } }, diff --git a/app/soapbox/components/__tests__/__snapshots__/display_name-test.js.snap b/app/soapbox/components/__tests__/__snapshots__/display_name-test.js.snap index d26a406a2..6d04016b5 100644 --- a/app/soapbox/components/__tests__/__snapshots__/display_name-test.js.snap +++ b/app/soapbox/components/__tests__/__snapshots__/display_name-test.js.snap @@ -6,6 +6,7 @@ exports[`