From c084a7a232a4a8df2913fe126c39b1feb9ea854b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 7 Feb 2022 12:19:28 -0600 Subject: [PATCH] Mitra: handle status context endpoint as a list of statuses --- app/soapbox/__fixtures__/mitra-context.json | 107 ++++++++++++++++++ .../actions/__tests__/statuses-test.js | Bin 0 -> 915 bytes app/soapbox/actions/statuses.js | Bin 6556 -> 6871 bytes 3 files changed, 107 insertions(+) create mode 100644 app/soapbox/__fixtures__/mitra-context.json create mode 100644 app/soapbox/actions/__tests__/statuses-test.js diff --git a/app/soapbox/__fixtures__/mitra-context.json b/app/soapbox/__fixtures__/mitra-context.json new file mode 100644 index 0000000000..91b48420c9 --- /dev/null +++ b/app/soapbox/__fixtures__/mitra-context.json @@ -0,0 +1,107 @@ +[ + { + "id": "017ed503-bc96-301a-e871-2c23b30ddd05", + "uri": "https://mitra.social/objects/017ed503-bc96-301a-e871-2c23b30ddd05", + "created_at": "2022-02-07T16:28:18.966874Z", + "account": { + "id": "017ed4f9-c121-2ae6-0805-15516cce02c3", + "username": "alex", + "acct": "alex", + "url": "https://mitra.social/users/alex", + "display_name": null, + "created_at": "2022-02-07T16:17:24.769229Z", + "note": null, + "avatar": null, + "header": null, + "fields": [], + "followers_count": 1, + "following_count": 1, + "statuses_count": 3, + "source": null, + "wallet_address": null + }, + "content": "@silverpill sup!", + "in_reply_to_id": null, + "reblog": null, + "visibility": "public", + "replies_count": 1, + "favourites_count": 0, + "reblogs_count": 0, + "media_attachments": [], + "mentions": [ + { + "id": "dd4ebc18-269d-4c7b-a310-03d29c6ab551", + "username": "silverpill", + "acct": "silverpill", + "url": "https://mitra.social/users/silverpill" + } + ], + "tags": [], + "favourited": false, + "reblogged": false, + "ipfs_cid": null, + "token_id": null, + "token_tx_id": null + }, + { + "id": "017ed505-5926-392f-256a-f86d5075df70", + "uri": "https://mitra.social/objects/017ed505-5926-392f-256a-f86d5075df70", + "created_at": "2022-02-07T16:30:04.582771Z", + "account": { + "id": "dd4ebc18-269d-4c7b-a310-03d29c6ab551", + "username": "silverpill", + "acct": "silverpill", + "url": "https://mitra.social/users/silverpill", + "display_name": "silverpill", + "created_at": "2021-11-06T21:08:57.441927Z", + "note": "Admin of mitra.social instance. It is running experimental ActivityPub server Mitra.", + "avatar": "https://mitra.social/media/6a785bf7dd05f61c3590e8935aa49156a499ac30fd1e402f79e7e164adb36e2c.png", + "header": null, + "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": 27, + "following_count": 15, + "statuses_count": 110, + "source": null, + "wallet_address": null + }, + "content": "@alex welcome", + "in_reply_to_id": "017ed503-bc96-301a-e871-2c23b30ddd05", + "reblog": null, + "visibility": "public", + "replies_count": 0, + "favourites_count": 1, + "reblogs_count": 0, + "media_attachments": [], + "mentions": [ + { + "id": "017ed4f9-c121-2ae6-0805-15516cce02c3", + "username": "alex", + "acct": "alex", + "url": "https://mitra.social/users/alex" + } + ], + "tags": [], + "favourited": true, + "reblogged": false, + "ipfs_cid": null, + "token_id": null, + "token_tx_id": null + } +] diff --git a/app/soapbox/actions/__tests__/statuses-test.js b/app/soapbox/actions/__tests__/statuses-test.js new file mode 100644 index 0000000000000000000000000000000000000000..71a0596a4496278d9cf5f55db18222d768d730e8 GIT binary patch literal 915 zcma)4(QcbC6n)QE+&7F=3?U+EG-XmXRZ}0LO-uGvRmkAW;teph&6KL@zt09t({&F+ z;=%Sg=bn4+6-_6VfoIsW4w#0!rs)kUYINrpsFZ9V5dJdwuviGsI2><|-w(Hk{BHmC z%eUi<){=FFJjbjwLbf^{38*Z2=H|IJees^siAz)?%U=g06}|%+)FwY+-J#NNOjT&g z(-NPN^d+pqEf?o4I- z8Lg$5bt3+~ocoEB8TTN>PPf{Y26v zxtgt88}8}F+wqOL0qh1B!!XF@j*!r!wHp-WLU+uLfV_z|_#c-+7*cb>mP~FhBN(kr z8)eOm#eSf<8JCQB7XWzfury@C-mf00dFs$g%iG7E)#R_Wotpj^&yVyzd7y&7D)??z yQBiJf=E;&pc)eLhX_>ByRl+$>vU#X5tcx=^hD*yKAJ>trk)l#k4UaB&_x}MNFd!NL literal 0 HcmV?d00001 diff --git a/app/soapbox/actions/statuses.js b/app/soapbox/actions/statuses.js index 150b6d8c79efeb8233a92523a017a6a25ec7610e..12dfaa576dd879acd9249470b78a1955ffa73d40 100644 GIT binary patch delta 303 zcmZ9Hu}T9$5QZx)u9L+!{6*lB#uTE6dPPc+fZz+SQG_u>N$0{+q)yR&V%Z)zYx9rbsW84!x}0&&v&eeoA6{_5u?eDB4(4-xMU_z6%m~*!z(y>uZYcNbHq)$