Don't send out birthday reminders for memorial journals.
Patch by kareila.
diffs (47 lines):
diff -r 681da980bc8e -r d30f12d7e883 cgi-bin/DW/User/Edges/WatchTrust.pm
--- a/cgi-bin/DW/User/Edges/WatchTrust.pm Wed Sep 08 13:17:16 2010 +0800
+++ b/cgi-bin/DW/User/Edges/WatchTrust.pm Wed Sep 08 13:21:45 2010 +0800
@@ -381,7 +381,7 @@ sub get_birthdays {
my @results;
foreach my $ub ( @bdays ) {
my $u = $uids->{$ub->[0]};
- next unless $u->is_personal && $u->can_show_bday;
+ next unless $u->is_personal && $u->can_notify_bday;
push @results, [ $ub->[1]->month, $ub->[1]->day, $u->user ];
}
diff -r 681da980bc8e -r d30f12d7e883 cgi-bin/LJ/Event/Birthday.pm
--- a/cgi-bin/LJ/Event/Birthday.pm Wed Sep 08 13:17:16 2010 +0800
+++ b/cgi-bin/LJ/Event/Birthday.pm Wed Sep 08 13:21:45 2010 +0800
@@ -44,7 +44,7 @@ sub matches_filter {
sub matches_filter {
my ($self, $subscr) = @_;
- return $self->bdayuser->can_show_bday(to => $subscr->owner) ? 1 : 0;
+ return $self->bdayuser->can_notify_bday(to => $subscr->owner) ? 1 : 0;
}
sub as_string {
diff -r 681da980bc8e -r d30f12d7e883 cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm Wed Sep 08 13:17:16 2010 +0800
+++ b/cgi-bin/LJ/User.pm Wed Sep 08 13:21:45 2010 +0800
@@ -3520,6 +3520,19 @@ sub can_join_adult_comm {
}
+# Birthday logic -- should a notification be sent?
+# Currently the same logic as can_show_bday with an exception for
+# journals that have memorial status.
+sub can_notify_bday {
+ my ( $u, %opts ) = @_;
+ croak "invalid user object passed" unless LJ::isu( $u );
+
+ return 0 if $u->is_memorial;
+
+ return $u->can_show_bday( %opts );
+}
+
+
# Birthday logic -- can any of the birthday info be shown
# This will return true if any birthday info can be shown
sub can_share_bday {
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog