Muted list via NIP-51 #151

Merged
verbiricha merged 13 commits from mute into new-ui 2023-01-28 21:12:18 +00:00
verbiricha commented 2023-01-27 18:58:33 +00:00 (Migrated from github.com)

Wanted to get some feedback on this, I think having a public mute list and the possibility to batch mute people is good, I can see who you've muted and preemptively mute them, wdyt?

I'm going to add a "Block" option (private mute) that stores the list of blocked p in the encrypted content field so we get public/private blocks. Not going to tackle other types of lists in this PR, just focused on mute list for p which I think is the most valuable atm. We can add pins and bookmarks later.

Closes #101

  • Mute (public)
  • Block (private)
Wanted to get some feedback on this, I think having a public mute list and the possibility to batch mute people is good, I can see who you've muted and preemptively mute them, wdyt? I'm going to add a "Block" option (private mute) that stores the list of blocked `p` in the encrypted content field so we get public/private blocks. Not going to tackle other types of lists in this PR, just focused on mute list for `p` which I think is the most valuable atm. We can add pins and bookmarks later. Closes #101 - [x] Mute (public) - [x] Block (private)
verbiricha commented 2023-01-27 18:58:59 +00:00 (Migrated from github.com)
Link to NIP PR: https://github.com/nostr-protocol/nips/pull/183
v0l (Migrated from github.com) reviewed 2023-01-27 20:00:40 +00:00
v0l (Migrated from github.com) left a comment

Small bits, looks good though

Small bits, looks good though
@ -0,0 +8,4 @@
import useModeration from "Hooks/useModeration";
export interface MutedListProps {
pubkey: HexKey
v0l (Migrated from github.com) commented 2023-01-27 19:34:28 +00:00

Bit confusing when you have the logged in users pubkey in same scope, maybe call it forPubKey or something

Bit confusing when you have the logged in users pubkey in same scope, maybe call it `forPubKey` or something
v0l (Migrated from github.com) commented 2023-01-27 19:39:13 +00:00

Maybe need something here to show that its muted like you get on twitter

Maybe need something here to show that its muted like you get on twitter
@ -41,3 +45,3 @@
return <Note key={e.id} data={e} related={related.notes} />
return <Note key={e.id} data={e} related={related.notes} ignoreModeration={ignoreModeration} />
}
case EventKind.Reaction:
v0l (Migrated from github.com) commented 2023-01-27 19:42:56 +00:00

The p tag can be checked inside i think

The p tag can be checked inside i think
@ -95,6 +96,28 @@ export default function useEventPublisher() {
}
v0l (Migrated from github.com) commented 2023-01-27 19:43:44 +00:00

MUTE_LIST_TAG can be enum probably, we will have other lists too

`MUTE_LIST_TAG` can be enum probably, we will have other lists too
v0l (Migrated from github.com) commented 2023-01-27 19:47:31 +00:00

Filter dms too?

Filter dms too?
v0l (Migrated from github.com) commented 2023-01-27 19:49:21 +00:00

I should probably make it easier to get latest only notes, instead of NoteStore returning all it only gives back newest, this pattern is used a lot

I should probably make it easier to get latest only notes, instead of NoteStore returning all it only gives back newest, this pattern is used a lot
v0l (Migrated from github.com) commented 2023-01-27 20:00:10 +00:00

I dont think the index is important, you can just pick all p tags

I dont think the index is important, you can just pick all `p` tags
v0l (Migrated from github.com) commented 2023-01-27 19:55:06 +00:00

