@@ -106,7 +106,6 @@ class ConsentBackend {
106106 /// - if it was sent recently, do nothing.
107107 Future <api.InviteStatus > _invite ({
108108 required AuthenticatedAgent activeAgent,
109- required User activeUser,
110109 required String email,
111110 required String kind,
112111 required List <String > args,
@@ -129,7 +128,7 @@ class ConsentBackend {
129128 await _delete (old, (a) => a.onExpire (old));
130129 } else if (old.shouldNotify ()) {
131130 // non-expired entries just re-send the notification
132- return await _sendNotification (activeUser.email ! , old);
131+ return await _sendNotification (activeAgent.displayId , old);
133132 } else {
134133 return api.InviteStatus (
135134 emailSent: false , nextNotification: old.nextNotification);
@@ -138,30 +137,26 @@ class ConsentBackend {
138137 // Create a new entry.
139138 final consent = Consent .init (
140139 fromAgent: activeAgent.agentId,
141- fromUserId: activeUser.userId,
142140 email: email,
143141 kind: kind,
144142 args: args,
145- createdBySiteAdmin: activeAgent is SupportAgent ,
146143 );
147144 await _db.commit (inserts: [
148145 consent,
149146 auditLogRecord,
150147 ]);
151- return await _sendNotification (activeUser.email ! , consent);
148+ return await _sendNotification (activeAgent.displayId , consent);
152149 });
153150 }
154151
155152 /// Invites a new uploader to the package.
156153 Future <api.InviteStatus > invitePackageUploader ({
157154 required AuthenticatedAgent agent,
158- required User activeUser,
159155 required String packageName,
160156 required String uploaderEmail,
161157 }) async {
162158 return await _invite (
163159 activeAgent: agent,
164- activeUser: activeUser,
165160 email: uploaderEmail,
166161 kind: ConsentKind .packageUploader,
167162 args: [packageName],
@@ -182,7 +177,6 @@ class ConsentBackend {
182177 final user = authenticatedUser.user;
183178 return await _invite (
184179 activeAgent: authenticatedUser,
185- activeUser: user,
186180 email: contactEmail,
187181 kind: ConsentKind .publisherContact,
188182 args: [publisherId, contactEmail],
@@ -194,13 +188,11 @@ class ConsentBackend {
194188 /// Invites a new member for the publisher.
195189 Future <api.InviteStatus > invitePublisherMember ({
196190 required AuthenticatedAgent authenticatedAgent,
197- required User activeUser,
198191 required String publisherId,
199192 required String invitedUserEmail,
200193 }) async {
201194 return await _invite (
202195 activeAgent: authenticatedAgent,
203- activeUser: activeUser,
204196 email: invitedUserEmail,
205197 kind: ConsentKind .publisherMember,
206198 args: [publisherId],
@@ -328,7 +320,6 @@ class _PackageUploaderAction extends ConsentAction {
328320 @override
329321 Future <void > onAccept (Consent consent) async {
330322 final packageName = consent.args! [0 ];
331- final createdBySiteAdmin = consent.createdBySiteAdmin ?? false ;
332323 final currentUser = await requireAuthenticatedWebUser ();
333324 if (currentUser.email? .toLowerCase () != consent.email? .toLowerCase ()) {
334325 throw NotAcceptableException (
@@ -339,7 +330,6 @@ class _PackageUploaderAction extends ConsentAction {
339330 packageName,
340331 currentUser.user,
341332 consentRequestFromAgent: consent.fromAgent! ,
342- consentRequestCreatedBySiteAdmin: createdBySiteAdmin,
343333 );
344334 }
345335
@@ -405,7 +395,6 @@ class _PublisherContactAction extends ConsentAction {
405395 publisherId,
406396 contactEmail,
407397 consentRequestFromAgent: consent.fromAgent! ,
408- consentRequestCreatedBySiteAdmin: consent.createdBySiteAdmin ?? false ,
409398 );
410399 }
411400
@@ -485,7 +474,6 @@ class _PublisherMemberAction extends ConsentAction {
485474 publisherId,
486475 currentUser.userId,
487476 consentRequestFromAgent: consent.fromAgent! ,
488- consentRequestCreatedBySiteAdmin: consent.createdBySiteAdmin ?? false ,
489477 );
490478 }
491479
0 commit comments