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

Follow and Unfollow nostr contacts #1070

Merged
merged 2 commits into from
Mar 22, 2024
Merged

Follow and Unfollow nostr contacts #1070

merged 2 commits into from
Mar 22, 2024

Conversation

benthecarman
Copy link
Collaborator

@benthecarman benthecarman commented Mar 19, 2024

Closes #1068

This has the base functionality needed for following and unfollowing. Tried to do my best to prevent us from deleting a follow list. One thing with this is there is potential race conditions if you call follow/unfollow in rapid succession. Could add a mutex around adding follows but that feels a little overkill, maybe will have to bite the bullet though

@futurepaul I imagine you'll want some extra utility around this. I was thinking of adding is_followed to TagItem. Is there anything else I could add that you can think of?

Copy link
Contributor

@TonyGiorgio TonyGiorgio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll defer to @futurepaul on this

@benthecarman benthecarman changed the title Save nostr contact list to storage Follow and Unfollow nostr contacts Mar 20, 2024
@benthecarman
Copy link
Collaborator Author

benthecarman commented Mar 20, 2024

Did some code clean up and ended up doing the mutex just to be safe.

mutiny-wasm/src/lib.rs Outdated Show resolved Hide resolved
@benthecarman benthecarman force-pushed the follow-unfollow branch 2 times, most recently from a852654 to 5722de4 Compare March 20, 2024 17:45
@benthecarman
Copy link
Collaborator Author

Added is_followed to TagItem and added a get_follows_sorted to mutiny wasm for @futurepaul

Copy link
Contributor

@futurepaul futurepaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the goose chase but I'm not actually using get_follows_sorted now. Follow / unfollow / is_followed all work great!

@TonyGiorgio TonyGiorgio merged commit a75cb87 into master Mar 22, 2024
9 checks passed
@TonyGiorgio TonyGiorgio deleted the follow-unfollow branch March 22, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Follow and Unfollow People
3 participants