summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Model
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-02-14 21:58:30 +0100
committerDaniel Friesel <derf@finalrewind.org>2022-02-14 21:58:30 +0100
commitfaf8952b8732d6314e3d3429f5cc761564565e44 (patch)
tree0247aa13ee6f06f33f53b848503d1e0fb42ce884 /lib/Travelynx/Model
parent6fc21cac41e3b1bf4a6484fed736aec27b340b63 (diff)
Send inactivity notification prior to account deletion
Diffstat (limited to 'lib/Travelynx/Model')
-rw-r--r--lib/Travelynx/Model/Users.pm21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/Travelynx/Model/Users.pm b/lib/Travelynx/Model/Users.pm
index 1371b8a..70d81c4 100644
--- a/lib/Travelynx/Model/Users.pm
+++ b/lib/Travelynx/Model/Users.pm
@@ -23,8 +23,25 @@ sub mark_seen {
$db->update(
'users',
- { last_seen => DateTime->now( time_zone => 'Europe/Berlin' ) },
- { id => $uid }
+ {
+ last_seen => DateTime->now( time_zone => 'Europe/Berlin' ),
+ deletion_notified => undef
+ },
+ { id => $uid }
+ );
+}
+
+sub mark_deletion_notified {
+ my ( $self, %opt ) = @_;
+ my $uid = $opt{uid};
+ my $db = $opt{db} // $self->{pg}->db;
+
+ $db->update(
+ 'users',
+ {
+ deletion_notified => DateTime->now( time_zone => 'Europe/Berlin' ),
+ },
+ { id => $uid }
);
}