diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-02-14 21:58:30 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-02-14 21:58:30 +0100 |
commit | faf8952b8732d6314e3d3429f5cc761564565e44 (patch) | |
tree | 0247aa13ee6f06f33f53b848503d1e0fb42ce884 /lib/Travelynx/Model | |
parent | 6fc21cac41e3b1bf4a6484fed736aec27b340b63 (diff) |
Send inactivity notification prior to account deletion
Diffstat (limited to 'lib/Travelynx/Model')
-rw-r--r-- | lib/Travelynx/Model/Users.pm | 21 |
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 } ); } |