Skip to content

Commit eff8bb1

Browse files
Modify conditions and comment code for welcome message
1 parent 1b8a5b3 commit eff8bb1

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

lib/Service/MailSender.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,16 @@ private function handleStorage(IEMailTemplate $emailTemplate, IUser $user): bool
158158
// Message no quota
159159
$this->provider->writeStorageNoQuota($emailTemplate, $storageInfo);
160160
return false;
161-
} elseif ($storageInfo['usage_relative'] < 90) {
161+
} elseif ($storageInfo['relative'] < 90) {
162162
// Message quota but less than 90% used
163163
$this->provider->writeStorageSpaceLeft($emailTemplate, $storageInfo);
164164
return false;
165-
} elseif ($storageInfo['usage_relative'] < 99) {
165+
} elseif ($storageInfo['relative'] < 99) {
166166
$this->provider->writeStorageWarning($emailTemplate, $storageInfo);
167-
return true;
167+
return false;
168168
} else {
169169
$this->provider->writeStorageFull($emailTemplate, $storageInfo);
170-
return true;
170+
return false;
171171
}
172172
}
173173

@@ -191,7 +191,7 @@ public function sendMonthlyMailTo(NotificationTracker $trackedNotification): boo
191191
if ($emailTemplate === null) {
192192
return false;
193193
}
194-
194+
195195
// Handle storage specific events
196196
$stop = $this->handleStorage($emailTemplate, $user);
197197

@@ -200,7 +200,7 @@ public function sendMonthlyMailTo(NotificationTracker $trackedNotification): boo
200200
$this->sendEmail($emailTemplate, $user, $message);
201201
return true;
202202
}
203-
203+
204204
if ($trackedNotification->getOptedOut()) {
205205
// People opting-out of the monthly emails should still get the
206206
// 'urgent' email about running out of storage, but the rest
@@ -231,7 +231,7 @@ public function sendMonthlyMailTo(NotificationTracker $trackedNotification): boo
231231

232232
// Handle desktop/mobile client connection detection
233233
$availableGenericMessages = array_merge($availableGenericMessages, $this->handleClientCondition($user));
234-
234+
235235
// Choose one of the less urgent message randomly
236236
$this->provider->writeGenericMessage($emailTemplate, $user, $availableGenericMessages[array_rand($availableGenericMessages)]);
237237
$this->sendEmail($emailTemplate, $user, $message, $trackedNotification);
@@ -250,8 +250,8 @@ public function sendStatusEmailActivation(IUser $user, NotificationTracker $trac
250250
return;
251251
}
252252

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);
255255
}
256256

257257
private function sendEmail(IEMailTemplate $template, IUser $user, IMessage $message, ?NotificationTracker $trackedNotification = null): void {
@@ -286,13 +286,16 @@ private function handleShare(IUser $user): int {
286286
];
287287
$shareCount = 0;
288288
foreach ($requestedShareTypes as $requestedShareType) {
289-
$shares = $this->shareManager->getSharesBy(
289+
$shares = $this->shareManager->getSharesBy(
290290
$user->getUID(),
291291
$requestedShareType,
292292
null,
293293
false,
294294
100
295295
);
296+
if($shares==null){
297+
$shares=array();
298+
}
296299
$shareCount += count($shares);
297300
if ($shareCount > 100) {
298301
break; // don't

lib/Settings/PersonalSettings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ public function getForm(): TemplateResponse {
7878
*/
7979
public function getSection(): string {
8080
if (version_compare($this->ncVersion, '23.0.0', '<')) {
81-
return 'activity';
81+
return 'personal-info';
8282
}
83-
return 'notifications';
83+
return 'personal-info';
8484
}
8585

8686
/**

0 commit comments

Comments
 (0)