summaryrefslogtreecommitdiffstats
path: root/extensions/BugmailFilter/lib
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-09-24 05:55:03 +0200
committerByron Jones <glob@mozilla.com>2014-09-24 05:55:03 +0200
commit550d53cc7bc2ed66fd40ab6a276d9f65c6ac7278 (patch)
treeae891d282273c5fdc1ba6e3ba10aedd703990c86 /extensions/BugmailFilter/lib
parent84c12dd98e2a4d60fbaab685831e7bc48e83b082 (diff)
downloadbugzilla-550d53cc7bc2ed66fd40ab6a276d9f65c6ac7278.tar.gz
bugzilla-550d53cc7bc2ed66fd40ab6a276d9f65c6ac7278.tar.xz
Bug 1054141: add the ability to filter on the user that made the change
Diffstat (limited to 'extensions/BugmailFilter/lib')
-rw-r--r--extensions/BugmailFilter/lib/Filter.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/extensions/BugmailFilter/lib/Filter.pm b/extensions/BugmailFilter/lib/Filter.pm
index a6e8af459..6246f51d9 100644
--- a/extensions/BugmailFilter/lib/Filter.pm
+++ b/extensions/BugmailFilter/lib/Filter.pm
@@ -30,6 +30,7 @@ use constant DB_COLUMNS => qw(
component_id
field_name
relationship
+ changer_id
action
);
@@ -117,6 +118,17 @@ sub relationship {
return $_[0]->{relationship};
}
+sub changer_id {
+ return $_[0]->{changer_id};
+}
+
+sub changer {
+ my ($self) = @_;
+ return $self->{changer_id}
+ ? Bugzilla::User->new({ id => $self->{changer_id}, cache => 1 })
+ : undef;
+}
+
sub relationship_name {
my ($self) = @_;
foreach my $rel (@{ FILTER_RELATIONSHIPS() }) {
@@ -190,6 +202,10 @@ sub matches {
return 0;
}
+ if ($self->{changer_id} && $self->{changer_id} != $args->{changer_id}) {
+ return 0;
+ }
+
return 1;
}