return ["d"..

`return ["d"..`
v0l (Migrated from github.com) commented 2023-01-27 19:55:45 +00:00

We can filter this directly from login feed, not needed here

We can filter this directly from login feed, not needed here
v0l (Migrated from github.com) commented 2023-01-27 19:56:49 +00:00

Yea i want to move this, too many clicks, need to put this directly on Settings page under "Donate"

Yea i want to move this, too many clicks, need to put this directly on Settings page under "Donate"
cloudflare-pages[bot] commented 2023-01-28 11:51:40 +00:00 (Migrated from github.com)

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5e0b36f
Status:   Deploy successful!
Preview URL: https://f2dd8567.snort-social.pages.dev
Branch Preview URL: https://mute.snort-social.pages.dev

View logs

## Deploying with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages <table><tr><td><strong>Latest commit:</strong> </td><td> <code>5e0b36f</code> </td></tr> <tr><td><strong>Status:</strong></td><td>&nbsp;✅&nbsp; Deploy successful!</td></tr> <tr><td><strong>Preview URL:</strong></td><td> <a href='https://f2dd8567.snort-social.pages.dev'>https://f2dd8567.snort-social.pages.dev</a> </td></tr> <tr><td><strong>Branch Preview URL:</strong></td><td> <a href='https://mute.snort-social.pages.dev'>https://mute.snort-social.pages.dev</a> </td></tr> </table> [View logs](https://dash.cloudflare.com/?to=/:account/pages/view/snort-social/f2dd8567-96c2-49c7-ac25-4f85d168ce13)
verbiricha (Migrated from github.com) reviewed 2023-01-28 11:53:16 +00:00
@ -0,0 +8,4 @@
import useModeration from "Hooks/useModeration";
export interface MutedListProps {
pubkey: HexKey
verbiricha (Migrated from github.com) commented 2023-01-28 11:53:15 +00:00

Change this a bit, the MutedList component will show public mutes for users different that the logged in user. For logged in user added BlockList which displays public (mute) and private (block) muted.

Change this a bit, the `MutedList` component will show public mutes for users different that the logged in user. For logged in user added `BlockList` which displays public (mute) and private (block) muted.
verbiricha (Migrated from github.com) reviewed 2023-01-28 11:57:35 +00:00
verbiricha (Migrated from github.com) commented 2023-01-28 11:57:35 +00:00

I've decided against it since we don't always have muted list available by the time we start getting dm events. Doing filtering on the downstream components instead.

I've decided against it since we don't always have `muted` list available by the time we start getting dm events. Doing filtering on the downstream components instead.
verbiricha (Migrated from github.com) reviewed 2023-01-28 12:02:08 +00:00
verbiricha (Migrated from github.com) commented 2023-01-28 12:02:07 +00:00

For notes I added the HiddenNote, do you think is worth adding for reactions too? thought we could just hide them since they can get spammy

For notes I added the `HiddenNote`, do you think is worth adding for reactions too? thought we could just hide them since they can get spammy
v0l (Migrated from github.com) reviewed 2023-01-28 12:24:17 +00:00
v0l (Migrated from github.com) commented 2023-01-28 12:24:17 +00:00

Good point

Good point
v0l (Migrated from github.com) reviewed 2023-01-28 12:26:48 +00:00
v0l (Migrated from github.com) commented 2023-01-28 12:26:48 +00:00

We dont show pure reactions currently, only reposts, im thinking of reposts where the person being reposted in muted, if the reposter is muted then you wont see it anyway because it will be removed at timeline/thread level

We dont show pure reactions currently, only reposts, im thinking of reposts where the person being reposted in muted, if the reposter is muted then you wont see it anyway because it will be removed at timeline/thread level
v0l (Migrated from github.com) reviewed 2023-01-28 12:47:58 +00:00
v0l (Migrated from github.com) commented 2023-01-28 12:29:05 +00:00

If you had a really long mute list then you would have to scroll for a long time to get to blocks, should we not have seperate tab for when its the logged in users block list?

If you had a really long mute list then you would have to scroll for a long time to get to blocks, should we not have seperate tab for when its the logged in users block list?
v0l (Migrated from github.com) commented 2023-01-28 12:31:33 +00:00

Better to use ev.Tags here because you have 2 ways to pass the event data

Better to use `ev.Tags` here because you have 2 ways to pass the event data
@ -51,3 +53,4 @@
const root = extractRoot();
const isOpMuted = root && isMuted(root.pubkey)
const opt = {
showHeader: ev?.Kind === EventKind.Repost,
v0l (Migrated from github.com) commented 2023-01-28 12:32:54 +00:00

the p tag check and root.pubkey should be the same, do you think its needed to have both checks?

the `p` tag check and `root.pubkey` should be the same, do you think its needed to have both checks?
v0l (Migrated from github.com) commented 2023-01-28 12:43:59 +00:00

You can use only the start of the pubkey here, so the id is a bit snorter

You can use only the start of the pubkey here, so the id is a bit snorter
verbiricha (Migrated from github.com) reviewed 2023-01-28 14:42:51 +00:00
@ -51,3 +53,4 @@
const root = extractRoot();
const isOpMuted = root && isMuted(root.pubkey)
const opt = {
showHeader: ev?.Kind === EventKind.Repost,
verbiricha (Migrated from github.com) commented 2023-01-28 14:42:51 +00:00

No, my bad

No, my bad
verbiricha (Migrated from github.com) reviewed 2023-01-28 19:06:00 +00:00
verbiricha (Migrated from github.com) commented 2023-01-28 19:05:59 +00:00

i see what you did there

i see what you did there ✨
v0l commented 2023-01-28 20:52:30 +00:00 (Migrated from github.com)

When i click onto the muted persons profile it should show notes anyway?

When i click onto the muted persons profile it should show notes anyway?
verbiricha commented 2023-01-28 21:10:34 +00:00 (Migrated from github.com)

good point, changed it so when visiting Profile the moderation is ignored.

good point, changed it so when visiting Profile the moderation is ignored.
Sign in to join this conversation.
No description provided.