Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mute note with presence of keyword (1,000,000 sats bounty) #856

Open
1 task
alltheseas opened this issue Apr 2, 2023 · 29 comments
Open
1 task

Mute note with presence of keyword (1,000,000 sats bounty) #856

alltheseas opened this issue Apr 2, 2023 · 29 comments
Assignees
Labels

Comments

@alltheseas
Copy link
Collaborator

alltheseas commented Apr 2, 2023

Tracking issues

Bounty

1,000,000 sats posted by Karnage

https://damus.io/note1mefmevqeqqjghw4d7tzk6rp46n3sc0u3syazx2j6k8hqjxmv2svqz0fchn

User Story

As a Damus user looking to avoid notes with a particular keyword, I would like the capability to mute notes that contain a keyword I specify, so that I don't see any notes containing this keyword.

Acceptance Criteria

  1. User can specify a keyword they would like muted in settings
  2. User can see, and modify list of muted keywords by adding, or deleting words.
  3. If a note contains a muted keyword, the note is not displayed to user
    -in timeline
    -in universe view
    -in notifications
    -in DMs
    -in zaps
  4. User does not receive any notifications associated with notes containing this keyword
  5. User has an option to mute from everyone, or from people user does not follow
  6. User can select a mute duration: 24 hours, 1 week, 1 month, or forever. Default is forever.
  7. If no words are muted, the following message is displayed:

You aren't muting any words.

When you mute words you won't see any notifications for notes that include them, or see notes that include muted words in your timeline.

  1. Hashtag of muted word is muted.
  2. If in replies/thread, muted notes are collapsed to a single row stating: "Note contains a word you've muted." and moved to bottom of reply thread.
  3. User has a tappable option to show the muted note Show (similar to
    image )
  4. Bonus: user can mute a phrase as well (for instance the spammy/zero effort string "Hello world! #introductions")
@alltheseas
Copy link
Collaborator Author

@jb55 mentions this is related to nostrscript, and is on list of top priorities

  • Muting words, nostrscript filters

@alltheseas alltheseas added the bounty Sats label Sep 24, 2023
@alltheseas alltheseas changed the title Mute note with presence of keyword Mute note with presence of keyword (500,000 sats bounty) Sep 24, 2023
@alltheseas alltheseas changed the title Mute note with presence of keyword (500,000 sats bounty) Mute note with presence of keyword (1,000,000 sats bounty) Sep 24, 2023
@alltheseas
Copy link
Collaborator Author

image

Would be useful to mute a phrase

@fishcharlie
Copy link
Contributor

Going to start working on this.

fishcharlie referenced this issue Jan 10, 2024
Muted users + unfollowed users test
------------------------------------

PASS

Device: iPhone 15 Pro simulator
iOS: 17.0.1
Damus: This commit
Setup:
- Two phones running Damus on different accounts
- Local relay with strfry-push-notify test setup
- Apple push notification test tool

Steps:
1. Unfollow the user who is the author of the saved notifications
2. Disable notifications for people you don't follow
3. Trigger a push notification (Resend push notification from test tool)
4. Ensure that the notification is not received on the other device
5. Enable notifications for people you don't follow
6. Trigger a push notification (Resend push notification from test tool)
7. Ensure that the notification is received on the other device
8. Mute the user who is the author of the saved notifications
9. Trigger a push notification (Resend push notification from test tool)
10. Ensure that the notification is not received on the other device
11. Unmute the user who is the author of the saved notifications
12. Trigger a push notification (Resend push notification from test tool)
13. Ensure that the notification is received on the other device

Result: PASS

Closes: #1705
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
@fishcharlie
Copy link
Contributor

Regarding acceptance criteria 6:

User can select a mute duration: 24 hours, 1 week, 1 month, or forever. Default is forever.

How would we feel about removing that item in the acceptance criteria? Currently I'm using the NIP standard for mute lists (see #1718). Which would make time based mute lists tricky. Especially for a client device that isn't guaranteed to always be online.

Please see @jb55's post here regarding similar difficulties for scheduled posts: #1241 (comment).

There are some workarounds we can do here. But none of which really apply to the root ticket of Mute note with presence of keyword. I will also mention that Damus today does not support mute durations for threads or users. So regardless, this should be broken into two tickets. One for Mute note with presence of keyword & another for Allow user to choose mute duration. It's not one unit of work.

However. I'm hesitant to ignore that acceptance criteria because there is a bounty on this issue. It would be unfair to the bounty payer to adjust the requirements after the fact without their approval.

Also PS: I am planning on implementing the Bonus: user can mute a phrase as well (for instance the spammy/zero effort string "Hello world! #introductions") acceptance criteria.

