summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@mozilla.com>2014-09-10 06:26:23 +0200
committerByron Jones <glob@mozilla.com>2014-09-10 06:26:23 +0200
commitb11a51b6a515fbb6ee2335c9ddfdf27dba343eba (patch)
tree9cc45edc71f4090db0f15978cd104c1cbbfc0934 /Bugzilla/Bug.pm
parent34cc5408aacd1fb76130cc560f126d406910a5b1 (diff)
downloadbugzilla-b11a51b6a515fbb6ee2335c9ddfdf27dba343eba.tar.gz
bugzilla-b11a51b6a515fbb6ee2335c9ddfdf27dba343eba.tar.xz
Bug 1053513: remove last-visited entries when a user removes involvement from a bug
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 3310afe3d..0c2f659c5 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -1122,6 +1122,12 @@ sub update {
$self->update_user_last_visit($user, $delta_ts);
}
+ # If a user is no longer involved, remove their last visit entry
+ my $last_visits = Bugzilla::BugUserLastVisit->match({bug_id => $self->id});
+ foreach my $lv (@$last_visits) {
+ $lv->remove_from_db() unless $lv->user->is_involved_with_bug($self);
+ }
+
# Update bug ignore data if user wants to ignore mail for this bug
if (exists $self->{'bug_ignored'}) {
my $bug_ignored_changed;