Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b110e1a
Testing- Mail daily changes done
TSI-sangramdesai Feb 11, 2022
b3edce6
Merge pull request #1 from nextmcloud/nmcfeat/test-monthly-status-ema…
TSI-sangramdesai Feb 11, 2022
27ab73c
Merge branch 'nextcloud:master' into master
TSI-nareshrai Feb 21, 2022
871c847
Merge branch 'master' into nmcrel/v1.0.8
CarlSchwan Mar 8, 2022
1e3a7ff
Merge pull request #2 from nextmcloud/nmcrel/v1.0.8
TSI-sangramdesai Mar 9, 2022
c7f1400
Merge branch 'master' into fix/migration
CarlSchwan Mar 9, 2022
3c2e010
Remove debug log
CarlSchwan Mar 9, 2022
f9061b6
Fix style check
CarlSchwan Mar 9, 2022
f8af10d
Merge pull request #3 from nextmcloud/fix/migration
TSI-sangramdesai Mar 10, 2022
bf5b289
applied patch for share count when no data uploaded
TSI-ashishsharma Apr 8, 2022
fa4643e
Merge pull request #4 from nextmcloud/patch/fix_sharecount_when_no_da…
TSI-sangramdesai Apr 13, 2022
ed63c4a
Show monthly status report in setting account page
TSI-kavitasonawane Jul 8, 2022
c1e8eb8
Merge pull request #5 from nextmcloud/nmcfix/1005-monthly-status-repo…
TSI-sangramdesai Jul 8, 2022
05e1e5f
Merge remote-tracking branch 'upstream/master'
TSI-nareshrai Aug 10, 2022
d14f0f5
updates code with latest version for release 24
TSI-ashishsharma Aug 31, 2022
90b6656
change text to match for device login or not
TSI-ashishsharma Sep 29, 2022
8fe8233
License with branding restriction
tsdicloud Dec 14, 2022
0fafe59
Updated text for license with branding restrictions
TSI-ashishsharma Mar 8, 2023
04d6870
Updated text for license with branding restrictions
TSI-ashishsharma Mar 8, 2023
7374b66
change variable name for storge info
TSI-ashishsharma Mar 20, 2023
1a29980
Merge pull request #8 from nextmcloud/prod_issue_usage_not_defined
TSI-ashishsharma Mar 20, 2023
1164496
change variable name for storage info
TSI-ashishsharma Mar 20, 2023
b7a1fa6
add false for if storage is full
TSI-ashishsharma Mar 29, 2023
ec682a1
change the spelling for flase
TSI-ashishsharma Mar 29, 2023
26bdb60
change the spelling for false
TSI-ashishsharma Mar 29, 2023
3a881c9
apply new patch given by Szabolcs
TSI-ashishsharma Apr 5, 2023
188a28d
change backgroud job days to 1 from 30
TSI-ashishsharma Apr 6, 2023
d57364b
revert number of days to 1 month
TSI-ashishsharma Apr 12, 2023
3ec506a
Merge branch 'master' into nmcfeat/1008-content-changes-release24
TSI-ashishsharma Apr 20, 2023
39ced85
add space to set to previous state
TSI-ashishsharma May 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Although the code for this Magentacloud custom web theme for Nextcloud is free and available under the GPL 3 license below, Deutsche Telekom (including T-Systems) fully reserves all rights to the Telekom brand. To prevent users from getting confused about
the source of a digital product or experience, there are stringent restrictions on using the Telekom brand and design,
even when built into code that we provide. For any customization other than explicitly for Telekom or T-Systems, you must
replace the Deutsche Telekom and T-Systems brand elements contained in the provided sources.



GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007

