diff --git a/.eslintrc.js b/.eslintrc.js index d885cbeea..ae8c9e981 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -150,7 +150,6 @@ module.exports = { 'react/jsx-wrap-multilines': 'error', 'react/no-multi-comp': 'off', 'react/no-string-refs': 'error', - 'react/prop-types': 'error', 'react/self-closing-comp': 'error', 'jsx-a11y/accessible-emoji': 'warn', @@ -264,7 +263,6 @@ module.exports = { files: ['**/*.ts', '**/*.tsx'], rules: { 'no-undef': 'off', // https://stackoverflow.com/a/69155899 - 'react/prop-types': 'off', }, parser: '@typescript-eslint/parser', }, diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..249d2e2ec --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,5 @@ +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository + +github: soapbox-pub +liberapay: soapbox +custom: "https://soapbox.pub/donate/" diff --git a/README.md b/README.md index 4c50d9abe..90bdb903e 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Soapbox FE is a [single-page application (SPA)](https://en.wikipedia.org/wiki/Si It has a single HTML file, `index.html`, responsible only for loading the required JavaScript and CSS. It interacts with the backend through [XMLHttpRequest (XHR)](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest). -It incorporates much of the [Mastodon API](https://docs.joinmastodon.org/methods/) used by Pleroma and Mastodon, but requires many [Pleroma-specific features](https://docs-develop.pleroma.social/backend/API/differences_in_mastoapi_responses/) in order to function. +It incorporates much of the [Mastodon API](https://docs.joinmastodon.org/methods/) used by Pleroma and Mastodon, but requires many [Pleroma-specific features](https://docs.pleroma.social/backend/development/API/differences_in_mastoapi_responses/) in order to function. # Running locally diff --git a/app/application.js b/app/application.ts similarity index 95% rename from app/application.js rename to app/application.ts index 59cd3374b..ba0d8f877 100644 --- a/app/application.js +++ b/app/application.ts @@ -1,5 +1,6 @@ import loadPolyfills from './soapbox/load_polyfills'; +// @ts-ignore require.context('./images/', true); // Load stylesheet diff --git a/app/soapbox/__fixtures__/notification-favourite.json b/app/soapbox/__fixtures__/notification-favourite.json new file mode 100644 index 000000000..00da9c8f9 --- /dev/null +++ b/app/soapbox/__fixtures__/notification-favourite.json @@ -0,0 +1,290 @@ +{ + "account": { + "acct": "Hollahollara@spinster.xyz", + "avatar": "https://gleasonator.com/proxy/LArKQiIrW265rGIJGwdgX7rRsao/aHR0cHM6Ly9tZWRpYS5zcGluc3Rlci54eXovYWNjb3VudHMvYXZhdGFycy8wMDAvMTQxLzI5NC9vcmlnaW5hbC9lNjA1NjljMjBjNGY3ODNjLnBuZw/e60569c20c4f783c.png", + "avatar_static": "https://gleasonator.com/proxy/LArKQiIrW265rGIJGwdgX7rRsao/aHR0cHM6Ly9tZWRpYS5zcGluc3Rlci54eXovYWNjb3VudHMvYXZhdGFycy8wMDAvMTQxLzI5NC9vcmlnaW5hbC9lNjA1NjljMjBjNGY3ODNjLnBuZw/e60569c20c4f783c.png", + "bot": false, + "created_at": "2020-05-29T03:15:59.000Z", + "display_name": "Hollahollara", + "emojis": [], + "fields": [], + "followers_count": 0, + "following_count": 0, + "fqn": "Hollahollara@spinster.xyz", + "header": "https://gleasonator.com/proxy/XSANC57uDBL3tM0LBLEer7yMyaA/aHR0cHM6Ly9tZWRpYS5zcGluc3Rlci54eXovYWNjb3VudHMvaGVhZGVycy8wMDAvMTQxLzI5NC9vcmlnaW5hbC84NTMzMWEzMjJkMTIyN2Q0LnBuZw/85331a322d1227d4.png", + "header_static": "https://gleasonator.com/proxy/XSANC57uDBL3tM0LBLEer7yMyaA/aHR0cHM6Ly9tZWRpYS5zcGluc3Rlci54eXovYWNjb3VudHMvaGVhZGVycy8wMDAvMTQxLzI5NC9vcmlnaW5hbC84NTMzMWEzMjJkMTIyN2Q0LnBuZw/85331a322d1227d4.png", + "id": "9vWfJdLwuJSyJXqCeG", + "last_status_at": "2022-04-16T20:33:32", + "locked": true, + "note": "Adult human female. Artist. Evil terv. Millennial, killing all the things. Public Universal Friend.

www.jenniferaldridge.com


", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [], + "ap_id": "https://spinster.xyz/users/Hollahollara", + "background_image": null, + "deactivated": false, + "favicon": "https://gleasonator.com/proxy/owo6QgsHm_0ogz5enHyvD68wDUA/aHR0cHM6Ly9zcGluc3Rlci54eXovZmF2aWNvbi5wbmc/favicon.png", + "hide_favorites": true, + "hide_followers": true, + "hide_followers_count": false, + "hide_follows": true, + "hide_follows_count": false, + "is_admin": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": false, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 7191, + "url": "https://spinster.xyz/users/Hollahollara", + "username": "Hollahollara" + }, + "created_at": "2022-04-14T20:36:52.000Z", + "id": "427825", + "pleroma": { + "is_muted": false, + "is_seen": true + }, + "status": { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png", + "avatar_static": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + }, + { + "name": "Donate (PayPal)", + "value": "https://paypal.me/gleasonator" + }, + { + "name": "$BTC", + "value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n" + }, + { + "name": "$ETH", + "value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717" + }, + { + "name": "$DOGE", + "value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D" + }, + { + "name": "$XMR", + "value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK" + } + ], + "follow_requests_count": 0, + "followers_count": 2602, + "following_count": 1603, + "fqn": "alex@gleasonator.com", + "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", + "last_status_at": "2022-04-16T19:23:50", + "locked": false, + "note": "I create Fediverse software that empowers people online.

I'm vegan btw

Note: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.", + "pleroma": { + "accepts_chat_messages": true, + "accepts_email_list": true, + "allow_following_move": true, + "also_known_as": [ + "https://mitra.social/users/alex" + ], + "ap_id": "https://gleasonator.com/users/alex", + "background_image": null, + "birthday": "1993-07-03", + "deactivated": false, + "email": "alex@alexgleason.me", + "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_confirmed": true, + "is_moderator": false, + "is_suggested": true, + "location": "Texas", + "notification_settings": { + "block_from_strangers": false, + "hide_notification_contents": false + }, + "relationship": {}, + "skip_thread_containment": false, + "tags": [], + "unread_conversation_count": 392, + "unread_notifications_count": 2 + }, + "source": { + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + }, + { + "name": "Donate (PayPal)", + "value": "https://paypal.me/gleasonator" + }, + { + "name": "$BTC", + "value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n" + }, + { + "name": "$ETH", + "value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717" + }, + { + "name": "$DOGE", + "value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D" + }, + { + "name": "$XMR", + "value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK" + } + ], + "note": "I create Fediverse software that empowers people online.\r\n\r\nI'm vegan btw\r\n\r\nNote: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.", + "pleroma": { + "actor_type": "Person", + "discoverable": false, + "no_rich_text": false, + "show_birthday": true, + "show_role": true + }, + "privacy": "public", + "sensitive": false + }, + "statuses_count": 24050, + "url": "https://gleasonator.com/users/alex", + "username": "alex" + }, + "application": { + "name": "Soapbox FE", + "website": "https://soapbox.pub/" + }, + "bookmarked": false, + "card": null, + "content": "", + "created_at": "2022-04-12T01:31:00.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 11, + "id": "AIMEslRcKrcu02D3HU", + "in_reply_to_account_id": null, + "in_reply_to_id": null, + "language": null, + "media_attachments": [ + { + "blurhash": "etMZzVWq%1%1o#_NayWCofae_Ns:R*kDjYS5a{jYoJj]V@a}WBbGof", + "description": "", + "id": "AIMEqtBeZtvpQvqfIG", + "meta": { + "original": { + "aspect": 0.9726443768996961, + "height": 658, + "width": 640 + } + }, + "pleroma": { + "mime_type": "image/jpeg" + }, + "preview_url": "https://media.gleasonator.com/6c0a1d878b7c9d1d737f415645cf34cdacdf6438c468348f4fa7534a15798023.jpg", + "remote_url": "https://media.gleasonator.com/6c0a1d878b7c9d1d737f415645cf34cdacdf6438c468348f4fa7534a15798023.jpg", + "text_url": "https://media.gleasonator.com/6c0a1d878b7c9d1d737f415645cf34cdacdf6438c468348f4fa7534a15798023.jpg", + "type": "image", + "url": "https://media.gleasonator.com/6c0a1d878b7c9d1d737f415645cf34cdacdf6438c468348f4fa7534a15798023.jpg" + } + ], + "mentions": [], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "" + }, + "content_type": null, + "conversation_id": "AIMEslPqRSCzuXNdWC", + "direct_conversation_id": null, + "emoji_reactions": [ + { + "count": 4, + "me": false, + "name": "😆" + }, + { + "count": 1, + "me": false, + "name": "🤢" + } + ], + "expires_at": null, + "in_reply_to_account_acct": null, + "local": true, + "parent_visible": false, + "pinned_at": null, + "quote": null, + "quote_url": null, + "quote_visible": false, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 4, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/7953f9fb-d3d7-4f50-b9d8-27e311ac1f5e", + "url": "https://gleasonator.com/notice/AIMEslRcKrcu02D3HU", + "visibility": "public" + }, + "type": "favourite" +} diff --git a/app/soapbox/__fixtures__/notification-follow.json b/app/soapbox/__fixtures__/notification-follow.json new file mode 100644 index 000000000..f563646ad --- /dev/null +++ b/app/soapbox/__fixtures__/notification-follow.json @@ -0,0 +1,61 @@ +{ + "account": { + "acct": "neko@rdrama.cc", + "avatar": "https://gleasonator.com/proxy/QJ3einzsXdobgWPsyZowxnor1zY/aHR0cHM6Ly9yZHJhbWEuY2MvbWVkaWEvODcyNDhjYjctZWYwNC00ZThjLWEwYzEtNTYxNWMyNWM0MTk1L2Jsb2I/blob", + "avatar_static": "https://gleasonator.com/proxy/QJ3einzsXdobgWPsyZowxnor1zY/aHR0cHM6Ly9yZHJhbWEuY2MvbWVkaWEvODcyNDhjYjctZWYwNC00ZThjLWEwYzEtNTYxNWMyNWM0MTk1L2Jsb2I/blob", + "bot": false, + "created_at": "2022-04-16T20:23:16.000Z", + "display_name": "Nekobit", + "emojis": [], + "fields": [], + "followers_count": 19, + "following_count": 357, + "fqn": "neko@rdrama.cc", + "header": "https://gleasonator.com/proxy/ojpBSVKfePvLnb7pwqepQspzIko/aHR0cHM6Ly9yZHJhbWEuY2MvbWVkaWEvNjBkMTJjOWYtOTNkNi00ODBmLThhMGUtMTE3M2ZkNjg5MzhmL3dhbGxwYXBlcmZsYXJlLmNvbV93YWxscGFwZXItd2ViLmpwZw/wallpaperflare.com_wallpaper-web.jpg", + "header_static": "https://gleasonator.com/proxy/ojpBSVKfePvLnb7pwqepQspzIko/aHR0cHM6Ly9yZHJhbWEuY2MvbWVkaWEvNjBkMTJjOWYtOTNkNi00ODBmLThhMGUtMTE3M2ZkNjg5MzhmL3dhbGxwYXBlcmZsYXJlLmNvbV93YWxscGFwZXItd2ViLmpwZw/wallpaperflare.com_wallpaper-web.jpg", + "id": "AIW9zGESDwdT27vk0W", + "last_status_at": "2022-04-16T21:49:29", + "locked": false, + "note": "New instance, hello!

Please follow if you followed my desuposter.club alt", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [], + "ap_id": "https://rdrama.cc/users/neko", + "background_image": null, + "deactivated": false, + "favicon": "https://gleasonator.com/proxy/dbCdmChqVRi0vjYTCpRj5lDLtNM/aHR0cHM6Ly9yZHJhbWEuY2MvZmF2aWNvbi5wbmc/favicon.png", + "hide_favorites": true, + "hide_followers": false, + "hide_followers_count": false, + "hide_follows": false, + "hide_follows_count": false, + "is_admin": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": false, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 6, + "url": "https://rdrama.cc/users/neko", + "username": "neko" + }, + "created_at": "2022-04-16T20:24:03.000Z", + "id": "429280", + "pleroma": { + "is_muted": false, + "is_seen": true + }, + "type": "follow" +} diff --git a/app/soapbox/__fixtures__/notification-follow_request.json b/app/soapbox/__fixtures__/notification-follow_request.json new file mode 100644 index 000000000..391dfec50 --- /dev/null +++ b/app/soapbox/__fixtures__/notification-follow_request.json @@ -0,0 +1,61 @@ +{ + "account": { + "acct": "alex@spinster.xyz", + "avatar": "https://gleasonator.com/images/avi.png", + "avatar_static": "https://gleasonator.com/images/avi.png", + "bot": false, + "created_at": "2020-01-08T03:08:22.000Z", + "display_name": "**MOVED**", + "emojis": [], + "fields": [], + "followers_count": 1005, + "following_count": 724, + "fqn": "alex@spinster.xyz", + "header": "https://gleasonator.com/proxy/yxa7ucolLFAsmBHYJzksSh_zoao/aHR0cHM6Ly9tZWRpYS5zcGluc3Rlci54eXovYWNjb3VudHMvaGVhZGVycy8wMDAvMDAwLzAwMS9vcmlnaW5hbC83ZmE4MWY5ZmZiYWVjZDk3LnBuZw/7fa81f9ffbaecd97.png", + "header_static": "https://gleasonator.com/proxy/yxa7ucolLFAsmBHYJzksSh_zoao/aHR0cHM6Ly9tZWRpYS5zcGluc3Rlci54eXovYWNjb3VudHMvaGVhZGVycy8wMDAvMDAwLzAwMS9vcmlnaW5hbC83ZmE4MWY5ZmZiYWVjZDk3LnBuZw/7fa81f9ffbaecd97.png", + "id": "9v5bmXkCYkqU30gp9s", + "last_status_at": null, + "locked": true, + "note": "Moved to https://spinster.xyz/@alex@gleasonator.com", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [], + "ap_id": "https://spinster.xyz/users/alex", + "background_image": null, + "deactivated": false, + "favicon": "https://gleasonator.com/proxy/owo6QgsHm_0ogz5enHyvD68wDUA/aHR0cHM6Ly9zcGluc3Rlci54eXovZmF2aWNvbi5wbmc/favicon.png", + "hide_favorites": true, + "hide_followers": false, + "hide_followers_count": false, + "hide_follows": false, + "hide_follows_count": false, + "is_admin": false, + "is_confirmed": false, + "is_moderator": false, + "is_suggested": false, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 2687, + "url": "https://spinster.xyz/users/alex", + "username": "alex" + }, + "created_at": "2020-12-30T02:23:35.000Z", + "id": "87967", + "pleroma": { + "is_muted": false, + "is_seen": true + }, + "type": "follow_request" +} diff --git a/app/soapbox/__fixtures__/notification-mention.json b/app/soapbox/__fixtures__/notification-mention.json new file mode 100644 index 000000000..d2ad0a265 --- /dev/null +++ b/app/soapbox/__fixtures__/notification-mention.json @@ -0,0 +1,226 @@ +{ + "account": { + "acct": "silverpill@mitra.social", + "avatar": "https://gleasonator.com/proxy/ZbLqy9s8Hxn9I5K23y2mffsL6iY/aHR0cHM6Ly9taXRyYS5zb2NpYWwvbWVkaWEvNmE3ODViZjdkZDA1ZjYxYzM1OTBlODkzNWFhNDkxNTZhNDk5YWMzMGZkMWU0MDJmNzllN2UxNjRhZGIzNmUyYy5wbmc/6a785bf7dd05f61c3590e8935aa49156a499ac30fd1e402f79e7e164adb36e2c.png", + "avatar_static": "https://gleasonator.com/proxy/ZbLqy9s8Hxn9I5K23y2mffsL6iY/aHR0cHM6Ly9taXRyYS5zb2NpYWwvbWVkaWEvNmE3ODViZjdkZDA1ZjYxYzM1OTBlODkzNWFhNDkxNTZhNDk5YWMzMGZkMWU0MDJmNzllN2UxNjRhZGIzNmUyYy5wbmc/6a785bf7dd05f61c3590e8935aa49156a499ac30fd1e402f79e7e164adb36e2c.png", + "bot": false, + "created_at": "2021-11-11T22:31:51.000Z", + "display_name": "silverpill", + "emojis": [], + "fields": [ + { + "name": "Matrix", + "value": "@silverpill:poa.st" + }, + { + "name": "Alt", + "value": "@silverpill@poa.st" + }, + { + "name": "Code", + "value": "https://codeberg.org/silverpill/" + }, + { + "name": "$XMR", + "value": "884y9LmsWY7PQNsyR7bJy1dvj91tuF5spVabyCnPk4KfQtSuzFbQobTFC7xSemJgVW1FWAwnJbjTZX5zZWbBrfkv62DB62d" + } + ], + "followers_count": 0, + "following_count": 0, + "fqn": "silverpill@mitra.social", + "header": "https://gleasonator.com/images/banner.png", + "header_static": "https://gleasonator.com/images/banner.png", + "id": "ADIzJ7q9gExPvDKBCS", + "last_status_at": "2022-04-15T11:27:33", + "locked": false, + "note": "", + "pleroma": { + "accepts_chat_messages": false, + "also_known_as": [], + "ap_id": "https://mitra.social/users/silverpill", + "background_image": null, + "deactivated": false, + "favicon": "https://gleasonator.com/proxy/XSE9_kQbQyYcSFWszWx2GgCbBuY/aHR0cHM6Ly9taXRyYS5zb2NpYWwvZmF2aWNvbi5pY28/favicon.ico", + "hide_favorites": true, + "hide_followers": true, + "hide_followers_count": false, + "hide_follows": true, + "hide_follows_count": false, + "is_admin": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": false, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 135, + "url": "https://mitra.social/users/silverpill", + "username": "silverpill" + }, + "created_at": "2022-04-15T11:27:33.000Z", + "id": "428172", + "pleroma": { + "is_muted": false, + "is_seen": true + }, + "status": { + "account": { + "acct": "silverpill@mitra.social", + "avatar": "https://gleasonator.com/proxy/ZbLqy9s8Hxn9I5K23y2mffsL6iY/aHR0cHM6Ly9taXRyYS5zb2NpYWwvbWVkaWEvNmE3ODViZjdkZDA1ZjYxYzM1OTBlODkzNWFhNDkxNTZhNDk5YWMzMGZkMWU0MDJmNzllN2UxNjRhZGIzNmUyYy5wbmc/6a785bf7dd05f61c3590e8935aa49156a499ac30fd1e402f79e7e164adb36e2c.png", + "avatar_static": "https://gleasonator.com/proxy/ZbLqy9s8Hxn9I5K23y2mffsL6iY/aHR0cHM6Ly9taXRyYS5zb2NpYWwvbWVkaWEvNmE3ODViZjdkZDA1ZjYxYzM1OTBlODkzNWFhNDkxNTZhNDk5YWMzMGZkMWU0MDJmNzllN2UxNjRhZGIzNmUyYy5wbmc/6a785bf7dd05f61c3590e8935aa49156a499ac30fd1e402f79e7e164adb36e2c.png", + "bot": false, + "created_at": "2021-11-11T22:31:51.000Z", + "display_name": "silverpill", + "emojis": [], + "fields": [ + { + "name": "Matrix", + "value": "@silverpill:poa.st" + }, + { + "name": "Alt", + "value": "@silverpill@poa.st" + }, + { + "name": "Code", + "value": "https://codeberg.org/silverpill/" + }, + { + "name": "$XMR", + "value": "884y9LmsWY7PQNsyR7bJy1dvj91tuF5spVabyCnPk4KfQtSuzFbQobTFC7xSemJgVW1FWAwnJbjTZX5zZWbBrfkv62DB62d" + } + ], + "followers_count": 0, + "following_count": 0, + "fqn": "silverpill@mitra.social", + "header": "https://gleasonator.com/images/banner.png", + "header_static": "https://gleasonator.com/images/banner.png", + "id": "ADIzJ7q9gExPvDKBCS", + "last_status_at": "2022-04-15T11:27:33", + "locked": false, + "note": "", + "pleroma": { + "accepts_chat_messages": false, + "also_known_as": [], + "ap_id": "https://mitra.social/users/silverpill", + "background_image": null, + "deactivated": false, + "favicon": "https://gleasonator.com/proxy/XSE9_kQbQyYcSFWszWx2GgCbBuY/aHR0cHM6Ly9taXRyYS5zb2NpYWwvZmF2aWNvbi5pY28/favicon.ico", + "hide_favorites": true, + "hide_followers": true, + "hide_followers_count": false, + "hide_follows": true, + "hide_follows_count": false, + "is_admin": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": false, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 135, + "url": "https://mitra.social/users/silverpill", + "username": "silverpill" + }, + "application": null, + "bookmarked": true, + "card": { + "author_name": "", + "author_url": "", + "blurhash": null, + "description": "The ActivityPub protocol is a decentralized social networking protocol\n based upon the [ActivityStreams] 2.0 data format.\n It provides a client to server API for creating, updating and deleting\n content, as well as a federated server to server API for delivering\n notifications and content.", + "embed_url": "", + "height": 0, + "html": "", + "image": null, + "provider_name": "www.w3.org", + "provider_url": "https://www.w3.org", + "title": "ActivityPub", + "type": "link", + "url": "https://www.w3.org/TR/activitypub/#retrieving-objects", + "width": 0 + }, + "content": "@alex @lain The second one is suggested by ActivityPub spec: https://www.w3.org/TR/activitypub/#retrieving-objects
\nThe first one is likely a legacy of earlier ActivityStreams standards, I'm not sure", + "created_at": "2022-04-15T11:27:28.000Z", + "emojis": [], + "favourited": true, + "favourites_count": 2, + "id": "AITJf9Wpr0msWChNBI", + "in_reply_to_account_id": "9v5bmRalQvjOy0ECcC", + "in_reply_to_id": "AISPFI5nnPaS7J94rI", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "alex", + "id": "9v5bmRalQvjOy0ECcC", + "url": "https://gleasonator.com/users/alex", + "username": "alex" + }, + { + "acct": "lain@lain.com", + "id": "9v5bqYwY2jfmvPNhTM", + "url": "https://lain.com/users/lain", + "username": "lain" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "@alex @lain The second one is suggested by ActivityPub spec: https://www.w3.org/TR/activitypub/#retrieving-objects\nThe first one is likely a legacy of earlier ActivityStreams standards, I'm not sure" + }, + "content_type": null, + "conversation_id": "AISPFI2bzH2DxPeWsy", + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "alex", + "local": false, + "parent_visible": true, + "pinned_at": null, + "quote": null, + "quote_url": null, + "quote_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://mitra.social/objects/01802cfa-633c-1c2c-e9cf-e6e0ffef0afe", + "url": "https://mitra.social/objects/01802cfa-633c-1c2c-e9cf-e6e0ffef0afe", + "visibility": "public" + }, + "type": "mention" +} diff --git a/app/soapbox/__fixtures__/notification-move.json b/app/soapbox/__fixtures__/notification-move.json new file mode 100644 index 000000000..4bffd1906 --- /dev/null +++ b/app/soapbox/__fixtures__/notification-move.json @@ -0,0 +1,119 @@ +{ + "account": { + "acct": "alex@fedibird.com", + "avatar": "https://gleasonator.com/images/avi.png", + "avatar_static": "https://gleasonator.com/images/avi.png", + "bot": false, + "created_at": "2022-01-24T21:25:37.000Z", + "display_name": "alex@fedibird.com", + "emojis": [], + "fields": [], + "followers_count": 0, + "following_count": 2, + "fqn": "alex@fedibird.com", + "header": "https://gleasonator.com/images/banner.png", + "header_static": "https://gleasonator.com/images/banner.png", + "id": "AFmHQ18XZ7Lco68MW8", + "last_status_at": "2022-03-16T22:07:53", + "locked": false, + "note": "

", + "pleroma": { + "accepts_chat_messages": null, + "also_known_as": [], + "ap_id": "https://fedibird.com/users/alex", + "background_image": null, + "birthday": "1993-07-03", + "deactivated": false, + "favicon": "https://gleasonator.com/proxy/HzfsidHss3CuA7aM2zxXN-tAjF8/aHR0cHM6Ly9mZWRpYmlyZC5jb20vZmF2aWNvbi5pY28/favicon.ico", + "hide_favorites": true, + "hide_followers": false, + "hide_followers_count": false, + "hide_follows": false, + "hide_follows_count": false, + "is_admin": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": false, + "location": "Texas", + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 5, + "url": "https://fedibird.com/@alex", + "username": "alex" + }, + "created_at": "2022-03-17T00:08:48.000Z", + "id": "406814", + "pleroma": { + "is_muted": false, + "is_seen": true + }, + "target": { + "acct": "benis911", + "avatar": "https://gleasonator.com/images/avi.png", + "avatar_static": "https://gleasonator.com/images/avi.png", + "bot": false, + "created_at": "2021-03-26T20:42:11.000Z", + "display_name": "benis911", + "emojis": [], + "fields": [], + "followers_count": 0, + "following_count": 0, + "fqn": "benis911@gleasonator.com", + "header": "https://media.gleasonator.com/fc595bbbcf5aabefecd1c2adfe5b7f5457db59847992881668653a0338ba25bd.jpg", + "header_static": "https://media.gleasonator.com/fc595bbbcf5aabefecd1c2adfe5b7f5457db59847992881668653a0338ba25bd.jpg", + "id": "A5c5LK7EJTFR0u26Pg", + "last_status_at": "2022-03-19T22:33:38", + "locked": false, + "note": "hello world 2", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [ + "https://gleasonator.com/users/alex", + "https://poa.st/users/alex", + "https://fedibird.com/users/alex" + ], + "ap_id": "https://gleasonator.com/users/benis911", + "background_image": null, + "birthday": "2000-01-25", + "deactivated": false, + "favicon": "https://gleasonator.com/favicon.png", + "hide_favorites": true, + "hide_followers": true, + "hide_followers_count": true, + "hide_follows": true, + "hide_follows_count": true, + "is_admin": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": false, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "hello world 2", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 174, + "url": "https://gleasonator.com/users/benis911", + "username": "benis911" + }, + "type": "move" +} diff --git a/app/soapbox/__fixtures__/notification-pleroma-chat_mention.json b/app/soapbox/__fixtures__/notification-pleroma-chat_mention.json new file mode 100644 index 000000000..c90cc7bb9 --- /dev/null +++ b/app/soapbox/__fixtures__/notification-pleroma-chat_mention.json @@ -0,0 +1,73 @@ +{ + "account": { + "acct": "dave", + "avatar": "https://media.gleasonator.com/68c29c30c18f30dd2898f85466bf1670312dda816617e6d31421c7e4c30a8265.png", + "avatar_static": "https://media.gleasonator.com/68c29c30c18f30dd2898f85466bf1670312dda816617e6d31421c7e4c30a8265.png", + "bot": false, + "created_at": "2020-02-01T07:28:46.000Z", + "display_name": "Elden Beedle 🇺🇦 🇫🇷", + "emojis": [], + "fields": [], + "followers_count": 490, + "following_count": 367, + "fqn": "dave@gleasonator.com", + "header": "https://media.gleasonator.com/47e8907c322a0e55d12b211846aa27c6b386e947326fe14bb09c89ef7317901d.jpg", + "header_static": "https://media.gleasonator.com/47e8907c322a0e55d12b211846aa27c6b386e947326fe14bb09c89ef7317901d.jpg", + "id": "9v5c0Pkz3MT5KTfam8", + "last_status_at": "2022-04-16T19:57:10", + "locked": false, + "note": "Beedle is back, baby!

Mostly just crosspost memes and stuff I find on the internet", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [], + "ap_id": "https://gleasonator.com/users/dave", + "background_image": null, + "birthday": "1990-01-01", + "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": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": true, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "Beedle is back, baby!\r\n\r\nMostly just crosspost memes and stuff I find on the internet", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 16758, + "url": "https://gleasonator.com/users/dave", + "username": "dave" + }, + "chat_message": { + "account_id": "9v5c0Pkz3MT5KTfam8", + "attachment": null, + "card": null, + "chat_id": "9yX4Q9DiC2te6lvk5g", + "content": "Cool, it works, I'll keep letting you know when I find broken stuff", + "created_at": "2022-04-16T19:22:54.000Z", + "emojis": [], + "id": "AIW4bHoICoZ9CsRTW4", + "unread": false + }, + "created_at": "2022-04-16T19:22:55.000Z", + "id": "429247", + "pleroma": { + "is_muted": false, + "is_seen": true + }, + "type": "pleroma:chat_mention" +} diff --git a/app/soapbox/__fixtures__/notification-pleroma-emoji_reaction.json b/app/soapbox/__fixtures__/notification-pleroma-emoji_reaction.json new file mode 100644 index 000000000..cc988d3a3 --- /dev/null +++ b/app/soapbox/__fixtures__/notification-pleroma-emoji_reaction.json @@ -0,0 +1,301 @@ +{ + "account": { + "acct": "dave", + "avatar": "https://media.gleasonator.com/68c29c30c18f30dd2898f85466bf1670312dda816617e6d31421c7e4c30a8265.png", + "avatar_static": "https://media.gleasonator.com/68c29c30c18f30dd2898f85466bf1670312dda816617e6d31421c7e4c30a8265.png", + "bot": false, + "created_at": "2020-02-01T07:28:46.000Z", + "display_name": "Elden Beedle 🇺🇦 🇫🇷", + "emojis": [], + "fields": [], + "followers_count": 490, + "following_count": 367, + "fqn": "dave@gleasonator.com", + "header": "https://media.gleasonator.com/47e8907c322a0e55d12b211846aa27c6b386e947326fe14bb09c89ef7317901d.jpg", + "header_static": "https://media.gleasonator.com/47e8907c322a0e55d12b211846aa27c6b386e947326fe14bb09c89ef7317901d.jpg", + "id": "9v5c0Pkz3MT5KTfam8", + "last_status_at": "2022-04-16T19:57:10", + "locked": false, + "note": "Beedle is back, baby!

Mostly just crosspost memes and stuff I find on the internet", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [], + "ap_id": "https://gleasonator.com/users/dave", + "background_image": null, + "birthday": "1990-01-01", + "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": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": true, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "Beedle is back, baby!\r\n\r\nMostly just crosspost memes and stuff I find on the internet", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 16758, + "url": "https://gleasonator.com/users/dave", + "username": "dave" + }, + "created_at": "2022-04-16T16:52:15.000Z", + "emoji": "😮", + "id": "429071", + "pleroma": { + "is_muted": false, + "is_seen": true + }, + "status": { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png", + "avatar_static": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + }, + { + "name": "Donate (PayPal)", + "value": "https://paypal.me/gleasonator" + }, + { + "name": "$BTC", + "value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n" + }, + { + "name": "$ETH", + "value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717" + }, + { + "name": "$DOGE", + "value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D" + }, + { + "name": "$XMR", + "value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK" + } + ], + "follow_requests_count": 0, + "followers_count": 2602, + "following_count": 1603, + "fqn": "alex@gleasonator.com", + "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", + "last_status_at": "2022-04-16T19:23:50", + "locked": false, + "note": "I create Fediverse software that empowers people online.

I'm vegan btw

Note: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.", + "pleroma": { + "accepts_chat_messages": true, + "accepts_email_list": true, + "allow_following_move": true, + "also_known_as": [ + "https://mitra.social/users/alex" + ], + "ap_id": "https://gleasonator.com/users/alex", + "background_image": null, + "birthday": "1993-07-03", + "deactivated": false, + "email": "alex@alexgleason.me", + "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_confirmed": true, + "is_moderator": false, + "is_suggested": true, + "location": "Texas", + "notification_settings": { + "block_from_strangers": false, + "hide_notification_contents": false + }, + "relationship": {}, + "skip_thread_containment": false, + "tags": [], + "unread_conversation_count": 392, + "unread_notifications_count": 0 + }, + "source": { + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + }, + { + "name": "Donate (PayPal)", + "value": "https://paypal.me/gleasonator" + }, + { + "name": "$BTC", + "value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n" + }, + { + "name": "$ETH", + "value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717" + }, + { + "name": "$DOGE", + "value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D" + }, + { + "name": "$XMR", + "value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK" + } + ], + "note": "I create Fediverse software that empowers people online.\r\n\r\nI'm vegan btw\r\n\r\nNote: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.", + "pleroma": { + "actor_type": "Person", + "discoverable": false, + "no_rich_text": false, + "show_birthday": true, + "show_role": true + }, + "privacy": "public", + "sensitive": false + }, + "statuses_count": 24050, + "url": "https://gleasonator.com/users/alex", + "username": "alex" + }, + "application": { + "name": "Soapbox FE", + "website": "https://soapbox.pub/" + }, + "bookmarked": false, + "card": { + "author_name": "Kaze Emanuar", + "author_url": "https://www.youtube.com/c/KazeEmanuar", + "blurhash": null, + "description": "", + "embed_url": null, + "height": 113, + "html": "", + "image": "https://gleasonator.com/proxy/mI004Vq00johZtAUmMp0fC_XAuM/aHR0cHM6Ly9pLnl0aW1nLmNvbS92aS90X3J6WW5YRVFsRS9ocWRlZmF1bHQuanBn/hqdefault.jpg", + "provider_name": "YouTube", + "provider_url": "https://www.youtube.com/", + "title": "FIXING the ENTIRE SM64 Source Code (INSANE N64 performance)", + "type": "video", + "url": "https://youtu.be/t_rzYnXEQlE", + "width": 200 + }, + "content": "

Bruh. This guy rewrote the reversed engineered Super Mario 64 code for 10x performance. Games need to be open source. https://youtu.be/t_rzYnXEQlE

", + "created_at": "2022-04-16T16:40:28.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 11, + "id": "AIVq6SrJg5yb8eGVsm", + "in_reply_to_account_id": null, + "in_reply_to_id": null, + "language": null, + "media_attachments": [], + "mentions": [], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "Bruh. This guy rewrote the reversed engineered Super Mario 64 code for 10x performance. Games need to be open source. https://youtu.be/t_rzYnXEQlE" + }, + "content_type": null, + "conversation_id": "AIVq6SqFk37r5LlfE0", + "direct_conversation_id": null, + "emoji_reactions": [ + { + "count": 1, + "me": false, + "name": "❤️" + }, + { + "count": 2, + "me": false, + "name": "😮" + }, + { + "count": 1, + "me": false, + "name": "😆" + }, + { + "count": 1, + "me": false, + "name": "👍🏻" + }, + { + "count": 1, + "me": false, + "name": "🔥" + } + ], + "expires_at": null, + "in_reply_to_account_acct": null, + "local": true, + "parent_visible": false, + "pinned_at": null, + "quote": null, + "quote_url": null, + "quote_visible": false, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 7, + "replies_count": 2, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/160dcbb2-73bc-4cd2-971e-e7f6a38602a0", + "url": "https://gleasonator.com/notice/AIVq6SrJg5yb8eGVsm", + "visibility": "public" + }, + "type": "pleroma:emoji_reaction" +} diff --git a/app/soapbox/__fixtures__/notification-poll.json b/app/soapbox/__fixtures__/notification-poll.json new file mode 100644 index 000000000..fe582f249 --- /dev/null +++ b/app/soapbox/__fixtures__/notification-poll.json @@ -0,0 +1,202 @@ +{ + "account": { + "acct": "dave", + "avatar": "https://media.gleasonator.com/68c29c30c18f30dd2898f85466bf1670312dda816617e6d31421c7e4c30a8265.png", + "avatar_static": "https://media.gleasonator.com/68c29c30c18f30dd2898f85466bf1670312dda816617e6d31421c7e4c30a8265.png", + "bot": false, + "created_at": "2020-02-01T07:28:46.000Z", + "display_name": "Elden Beedle 🇺🇦 🇫🇷", + "emojis": [], + "fields": [], + "followers_count": 490, + "following_count": 367, + "fqn": "dave@gleasonator.com", + "header": "https://media.gleasonator.com/47e8907c322a0e55d12b211846aa27c6b386e947326fe14bb09c89ef7317901d.jpg", + "header_static": "https://media.gleasonator.com/47e8907c322a0e55d12b211846aa27c6b386e947326fe14bb09c89ef7317901d.jpg", + "id": "9v5c0Pkz3MT5KTfam8", + "last_status_at": "2022-04-16T19:57:10", + "locked": false, + "note": "Beedle is back, baby!

Mostly just crosspost memes and stuff I find on the internet", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [], + "ap_id": "https://gleasonator.com/users/dave", + "background_image": null, + "birthday": "1990-01-01", + "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": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": true, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "Beedle is back, baby!\r\n\r\nMostly just crosspost memes and stuff I find on the internet", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 16758, + "url": "https://gleasonator.com/users/dave", + "username": "dave" + }, + "created_at": "2022-04-14T01:12:27.000Z", + "id": "427339", + "pleroma": { + "is_muted": false, + "is_seen": true + }, + "status": { + "account": { + "acct": "dave", + "avatar": "https://media.gleasonator.com/68c29c30c18f30dd2898f85466bf1670312dda816617e6d31421c7e4c30a8265.png", + "avatar_static": "https://media.gleasonator.com/68c29c30c18f30dd2898f85466bf1670312dda816617e6d31421c7e4c30a8265.png", + "bot": false, + "created_at": "2020-02-01T07:28:46.000Z", + "display_name": "Elden Beedle 🇺🇦 🇫🇷", + "emojis": [], + "fields": [], + "followers_count": 490, + "following_count": 367, + "fqn": "dave@gleasonator.com", + "header": "https://media.gleasonator.com/47e8907c322a0e55d12b211846aa27c6b386e947326fe14bb09c89ef7317901d.jpg", + "header_static": "https://media.gleasonator.com/47e8907c322a0e55d12b211846aa27c6b386e947326fe14bb09c89ef7317901d.jpg", + "id": "9v5c0Pkz3MT5KTfam8", + "last_status_at": "2022-04-16T19:57:10", + "locked": false, + "note": "Beedle is back, baby!

Mostly just crosspost memes and stuff I find on the internet", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [], + "ap_id": "https://gleasonator.com/users/dave", + "background_image": null, + "birthday": "1990-01-01", + "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": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": true, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "Beedle is back, baby!\r\n\r\nMostly just crosspost memes and stuff I find on the internet", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 16758, + "url": "https://gleasonator.com/users/dave", + "username": "dave" + }, + "application": { + "name": "Soapbox FE", + "website": "https://soapbox.pub/" + }, + "bookmarked": false, + "card": null, + "content": "

Focusing on just the look, what do you guys think?

", + "created_at": "2022-04-13T01:12:26.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 1, + "id": "AIOHjtGEaqUHoXGVf6", + "in_reply_to_account_id": "9v5c0Pkz3MT5KTfam8", + "in_reply_to_id": "AIOFTLqQrljhdNBNHE", + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "dave", + "id": "9v5c0Pkz3MT5KTfam8", + "url": "https://gleasonator.com/users/dave", + "username": "dave" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "Focusing on just the look, what do you guys think?" + }, + "content_type": null, + "conversation_id": "AIOFTLp0x2bNYyWF4C", + "direct_conversation_id": null, + "emoji_reactions": [], + "expires_at": null, + "in_reply_to_account_acct": "dave", + "local": true, + "parent_visible": true, + "pinned_at": null, + "quote": null, + "quote_url": null, + "quote_visible": false, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": { + "emojis": [], + "expired": true, + "expires_at": "2022-04-14T01:12:26.000Z", + "id": "AIOHjtAuucEZY2mGNE", + "multiple": false, + "options": [ + { + "title": "Looks good, looking forward to wider deployment", + "votes_count": 10 + }, + { + "title": "Not a fan, l'll stick to the current UI thanks", + "votes_count": 1 + }, + { + "title": "Hard to say, need to actually try to decide honestly", + "votes_count": 1 + } + ], + "own_votes": [ + 0 + ], + "voted": true, + "voters_count": 12, + "votes_count": 12 + }, + "reblog": null, + "reblogged": false, + "reblogs_count": 1, + "replies_count": 1, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/a8465271-a48d-4c39-a0a9-d3eda3ab2735", + "url": "https://gleasonator.com/notice/AIOHjtGEaqUHoXGVf6", + "visibility": "public" + }, + "type": "poll" +} diff --git a/app/soapbox/__fixtures__/notification-reblog.json b/app/soapbox/__fixtures__/notification-reblog.json new file mode 100644 index 000000000..94638b8cd --- /dev/null +++ b/app/soapbox/__fixtures__/notification-reblog.json @@ -0,0 +1,284 @@ +{ + "account": { + "acct": "rob@nicecrew.digital", + "avatar": "https://gleasonator.com/proxy/RcEgR4-0InIpw_sCpDWV-XrAbmY/aHR0cHM6Ly9uaWNlY3Jldy5kaWdpdGFsL21lZGlhL2M0MTllMTk1Nzg0MmEzMTY5M2MzNDExNTZlMTBhNmQwMTY2ZTM5YzQzM2ExZTczMmVmYWNlYmJkYjAyMDYzZjEucG5n/c419e1957842a31693c341156e10a6d0166e39c433a1e732efacebbdb02063f1.png", + "avatar_static": "https://gleasonator.com/proxy/RcEgR4-0InIpw_sCpDWV-XrAbmY/aHR0cHM6Ly9uaWNlY3Jldy5kaWdpdGFsL21lZGlhL2M0MTllMTk1Nzg0MmEzMTY5M2MzNDExNTZlMTBhNmQwMTY2ZTM5YzQzM2ExZTczMmVmYWNlYmJkYjAyMDYzZjEucG5n/c419e1957842a31693c341156e10a6d0166e39c433a1e732efacebbdb02063f1.png", + "bot": false, + "created_at": "2022-03-10T12:30:41.000Z", + "display_name": "Rob Colbert", + "emojis": [], + "fields": [ + { + "name": "Shing.tv", + "value": "https://shing.tv" + }, + { + "name": "LibertyLinks", + "value": "https://libertylinks.io" + }, + { + "name": "GiveSendGo", + "value": "https://givesendgo.com/dtp" + } + ], + "followers_count": 0, + "following_count": 0, + "fqn": "rob@nicecrew.digital", + "header": "https://gleasonator.com/proxy/t4--aro68-XZlasaR2bYiuiZMcA/aHR0cHM6Ly9uaWNlY3Jldy5kaWdpdGFsL21lZGlhL2E5ODYzYWE4YjEzM2QwMzkxNmU1N2MzNDgzMzBhZmE5MTM5MDFlNGZiMDEwYjk1Y2FiZjlmYmZiZTA4N2QxODMucG5n/a9863aa8b133d03916e57c348330afa913901e4fb010b95cabf9fbfbe087d183.png", + "header_static": "https://gleasonator.com/proxy/t4--aro68-XZlasaR2bYiuiZMcA/aHR0cHM6Ly9uaWNlY3Jldy5kaWdpdGFsL21lZGlhL2E5ODYzYWE4YjEzM2QwMzkxNmU1N2MzNDgzMzBhZmE5MTM5MDFlNGZiMDEwYjk1Y2FiZjlmYmZiZTA4N2QxODMucG5n/a9863aa8b133d03916e57c348330afa913901e4fb010b95cabf9fbfbe087d183.png", + "id": "AHGmnebARD1aa1IiBc", + "last_status_at": "2022-04-16T21:08:35", + "locked": false, + "note": "Creator and CTO of the Digital Telepresence Platform and DTP Technologies, LLC.", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [], + "ap_id": "https://nicecrew.digital/users/rob", + "background_image": null, + "deactivated": false, + "favicon": "https://gleasonator.com/proxy/gb2NPo0Kv_svADN1_J9_9iSwlrY/aHR0cHM6Ly9uaWNlY3Jldy5kaWdpdGFsL2Zhdmljb24ucG5n/favicon.png", + "hide_favorites": true, + "hide_followers": true, + "hide_followers_count": false, + "hide_follows": true, + "hide_follows_count": false, + "is_admin": false, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": false, + "location": null, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 761, + "url": "https://nicecrew.digital/users/rob", + "username": "rob" + }, + "created_at": "2022-04-16T03:43:24.000Z", + "id": "428608", + "pleroma": { + "is_muted": false, + "is_seen": true + }, + "status": { + "account": { + "acct": "alex", + "avatar": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png", + "avatar_static": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + }, + { + "name": "Donate (PayPal)", + "value": "https://paypal.me/gleasonator" + }, + { + "name": "$BTC", + "value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n" + }, + { + "name": "$ETH", + "value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717" + }, + { + "name": "$DOGE", + "value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D" + }, + { + "name": "$XMR", + "value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK" + } + ], + "follow_requests_count": 0, + "followers_count": 2602, + "following_count": 1603, + "fqn": "alex@gleasonator.com", + "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", + "last_status_at": "2022-04-16T19:23:50", + "locked": false, + "note": "I create Fediverse software that empowers people online.

I'm vegan btw

Note: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.", + "pleroma": { + "accepts_chat_messages": true, + "accepts_email_list": true, + "allow_following_move": true, + "also_known_as": [ + "https://mitra.social/users/alex" + ], + "ap_id": "https://gleasonator.com/users/alex", + "background_image": null, + "birthday": "1993-07-03", + "deactivated": false, + "email": "alex@alexgleason.me", + "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_confirmed": true, + "is_moderator": false, + "is_suggested": true, + "location": "Texas", + "notification_settings": { + "block_from_strangers": false, + "hide_notification_contents": false + }, + "relationship": {}, + "skip_thread_containment": false, + "tags": [], + "unread_conversation_count": 392, + "unread_notifications_count": 0 + }, + "source": { + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Soapbox", + "value": "https://soapbox.pub" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + }, + { + "name": "Donate (PayPal)", + "value": "https://paypal.me/gleasonator" + }, + { + "name": "$BTC", + "value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n" + }, + { + "name": "$ETH", + "value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717" + }, + { + "name": "$DOGE", + "value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D" + }, + { + "name": "$XMR", + "value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK" + } + ], + "note": "I create Fediverse software that empowers people online.\r\n\r\nI'm vegan btw\r\n\r\nNote: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.", + "pleroma": { + "actor_type": "Person", + "discoverable": false, + "no_rich_text": false, + "show_birthday": true, + "show_role": true + }, + "privacy": "public", + "sensitive": false + }, + "statuses_count": 24050, + "url": "https://gleasonator.com/users/alex", + "username": "alex" + }, + "application": { + "name": "Soapbox FE", + "website": "https://soapbox.pub/" + }, + "bookmarked": false, + "card": null, + "content": "

The @fsf needs to give out an award to every American who has never downloaded TikTok.

", + "created_at": "2022-04-16T03:42:50.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 15, + "id": "AIUihbqUEe5Uvv7P9s", + "in_reply_to_account_id": null, + "in_reply_to_id": null, + "language": null, + "media_attachments": [], + "mentions": [ + { + "acct": "fsf@status.fsf.org", + "id": "9v5boQSsaxVc3AU8u0", + "url": "https://status.fsf.org/fsf", + "username": "fsf" + } + ], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "The @fsf needs to give out an award to every American who has never downloaded TikTok." + }, + "content_type": null, + "conversation_id": "AIUihbp4JuxArWSGwq", + "direct_conversation_id": null, + "emoji_reactions": [ + { + "count": 2, + "me": false, + "name": "🔥" + } + ], + "expires_at": null, + "in_reply_to_account_acct": null, + "local": true, + "parent_visible": false, + "pinned_at": null, + "quote": null, + "quote_url": null, + "quote_visible": false, + "spoiler_text": { + "text/plain": "" + }, + "thread_muted": false + }, + "poll": null, + "reblog": null, + "reblogged": false, + "reblogs_count": 8, + "replies_count": 4, + "sensitive": false, + "spoiler_text": "", + "tags": [], + "text": null, + "uri": "https://gleasonator.com/objects/6be95787-fb9c-41cd-96cf-9652b2680863", + "url": "https://gleasonator.com/notice/AIUihbqUEe5Uvv7P9s", + "visibility": "public" + }, + "type": "reblog" +} diff --git a/app/soapbox/__fixtures__/pleroma-status-vertical-video-without-metadata.json b/app/soapbox/__fixtures__/pleroma-status-vertical-video-without-metadata.json new file mode 100644 index 000000000..edb24b9ef --- /dev/null +++ b/app/soapbox/__fixtures__/pleroma-status-vertical-video-without-metadata.json @@ -0,0 +1,108 @@ +{ + "account": { + "acct": "alex", + "avatar": "https://freespeechextremist.com/images/avi.png", + "avatar_static": "https://freespeechextremist.com/images/avi.png", + "bot": false, + "created_at": "2022-02-28T01:55:05.000Z", + "display_name": "Alex Gleason", + "emojis": [], + "fields": [], + "followers_count": 1, + "following_count": 0, + "header": "https://freespeechextremist.com/images/banner.png", + "header_static": "https://freespeechextremist.com/images/banner.png", + "id": "AGv8wCadU7DqWgMqNk", + "locked": false, + "note": "I'm testing out compatibility with an older Pleroma version", + "pleroma": { + "accepts_chat_messages": true, + "ap_id": "https://freespeechextremist.com/users/alex", + "background_image": null, + "confirmation_pending": false, + "favicon": null, + "hide_favorites": true, + "hide_followers": false, + "hide_followers_count": false, + "hide_follows": false, + "hide_follows_count": false, + "is_admin": false, + "is_moderator": false, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [], + "note": "I'm testing out compatibility with an older Pleroma version", + "pleroma": { + "actor_type": "Person", + "discoverable": true + }, + "sensitive": false + }, + "statuses_count": 1, + "url": "https://freespeechextremist.com/users/alex", + "username": "alex" + }, + "application": { + "name": "Web", + "website": null + }, + "bookmarked": false, + "card": null, + "content": "
0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm", + "created_at": "2022-04-14T19:42:48.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 0, + "id": "AIRxLeIzncpCtsr2hs", + "in_reply_to_account_id": null, + "in_reply_to_id": null, + "language": null, + "media_attachments": [ + { + "description": "0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm", + "id": "1142674091", + "pleroma": { + "mime_type": "video/webm" + }, + "preview_url": "https://freespeechextremist.com/media/3e34b808-1c84-4ef3-ba56-67cc86b7911a/0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm?name=0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm", + "remote_url": "https://freespeechextremist.com/media/3e34b808-1c84-4ef3-ba56-67cc86b7911a/0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm?name=0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm", + "text_url": "https://freespeechextremist.com/media/3e34b808-1c84-4ef3-ba56-67cc86b7911a/0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm?name=0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm", + "type": "video", + "url": "https://freespeechextremist.com/media/3e34b808-1c84-4ef3-ba56-67cc86b7911a/0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm?name=0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm" + } + ], + "mentions": [], + "muted": false, + "pinned": false, + "pleroma": { + "content": { + "text/plain": "0f66e92f339705ccc03079b8f647048e15730adf2cc9eaa1071c7c7cf6884b1b.webm" + }, + "conversation_id": 97191096, + "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://freespeechextremist.com/objects/419b2cad-656a-4dbc-b2b5-94bb75e0afc8", + "url": "https://freespeechextremist.com/notice/AIRxLeIzncpCtsr2hs", + "visibility": "public" +} diff --git a/app/soapbox/__fixtures__/spinster-soapbox.json b/app/soapbox/__fixtures__/spinster-soapbox.json new file mode 100644 index 000000000..8f3ed63fa --- /dev/null +++ b/app/soapbox/__fixtures__/spinster-soapbox.json @@ -0,0 +1,119 @@ +{ + "allowedEmoji": [ + "👍", + "❤️", + "😆", + "😮", + "😢", + "😡", + "😩" + ], + "brandColor": "#990099", + "copyright": "♡2021. Copying is an act of love. Please copy and share.", + "cryptoAddresses": [ + { + "address": "bc1qv7lk3algpfg4zpyuhvxfm0uza9ck4parz3y3l5", + "note": "", + "ticker": "btc" + }, + { + "address": "0xadc66B63bFee7677CD27CFb81b16a8860f1A1226", + "note": "", + "ticker": "eth" + }, + { + "address": "DSf7UmRf7DGGsjh4QYhzQaqtjJMTXZ8k79", + "note": "", + "ticker": "doge" + }, + { + "address": "ltc1q642pnkuvw0gpuuvddw6vafvl9hhp3efyl9mnqz", + "note": "", + "ticker": "ltc" + }, + { + "address": "t1faHDsoa4bd3pGaLjaU7DiuUtBPzbnEEse", + "note": "", + "ticker": "zec" + }, + { + "address": "XchTLkcSMsDoZGESwr4tqtxSU5dideAZVQ", + "note": "", + "ticker": "dash" + }, + { + "address": "bitcoincash:qp8f80z27294phmhdk55yf05p3f0tkxl4v9r2aavw5", + "note": "", + "ticker": "bch" + } + ], + "cryptoDonatePanel": { + "limit": 1 + }, + "customCss": [ + "/instance/spinster.css" + ], + "defaultSettings": { + "autoPlayGif": false, + "themeMode": "light" + }, + "extensions": { + "patron": { + "enabled": true + } + }, + "logo": "https://spinster.xyz/instance/images/spinster-logo.svg", + "navlinks": { + "homeFooter": [ + { + "title": "About", + "url": "/about" + }, + { + "title": "Terms of Service", + "url": "/about/tos" + }, + { + "title": "Privacy Policy", + "url": "/about/privacy" + }, + { + "title": "DMCA", + "url": "/about/dmca" + }, + { + "title": "Source Code", + "url": "/about#opensource" + } + ] + }, + "promoPanel": { + "items": [ + { + "icon": "shopping-basket", + "text": "Buy Spinster Merch", + "url": "https://shop.4w.pub/collections/spinster" + }, + { + "icon": "eye-slash", + "text": "Privacy Guide", + "url": "https://4w.pub/your-guide-to-spinster-privacy-options/" + }, + { + "icon": "question-circle", + "text": "Spinster FAQs", + "url": "https://spinster.xyz/about#faqs" + }, + { + "icon": "bug", + "text": "Report a Bug", + "url": "https://gitlab.com/soapbox-pub/soapbox-fe/-/issues/" + }, + { + "icon": "fediverse", + "text": "About the Fediverse", + "url": "https://jointhefedi.com/" + } + ] + } +} diff --git a/app/soapbox/actions/accounts.js b/app/soapbox/actions/accounts.js index 23aad5601..1005af838 100644 --- a/app/soapbox/actions/accounts.js +++ b/app/soapbox/actions/accounts.js @@ -1035,7 +1035,7 @@ export function accountLookup(acct, cancelToken) { }; } -export function fetchBirthdayReminders(day, month) { +export function fetchBirthdayReminders(month, day) { return (dispatch, getState) => { if (!isLoggedIn(getState)) return; diff --git a/app/soapbox/actions/auth.js b/app/soapbox/actions/auth.js index 5c0fc467a..00f9c606d 100644 --- a/app/soapbox/actions/auth.js +++ b/app/soapbox/actions/auth.js @@ -249,10 +249,12 @@ export function logOut(intl) { const account = getLoggedInAccount(state); const standalone = isStandalone(state); + if (!account) return dispatch(noOp); + const params = { client_id: state.getIn(['auth', 'app', 'client_id']), client_secret: state.getIn(['auth', 'app', 'client_secret']), - token: state.getIn(['auth', 'users', account.get('url'), 'access_token']), + token: state.getIn(['auth', 'users', account.url, 'access_token']), }; return Promise.all([ diff --git a/app/soapbox/actions/chats.js b/app/soapbox/actions/chats.js index 8003bb8cb..0a8d1d75c 100644 --- a/app/soapbox/actions/chats.js +++ b/app/soapbox/actions/chats.js @@ -61,14 +61,14 @@ export function fetchChatsV2() { export function fetchChats() { return (dispatch, getState) => { const state = getState(); - const instance = state.get('instance'); + const { instance } = state; const features = getFeatures(instance); dispatch({ type: CHATS_FETCH_REQUEST }); if (features.chatsV2) { - dispatch(fetchChatsV2()); + return dispatch(fetchChatsV2()); } else { - dispatch(fetchChatsV1()); + return dispatch(fetchChatsV1()); } }; } diff --git a/app/soapbox/actions/external_auth.js b/app/soapbox/actions/external_auth.js index 8bf0bba3f..4f389667f 100644 --- a/app/soapbox/actions/external_auth.js +++ b/app/soapbox/actions/external_auth.js @@ -42,7 +42,7 @@ function createExternalApp(instance, baseURL) { const params = { client_name: sourceCode.displayName, - redirect_uris: `${window.location.origin}/auth/external`, + redirect_uris: `${window.location.origin}/login/external`, website: sourceCode.homepage, scopes, }; diff --git a/app/soapbox/actions/notifications.js b/app/soapbox/actions/notifications.js index ce7e5eca0..66918c698 100644 --- a/app/soapbox/actions/notifications.js +++ b/app/soapbox/actions/notifications.js @@ -98,7 +98,7 @@ export function updateNotificationsQueue(notification, intlMessages, intlLocale, const isOnNotificationsPage = curPath === '/notifications'; - if (notification.type === 'mention') { + if (['mention', 'status'].includes(notification.type)) { const regex = regexFromFilters(filters); const searchIndex = notification.status.spoiler_text + '\n' + unescapeHTML(notification.status.content); filtered = regex && regex.test(searchIndex); @@ -170,7 +170,7 @@ export function dequeueNotifications() { const excludeTypesFromSettings = getState => getSettings(getState()).getIn(['notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); const excludeTypesFromFilter = filter => { - const allTypes = ImmutableList(['follow', 'follow_request', 'favourite', 'reblog', 'mention', 'poll', 'move', 'pleroma:emoji_reaction']); + const allTypes = ImmutableList(['follow', 'follow_request', 'favourite', 'reblog', 'mention', 'status', 'poll', 'move', 'pleroma:emoji_reaction']); return allTypes.filterNot(item => item === filter).toJS(); }; diff --git a/app/soapbox/actions/security.js b/app/soapbox/actions/security.js index 53cf6293d..5f40f60f3 100644 --- a/app/soapbox/actions/security.js +++ b/app/soapbox/actions/security.js @@ -6,6 +6,7 @@ import snackbar from 'soapbox/actions/snackbar'; import { getLoggedInAccount } from 'soapbox/utils/auth'; +import { parseVersion, TRUTHSOCIAL } from 'soapbox/utils/features'; import api from '../api'; @@ -84,12 +85,22 @@ export function changePassword(oldPassword, newPassword, confirmation) { export function resetPassword(usernameOrEmail) { return (dispatch, getState) => { + const state = getState(); + const v = parseVersion(state.instance); + dispatch({ type: RESET_PASSWORD_REQUEST }); + const params = usernameOrEmail.includes('@') ? { email: usernameOrEmail } - : { username: usernameOrEmail }; - return api(getState).post('/api/v1/truth/password_reset/request', params).then(() => { + : { nickname: usernameOrEmail, username: usernameOrEmail }; + + const endpoint = + v.software === TRUTHSOCIAL + ? '/api/v1/truth/password_reset/request' + : '/auth/password'; + + return api(getState).post(endpoint, params).then(() => { dispatch({ type: RESET_PASSWORD_SUCCESS }); }).catch(error => { dispatch({ type: RESET_PASSWORD_FAIL, error }); diff --git a/app/soapbox/actions/settings.js b/app/soapbox/actions/settings.js index 4c7768bd2..098cdfdb1 100644 --- a/app/soapbox/actions/settings.js +++ b/app/soapbox/actions/settings.js @@ -1,12 +1,11 @@ import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet } from 'immutable'; import { defineMessages } from 'react-intl'; import { createSelector } from 'reselect'; +import { v4 as uuid } from 'uuid'; import { patchMe } from 'soapbox/actions/me'; import { isLoggedIn } from 'soapbox/utils/auth'; -import uuid from '../uuid'; - import { showAlertForError } from './alerts'; import snackbar from './snackbar'; @@ -85,7 +84,7 @@ export const defaultSettings = ImmutableMap({ shows: ImmutableMap({ follow: true, - follow_request: false, + follow_request: true, favourite: true, reblog: true, mention: true, diff --git a/app/soapbox/actions/soapbox.js b/app/soapbox/actions/soapbox.js index 0b18c9bc1..318050219 100644 --- a/app/soapbox/actions/soapbox.js +++ b/app/soapbox/actions/soapbox.js @@ -47,21 +47,34 @@ export function rememberSoapboxConfig(host) { }; } -export function fetchSoapboxConfig(host) { +export function fetchFrontendConfigurations() { return (dispatch, getState) => { - api(getState).get('/api/pleroma/frontend_configurations').then(response => { - if (response.data.soapbox_fe) { - dispatch(importSoapboxConfig(response.data.soapbox_fe, host)); - } else { - dispatch(fetchSoapboxJson(host)); - } - }).catch(error => { - dispatch(fetchSoapboxJson(host)); - }); + return api(getState) + .get('/api/pleroma/frontend_configurations') + .then(({ data }) => data); }; } -// Tries to remember the config from browser storage before fetching it +/** Conditionally fetches Soapbox config depending on backend features */ +export function fetchSoapboxConfig(host) { + return (dispatch, getState) => { + const features = getFeatures(getState().instance); + + if (features.frontendConfigurations) { + return dispatch(fetchFrontendConfigurations()).then(data => { + if (data.soapbox_fe) { + dispatch(importSoapboxConfig(data.soapbox_fe, host)); + } else { + dispatch(fetchSoapboxJson(host)); + } + }); + } else { + return dispatch(fetchSoapboxJson(host)); + } + }; +} + +/** Tries to remember the config from browser storage before fetching it */ export function loadSoapboxConfig() { return (dispatch, getState) => { const host = getHost(getState()); diff --git a/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index 3288127a1..c60893e5a 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -35,6 +35,7 @@ interface IAccount { showProfileHoverCard?: boolean, timestamp?: string | Date, timestampUrl?: string, + withDate?: boolean, withRelationship?: boolean, } @@ -51,6 +52,7 @@ const Account = ({ showProfileHoverCard = true, timestamp, timestampUrl, + withDate = false, withRelationship = true, }: IAccount) => { const overflowRef = React.useRef(null); @@ -89,7 +91,7 @@ const Account = ({ ); } - if (account.get('id') !== me && account.get('relationship', null) !== null) { + if (account.id !== me) { return ; } @@ -116,39 +118,41 @@ const Account = ({ if (hidden) { return ( <> - {account.get('display_name')} - {account.get('username')} + {account.display_name} + {account.username} ); } + if (withDate) timestamp = account.created_at; + const LinkEl: any = showProfileHoverCard ? Link : 'div'; return ( -
+
{children}} + wrapper={(children) => {children}} > event.stopPropagation()} > - +
{children}} + wrapper={(children) => {children}} > event.stopPropagation()} >
@@ -156,10 +160,10 @@ const Account = ({ size='sm' weight='semibold' truncate - dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} + dangerouslySetInnerHTML={{ __html: account.display_name_html }} /> - {account.get('verified') && } + {account.verified && }
@@ -167,16 +171,22 @@ const Account = ({ @{username} + {account.favicon && ( + e.stopPropagation()}> + + + )} + {(timestamp) ? ( <> · {timestampUrl ? ( - + ) : ( - + )} ) : null} diff --git a/app/soapbox/components/autosuggest_input.js b/app/soapbox/components/autosuggest_input.js index 1bb2e2edf..af83c7774 100644 --- a/app/soapbox/components/autosuggest_input.js +++ b/app/soapbox/components/autosuggest_input.js @@ -206,8 +206,8 @@ export default class AutosuggestInput extends ImmutablePureComponent { key={key} data-index={i} className={classNames({ - 'px-4 py-2.5 text-sm text-gray-700 cursor-pointer hover:bg-gray-100 group': true, - 'bg-gray-100 hover:bg-gray-100': i === selectedSuggestion, + 'px-4 py-2.5 text-sm text-gray-700 dark:text-gray-400 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 group': true, + 'bg-gray-100 dark:bg-slate-700 hover:bg-gray-100 dark:hover:bg-gray-700': i === selectedSuggestion, })} onMouseDown={this.onSuggestionClick} > @@ -238,7 +238,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { return menu.map((item, i) => (
@@ -257,7 +257,8 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {