NodeBB / nodebb-plugin-friends

Friendship plugin ala facebook
MIT License
7 stars 9 forks source link

Can rejectFriendship be simplified? #3

Closed julianlam closed 9 years ago

julianlam commented 9 years ago

https://github.com/NodeBB/nodebb-plugin-friends/blob/master/lib/friends.js#L113-L124

Given that the calls here are a subset of removeFriendship, and rejection only happens when users are expicitly not friends, then I'd think that rejectFriendship should just call removeFriendship, and fire off the corresponding hook in its callback.

barisusakli commented 9 years ago

Well this is easy to do but you wont be able to tell if someone is rejecting a friend request or just unfriending someone.

julianlam commented 9 years ago

via hook? I think you could, if rejectFriendship just called removeFriendship, and in its callback, fired off its own hook... (then again, it means you get double-hooks, so maybe not)

Nevermind.