@@ -69,7 +69,7 @@ createTeamCollaboratorImpl zUser user team perms = do
69
69
Store. createTeamCollaborator user team perms
70
70
71
71
-- TODO: Review the event's values
72
- generateTeamEvent (tUnqualified zUser) team ( EdCollaboratorAdd user (Set. toList perms))
72
+ generateTeamEvents (tUnqualified zUser) team [ EdCollaboratorAdd user (Set. toList perms)]
73
73
74
74
getAllTeamCollaboratorsImpl ::
75
75
( Member TeamSubsystem r ,
@@ -109,48 +109,15 @@ updateTeamCollaboratorImpl zUser user team perms = do
109
109
guardPermission (tUnqualified zUser) team TeamMember. UpdateTeamCollaborator InsufficientRights
110
110
Store. updateTeamCollaborator user team perms
111
111
112
- now <- get
113
- teamMembersList <- internalGetTeamAdmins team
114
- let teamMembers :: [UserId ] = view TeamMember. userId <$> (teamMembersList ^. TeamMember. teamMembers)
115
-
116
112
extraNotifications <-
117
113
if Set. null $ Set. intersection (Set. fromList [CreateTeamConversation , ImplicitConnection ]) perms
118
114
then do
119
115
leavingConversations <- internalLeaveConversationsFrom team user
120
- pure $
121
- leavingConversations. close <&> \ convId ->
122
- def
123
- { origin = Just (tUnqualified zUser),
124
- json = toJSONObject $ newEvent team now (EdConvDelete convId),
125
- recipients =
126
- ( \ uid ->
127
- Recipient
128
- { recipientUserId = uid,
129
- recipientClients = Push. RecipientClientsAll
130
- }
131
- )
132
- <$> teamMembers,
133
- transient = False
134
- }
116
+ pure $ EdConvDelete <$> leavingConversations. close
135
117
else pure []
136
118
137
- let event = newEvent team now (EdCollaboratorUpdate user $ Set. toList perms)
138
119
-- TODO: Review the event's values
139
- pushNotifications $
140
- def
141
- { origin = Just (tUnqualified zUser),
142
- json = toJSONObject $ event,
143
- recipients =
144
- ( \ uid ->
145
- Recipient
146
- { recipientUserId = uid,
147
- recipientClients = Push. RecipientClientsAll
148
- }
149
- )
150
- <$> teamMembers,
151
- transient = False
152
- }
153
- : extraNotifications
120
+ generateTeamEvents (tUnqualified zUser) team (EdCollaboratorAdd user (Set. toList perms) : extraNotifications)
154
121
155
122
internalRemoveTeamCollaboratorImpl ::
156
123
( Member Store. TeamCollaboratorsStore r
0 commit comments