@@ -158,16 +158,16 @@ private function handleStorage(IEMailTemplate $emailTemplate, IUser $user): bool
158
158
// Message no quota
159
159
$ this ->provider ->writeStorageNoQuota ($ emailTemplate , $ storageInfo );
160
160
return false ;
161
- } elseif ($ storageInfo ['usage_relative ' ] < 90 ) {
161
+ } elseif ($ storageInfo ['relative ' ] < 90 ) {
162
162
// Message quota but less than 90% used
163
163
$ this ->provider ->writeStorageSpaceLeft ($ emailTemplate , $ storageInfo );
164
164
return false ;
165
- } elseif ($ storageInfo ['usage_relative ' ] < 99 ) {
165
+ } elseif ($ storageInfo ['relative ' ] < 99 ) {
166
166
$ this ->provider ->writeStorageWarning ($ emailTemplate , $ storageInfo );
167
- return true ;
167
+ return false ;
168
168
} else {
169
169
$ this ->provider ->writeStorageFull ($ emailTemplate , $ storageInfo );
170
- return true ;
170
+ return false ;
171
171
}
172
172
}
173
173
@@ -191,7 +191,7 @@ public function sendMonthlyMailTo(NotificationTracker $trackedNotification): boo
191
191
if ($ emailTemplate === null ) {
192
192
return false ;
193
193
}
194
-
194
+
195
195
// Handle storage specific events
196
196
$ stop = $ this ->handleStorage ($ emailTemplate , $ user );
197
197
@@ -200,7 +200,7 @@ public function sendMonthlyMailTo(NotificationTracker $trackedNotification): boo
200
200
$ this ->sendEmail ($ emailTemplate , $ user , $ message );
201
201
return true ;
202
202
}
203
-
203
+
204
204
if ($ trackedNotification ->getOptedOut ()) {
205
205
// People opting-out of the monthly emails should still get the
206
206
// 'urgent' email about running out of storage, but the rest
@@ -231,7 +231,7 @@ public function sendMonthlyMailTo(NotificationTracker $trackedNotification): boo
231
231
232
232
// Handle desktop/mobile client connection detection
233
233
$ availableGenericMessages = array_merge ($ availableGenericMessages , $ this ->handleClientCondition ($ user ));
234
-
234
+
235
235
// Choose one of the less urgent message randomly
236
236
$ this ->provider ->writeGenericMessage ($ emailTemplate , $ user , $ availableGenericMessages [array_rand ($ availableGenericMessages )]);
237
237
$ this ->sendEmail ($ emailTemplate , $ user , $ message , $ trackedNotification );
@@ -250,8 +250,8 @@ public function sendStatusEmailActivation(IUser $user, NotificationTracker $trac
250
250
return ;
251
251
}
252
252
253
- $ this ->provider ->writeWelcomeMail ($ emailTemplate , $ user ->getDisplayName ());
254
- $ this ->sendEmail ($ emailTemplate , $ user , $ message , $ trackedNotification );
253
+ // $this->provider->writeWelcomeMail($emailTemplate, $user->getDisplayName());
254
+ // $this->sendEmail($emailTemplate, $user, $message, $trackedNotification);
255
255
}
256
256
257
257
private function sendEmail (IEMailTemplate $ template , IUser $ user , IMessage $ message , ?NotificationTracker $ trackedNotification = null ): void {
@@ -286,13 +286,16 @@ private function handleShare(IUser $user): int {
286
286
];
287
287
$ shareCount = 0 ;
288
288
foreach ($ requestedShareTypes as $ requestedShareType ) {
289
- $ shares = $ this ->shareManager ->getSharesBy (
289
+ $ shares = $ this ->shareManager ->getSharesBy (
290
290
$ user ->getUID (),
291
291
$ requestedShareType ,
292
292
null ,
293
293
false ,
294
294
100
295
295
);
296
+ if ($ shares ==null ){
297
+ $ shares =array ();
298
+ }
296
299
$ shareCount += count ($ shares );
297
300
if ($ shareCount > 100 ) {
298
301
break ; // don't
0 commit comments