πΊοΈπ‘π The Marauders App helps you find rooms with free machines in university labs and helps you find your friends. It does this by SSHing into every machine and dialling home.
Currently friends are stored in a redis set as uun-friends, with a list of uuns.
Overview of proposed system:
Bi-directional friendships
Pending requests can be accepted or ignored
Ignore requests should hide them from the "pending list"
Proposed flow of implementation:
uuna's friends are stored in friends.current.uuna
Each of uuna's friends has uuna in their friends list.
uuna requests to be uunb's friend:
uunb is added to friends.outgoing.uuna
uuna is added to friends.incoming.uunb
If uunb accepts the request from uuna, presence in friends.outgoing.uuna is checked, and then both uuns are removed from the outgoing/incoming lists. The uuns are added to the relevant current lists.
If uunbinstead ignores uuna, uuna is added to friends.ignored.uunb. This will make uunb still appear as pending in uuna's interface, but no longer shown in uunb's interface
If uunb later decides to add uuna (after uunb ignored uuna), they will be friends, since the friends.outgoing.uuna sanity check succeeds.
Also, when uuna adds uunb as a friend, this happens:
friends.emails.uuna.to.uunb is set with an expiry of ??? (2 weeks?)
When a friend request is sent, this key will be checked for presence before sending the email. If the key is set, no email is sent. This prevents someone harassing a user to add them as a friend.
We should probably also reset everyone's friends list. There could be a button to auto-friend request people on that list?
Currently friends are stored in a redis set as
uun-friends
, with a list of uuns.Overview of proposed system:
Proposed flow of implementation:
uuna
's friends are stored infriends.current.uuna
uuna
's friends hasuuna
in their friends list.uuna
requests to beuunb
's friend:uunb
is added tofriends.outgoing.uuna
uuna
is added tofriends.incoming.uunb
uunb
accepts the request fromuuna
, presence infriends.outgoing.uuna
is checked, and then both uuns are removed from the outgoing/incoming lists. The uuns are added to the relevantcurrent
lists.uunb
instead ignoresuuna
,uuna
is added tofriends.ignored.uunb
. This will makeuunb
still appear as pending inuuna
's interface, but no longer shown inuunb
's interfaceuunb
later decides to adduuna
(afteruunb
ignoreduuna
), they will be friends, since thefriends.outgoing.uuna
sanity check succeeds.Also, when
uuna
addsuunb
as a friend, this happens:friends.emails.uuna.to.uunb
is set with an expiry of ??? (2 weeks?)We should probably also reset everyone's friends list. There could be a button to auto-friend request people on that list?