From f83119bfc9721277d10ae7520008ed1cf5109fac Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 26 Mar 2022 11:17:27 -0500 Subject: [PATCH] Filter statuses by full acct with @ symbol --- app/soapbox/reducers/__tests__/statuses-test.js | 10 ++++------ app/soapbox/reducers/statuses.ts | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/soapbox/reducers/__tests__/statuses-test.js b/app/soapbox/reducers/__tests__/statuses-test.js index 94b798048..91c960308 100644 --- a/app/soapbox/reducers/__tests__/statuses-test.js +++ b/app/soapbox/reducers/__tests__/statuses-test.js @@ -143,15 +143,13 @@ Promoting free speech, even for people and ideas you dislike`; const expected = `DMs are definitely only federated to the servers of the recipients tho. So if I DM a kfcc user, the kfcc admins can see it, but no other instance admins can. +@crunklord420@kiwifarms.cc +@becassine@kiwifarms.cc -crunklord420 +@King_Porgi@poa.st -becassine - -King_Porgi - -ademan`; +@ademan@thebag.social`; const result = reducer(undefined, action).getIn(['AHcweewcCh0iPUtMdk', 'search_index']); expect(result).toEqual(expected); diff --git a/app/soapbox/reducers/statuses.ts b/app/soapbox/reducers/statuses.ts index 0c6963c48..3c4f2ce6f 100644 --- a/app/soapbox/reducers/statuses.ts +++ b/app/soapbox/reducers/statuses.ts @@ -60,7 +60,7 @@ const getPollOptionTitles = ({ poll }: StatusRecord): ImmutableList => { // Gets usernames of mentioned users from status const getMentionedUsernames = (status: StatusRecord): ImmutableList => { - return status.mentions?.map(({ username }: { username: string }) => username); + return status.mentions.map(({ acct }) => `@${acct}`); }; // Creates search text from the status