[server] Replace setJoinsToUnread with setNewMembersToUnread parameter to changeRole
Summary:
The old setJoinsToUnread function was pretty hacky. It mutated MembershipRows before creation, and got called on more rows than it needed to. It didn't matter since unread status only affects thread members, but it certainly doesn't hurt to be more selective in which memberships rows we set to unread.
Note that we only need to set new members to unread when they are added to a thread, but we never want to set the viewer to unread. So we include it for initial members and adding members, but skip it for the viewer joining or creating a thread.
Test Plan:
I tested the three scenarios that this diff affects:
- createThread
- updateThread (adding users)
- joinThread
Reviewers: palys-swm
Reviewed By: palys-swm
Subscribers: KatPo, Adrian, atul
Differential Revision: https://phabricator.ashoat.com/D1027