cc/ @jb55 @alltheseas

@alltheseas
Copy link
Collaborator Author

@karnagebitcoin

How do you feel about removing the duration acceptance criteria? If we do this, the likelihood we roll out this feature soon increases substantially.

User can select a mute duration: 24 hours, 1 week, 1 month, or forever.

@jb55
Copy link
Collaborator

jb55 commented Jan 11, 2024 via email

@fishcharlie
Copy link
Contributor

Why would needing to be online affect this? Wouldn't you just need to store when to unmute?

@jb55 If we are just talking about offline storing of mute duration, that is possible, yes. Easy almost.

The problem is with the kind:10000 mute list (#1718). Once that mute duration has passed, Damus (or some client) needs to be active to sign & relay an updated kind:10000 mute list that removed that item where the mute duration has passed.

I guess it's possible to do mute durations and sync it next time you're online. But there is a chance that your Damus mute list wouldn't match your kind:10000 mute list.

Example:

  1. User mutes Account A for 1 month
  2. User never uses Damus again (or deletes the app) 😢
  3. 1 month passes (or longer)
  4. Users kind:10000 mute list still contains Account A

Maybe a minor edge case, but an edge case nonetheless.

@jb55
Copy link
Collaborator

jb55 commented Jan 11, 2024 via email

@fishcharlie
Copy link
Contributor

yeah I wouldn't get worked up over this edgecase

Fair enough.

Having just an expiry time that is checked by whatever app you login to is fine

Don't quite understand this. In the kind:10000 spec I didn't see any way to specify an expiry time. Obviously if that existed, it would be really easy, and this conversation probably wouldn't even be occurring 😆.

So the only way to do it is Damus sending a new kind:10000 mute list after the expiration time has passed. Which is possible if we accept the edge case that Damus has to be active for that new mute list to be signed & relayed.

Just wanna make sure we are on the same page about that.

If there are no issues I'll move forward with storing the expiration time locally (on Damus only). And once that time passes, if Damus is active, it will relay a new kind:10000 list removing that muted item. The expiration time/duration itself will never be relayed to other clients. It will be stored locally only. Only other clients/relays will see that an item has been removed after Damus is active and it sends that new kind:10000 list.

@karnagebitcoin
Copy link

Totally fine by me if the duration is not implemented with this, and is split off into another task if it's too much. I just hope that it does get implemented eventually because I often forget to unmute. I use mute mostly as a "timeout" to get something out of my sight for a while, but it doesn't mean I never want to see it, except in cases where I do (crypto shit)

@jb55
Copy link
Collaborator

jb55 commented Jan 11, 2024 via email

@fishcharlie
Copy link
Contributor

@jb55

we can add it to the spec?

Ok I'm new to that. I'll look into this tomorrow and let you know if I have any questions. If you have any tips/pointers in the meantime, let me know.

@alltheseas
Copy link
Collaborator Author

Here is the lists NIP, which includes mute kind 10000.

https://github.com/nostr-protocol/nips/blob/master/51.md

Would e.g. an expiry time be an added and optional tag?

image

@jb55
Copy link
Collaborator

jb55 commented Jan 11, 2024 via email

@fishcharlie
Copy link
Contributor

https://groups.google.com/a/damus.io/g/patches/c/gy7WlaGYRKE

jb55 pushed a commit that referenced this issue Jan 22, 2024
- Adding MuteItem & DamusDuration
- Changing RefId hashtag associated type from TagElem to Hashtag
    - This is done because in MuteItem, we can not create a RefId.hashtag TagElem instance since we don’t have a note associated with a given hashtag mute item.

Related: #1718
Related: #856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 pushed a commit that referenced this issue Jan 22, 2024
- Adding MuteDurationMenu & AddMuteItemView
    - In a future patch I will update AddMuteItemView to actually update and relay the new mute list

Related: #1718
Related: #856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
@fishcharlie
Copy link
Contributor

Thanks again @karnagebitcoin!!!

@alltheseas
Copy link
Collaborator Author

@fishcharlie fyi tested yesterday - DM with muted word is shown/not hidden. I wonder if we should have a "spam" or low signal folder perhaps based on muted words, and web-of-trust.

@fishcharlie
Copy link
Contributor

@alltheseas Mind creating a new ticket for that and assigning me? There is for sure some cleanup work we have to do.

Also I was gonna create a ticket for this issue @jb55 reported: https://damus.io/nevent1qqsyspz3g8qfctjh5aclktgxxlkpmrwvrg3gn57ux9gcsldduhs7y8qpy9mhxue69uhhyetvv9ujumtfdej8xtnrdakj7mn0wd68ytmkxyhhwucprpmhxw309akk7mnpvshx5c34x5hxxmmd8gurqwpsqy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqgswaehxw309ahx7um5wgh8w6twv5q3gamnwvaz7tmjv4kxz7fwv3sk6atn9e5k7qgdwaehxw309ahx7uewd3hkcqgcwaehxw309amk2mrrdakk2tnwdaehgu3wwa5kuegpzemhxue69uhhyetvv9ujumn0wd68ytnzv9hxgqg4waehxw309ajkgetw9ehx7um5wghxcctwvstmqgk3

However, I haven't gotten a chance to create that ticket yet. If you have some extra time and want to that would be great.

Other things @jb55 mentioned in direct messages that I haven't gotten a chance to create tickets for yet:

  • another thing from testing: I can't see to change the duration when adding a word I'm guessing non-words as well
  • also we should put the muted words at the top, my mute list is huge and I have to scroll down to see it. or maybe these could be tabs

@jb55
Copy link
Collaborator

jb55 commented Jan 24, 2024 via email

@alltheseas
Copy link
Collaborator Author

Added these as new issues. Links are above.

jb55 pushed a commit that referenced this issue Jan 25, 2024
- Adding MuteItem & DamusDuration
- Changing RefId hashtag associated type from TagElem to Hashtag
    - This is done because in MuteItem, we can not create a RefId.hashtag TagElem instance since we don’t have a note associated with a given hashtag mute item.

Related: #1718
Related: #856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 pushed a commit that referenced this issue Jan 25, 2024
- Adding MuteDurationMenu & AddMuteItemView
    - In a future patch I will update AddMuteItemView to actually update and relay the new mute list

Related: #1718
Related: #856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 pushed a commit that referenced this issue Jan 25, 2024
This patch depends on: Adding new structs/enums for new mute list

- Rewrites Lists.swift to use new mute list option
    - This leads to a lot of changes for changing the type from RefId to the new MuteItem
- Update & relay new mute list in AddMuteItemView.swift (fixing previous patch TODO)
- Renames `list` to `list_deprecated`
    - We need to keep this since existing users might have an old mute list

Related: #1718
Related: #856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 pushed a commit that referenced this issue Jan 25, 2024
This patch depends on: Migrate Lists.swift to use new MuteItem

- Makes request for new mute list type (kind:10000)
- Processing new mute list type (kind:10000)

Related: #1718
Related: #856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 pushed a commit that referenced this issue Jan 25, 2024
This patch depends on: Receiving New Mute List Type

- Changes NewMutesNotify, NewUnmutesNotify & MuteNotify to use MuteItem instead of Pubkey
- Changes is_muted in Contacts.swift to take in a MuteItem instead of a Pubkey
    - A lot of changes here were just modifying callers of that to accept the new parameter type

Related: #1718
Related: #856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 pushed a commit that referenced this issue Jan 25, 2024
This patch depends on: Adding filtering support for MuteItem events

- Gives more specific mute reason in EventMutedBoxView
- Showing all types of mutes in MutelistView
- Allowing for adding mutes directly from MutelistView
- Allowing for choosing duration of mute in EventMenu

Related: #1718
Related: #856
Lighting Address: fishcharlie@strike.me

Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 pushed a commit that referenced this issue Jan 25, 2024
This patch depends on: Updating UI to support new mute list

- Adding the ability to mute a hashtag from SearchView

Related: #1718
Related: #856
Lighting-address: fishcharlie@strike.me
Changelog-Added: Add ability to mute hashtag from SearchView
Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
@jb55
Copy link
Collaborator

jb55 commented Jan 28, 2024

re-opening this because it's not quite ready yet. we should probably have a policy to only pay out when code is ready not when it's merged, since we can sometimes merge code that is not ready. @karnagebitcoin let me know if you want a refund for now since I said it was ready when it was not.

@jb55 jb55 reopened this Jan 28, 2024
@karnagebitcoin
Copy link

re-opening this because it's not quite ready yet. we should probably have a policy to only pay out when code is ready not when it's merged, since we can sometimes merge code that is not ready. @karnagebitcoin let me know if you want a refund for now since I said it was ready when it was not.

no refund necessary. I trust that it will work eventually ;)

@jb55 jb55 closed this as completed in 71c9bd6 Feb 26, 2024
@alltheseas
Copy link
Collaborator Author

@jb55 you ok to keep these open til merged to testflight or appstore?

This one is on master, and not yet on appstore.

@jb55
Copy link
Collaborator

jb55 commented Mar 20, 2024 via email

@jb55
Copy link
Collaborator

jb55 commented May 6, 2024

Tracking remaining issues before we can close this:

@jb55 jb55 mentioned this issue May 6, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

4 participants