Expand Down Expand Up @@ -658,4 +665,4 @@ specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.
<http://www.gnu.org/licenses/>.
2 changes: 1 addition & 1 deletion lib/Jobs/SendNotificationsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct(
protected function run($argument): void {
$limit = (int)$this->config->getAppValue($this->appName, 'status-email-max-mail-sent', '1000');

$trackedNotifications = $this->service->findAllOlderThan(new \DateTime("-1 month"), $limit);
$trackedNotifications = $this->service->findAllOlderThan(new \DateTime("-1 day"), $limit);

// for debugging
// $trackedNotifications = $this->service->findAllOlderThan(new \DateTime('now'), $limit);
Expand Down
2 changes: 0 additions & 2 deletions lib/Migration/Version23000Date2022022912000001.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $
$rows = $result->fetchAll();
$result->closeCursor();

\OC::$server->getLogger()->critical(var_export($rows, true));

$delete = $this->connection->getQueryBuilder();
$delete->delete('notification_tracker')
->where($delete->expr()->eq('user_id', $delete->createParameter('user_id')))
Expand Down
7 changes: 4 additions & 3 deletions lib/Service/ClientDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ public function hasMobileConnection(IUser $user): bool {
->select('name')
->where($qb->expr()->eq('uid', $qb->createNamedParameter($user->getUID())))
->andWhere($qb->expr()->orX(
$qb->expr()->eq('name', $qb->createNamedParameter('Nextcloud-iOS')),
$qb->expr()->like('name', $qb->createNamedParameter('%Nextcloud-android%')),
$qb->expr()->eq('name', $qb->createNamedParameter('%MagentaCLOUD iOS%')),
$qb->expr()->like('name', $qb->createNamedParameter('%Android%')),

))
->setMaxResults(1);
return $qb->executeQuery()->rowCount() === 1;
}
}
}
23 changes: 15 additions & 8 deletions lib/Service/MailSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

use OCP\Files\FileInfo;
use OCA\MonthlyStatusEmail\Db\NotificationTracker;
use OCA\MonthlyStatusEmail\Service\NotificationTrackerService;
use OCP\DB\Exception;
use OCP\IConfig;
use OCP\IL10N;
Expand Down Expand Up @@ -158,16 +159,17 @@ private function handleStorage(IEMailTemplate $emailTemplate, IUser $user): bool
// Message no quota
$this->provider->writeStorageNoQuota($emailTemplate, $storageInfo);
return false;
} elseif ($storageInfo['usage_relative'] < 90) {
} elseif ($storageInfo['relative'] < 90) {
// Message quota but less than 90% used
$this->provider->writeStorageSpaceLeft($emailTemplate, $storageInfo);
return false;
} elseif ($storageInfo['usage_relative'] < 99) {
} elseif ($storageInfo['relative'] < 99) {
$this->provider->writeStorageWarning($emailTemplate, $storageInfo);
return true;
return false;
} else {
$this->provider->writeStorageFull($emailTemplate, $storageInfo);
return true;
return false;

}
}

Expand All @@ -176,17 +178,19 @@ private function handleStorage(IEMailTemplate $emailTemplate, IUser $user): bool
* @return bool Whether a notification was sent
*/
public function sendMonthlyMailTo(NotificationTracker $trackedNotification): bool {
$message = $this->mailer->createMessage();
$message = $this->mailer->createMessage();
$user = $this->userManager->get($trackedNotification->getUserId());

if ($user === null) {
$this->service->delete($trackedNotification);
return false;
}

if ($user->getLastLogin() === 0) {
$this->service->delete($trackedNotification);
return false;
}

$emailTemplate = $this->setUpMail($message, $trackedNotification, $user);
if ($emailTemplate === null) {
return false;
Expand All @@ -205,6 +209,8 @@ public function sendMonthlyMailTo(NotificationTracker $trackedNotification): boo
// People opting-out of the monthly emails should still get the
// 'urgent' email about running out of storage, but the rest
// shouldn't be sent.
$trackedNotification->setLastSendNotification(time());
$this->service->update($trackedNotification);
return false;
}

Expand Down Expand Up @@ -248,12 +254,13 @@ public function sendStatusEmailActivation(IUser $user, NotificationTracker $trac
return;
}

$this->provider->writeWelcomeMail($emailTemplate, $user->getDisplayName());
$this->sendEmail($emailTemplate, $user, $message, $trackedNotification);
//$this->provider->writeWelcomeMail($emailTemplate, $user->getDisplayName());
//$this->sendEmail($emailTemplate, $user, $message, $trackedNotification);
}

private function sendEmail(IEMailTemplate $template, IUser $user, IMessage $message, ?NotificationTracker $trackedNotification = null): void {
if ($trackedNotification !== null) {

$this->provider->writeOptOutMessage($template, $trackedNotification);
}
$message->useTemplate($template);
Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/PersonalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getForm(): TemplateResponse {

/** {@inheritDoc} */
public function getSection(): string {
return 'activity';
return 'personal-info';
}

/** {@inheritDoc} */
Expand Down