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

[Feature Request] Allow a user to filter on keywords #3710

Open
4 tasks done
zach004 opened this issue Jul 24, 2023 · 3 comments
Open
4 tasks done

[Feature Request] Allow a user to filter on keywords #3710

zach004 opened this issue Jul 24, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@zach004
Copy link

zach004 commented Jul 24, 2023

Requirements

  • Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a feature request? Do not put multiple feature requests in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Is your proposal related to a problem?

Allow users to create a filter for certain keywords like "Twitter, Reddit" etc

Describe the solution you'd like.

In the "Blocks" page allow users to block keywords from post titles. This would hide all posts containing those words in the title.

Describe alternatives you've considered.

Some apps such as Connect on Android already have this feature, but it would be nice to have it included natively in Lemmy.

Additional context

No response

EDIT from dessalines:

This should also work not just on titles, but also URLs and possibly descriptions.

@zach004 zach004 added the enhancement New feature or request label Jul 24, 2023
@grothedev
Copy link

is there any specification about what type of filter processing is allowed to be done on the backend?

@leoseg
Copy link
Contributor

leoseg commented Dec 14, 2024

Hi I would like to work on this issue if possible? I already created a quick draft [here] (#5263), and would also like to ask how in diesel migrate a new table, my Idea was a new table named post_keyword_block (not sure about the name though) which is a just like user id and keyword to then filter results returned by list

@Nutomic
Copy link
Member

Nutomic commented Dec 17, 2024

@leoseg For diesel migrations you can read the docs. In principle you only need to cargo install diesel_cli and run diesel migration generate *name*. The specific table name isnt so important, we can suggest a better one during code review if necessary.

leoseg added a commit to leoseg/lemmy that referenced this issue Feb 6, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Feb 6, 2025
@dessalines dessalines marked this as a duplicate of #5188 Feb 12, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 5, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 5, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 5, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 5, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 10, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 10, 2025
…block and replaced id as primary key with the composed key person_id and keyword. Also now use update function which updates the blocked keywords for an user with a new list instead keyword by keyword.
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 10, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 30, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 30, 2025
…ence local user and added update function which will update at all keywords for a local user at once
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 30, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 30, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 30, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Mar 30, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Apr 2, 2025
…ate now does delete and then insert, postview uses read from LocalKeywordBlock, and validation with min_length_check and max_length_check
leoseg added a commit to leoseg/lemmy that referenced this issue Apr 2, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Apr 3, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Apr 3, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Apr 5, 2025
leoseg added a commit to leoseg/lemmy that referenced this issue Apr 5, 2025
Nutomic pushed a commit that referenced this issue Apr 8, 2025
* created new table post_keyword_block related to a person and corresponding functions in diesel

* created corresponding api functions

* converted like to ilike in filter

* Fixxed errors for adding keywords for blocking posts

* Fixxed errors in diesel migrations

* Removed debug print

* #3710: Fixxed errors caused by cargo check

* #3710: added up and down scripts for diesel

* added tmp.schema to gitignore

* updated tests

* fixxed test

* fixxed error from rebasing

* Added max number of block tags and modified max length of block tags

* formatted code

* added migration to restrict block keyword length

* #3710: Added check if Blocked keyword is already existing

* #3710: Removed deprecated any

* #3710: Updated keyword length

* #3710: Fixxed errors from master merge

* #3710: Formatting

* #3710: Removed api to block keywords for post from v3 and changed of api path in v4

* #3710: Renamed post_keyword_block table to user_post_keyword_block and replaced id as primary key with the composed key person_id and keyword. Also now use update function which updates the blocked keywords for an user with a new list instead keyword by keyword.

* #3710: Formatted code

* #3710: Removed unnecessary parts for the block API in post as this will be done over the user settings

* #3710: Modified data structure for blocking keywords to reference local user and added update function which will update at all keywords for a local user at once

* #3710: Modified code so updating blocked keywords is now done over user settings

* #3710: Fixxed merging error

* #3710: Fixxed filter query

* #3710: Formatted Code

* #3710: Added suggested changes from review: keyword block update now does delete and then insert, postview uses read from LocalKeywordBlock, and validation with min_length_check and max_length_check

* #3710: formatted code

* c

* #3710: removed BlockKeywordForPost struct

* #3710: formatted code

* #3710: formatted code

* #3710: formatted code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants