summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fearn <jfearn@redhat.com>2020-06-19 10:22:42 +1000
committerJeff Fearn <jfearn@redhat.com>2020-07-17 09:26:24 +1000
commit5e9e6e96d77edbc1a260dfa880e18b41b93b3ab7 (patch)
tree859dc8af04ab4f78218577c16aa64b3517bf60e2
parentRelease Version 5.0.4-rh45 (diff)
downloadbugzilla-5e9e6e96d77edbc1a260dfa880e18b41b93b3ab7.tar.gz
bugzilla-5e9e6e96d77edbc1a260dfa880e18b41b93b3ab7.tar.bz2
bugzilla-5e9e6e96d77edbc1a260dfa880e18b41b93b3ab7.zip
Bug 1848776 - message bug filtering inadequate
Only include changes in event of public objects. Change-Id: I52327ea88aebe4dbe81cfe9df76865b85baac6ad
-rw-r--r--extensions/Push/Extension.pm24
1 files changed, 13 insertions, 11 deletions
diff --git a/extensions/Push/Extension.pm b/extensions/Push/Extension.pm
index 245ca1b09..4cd3be9c4 100644
--- a/extensions/Push/Extension.pm
+++ b/extensions/Push/Extension.pm
@@ -107,6 +107,7 @@ sub _object_modified {
$changes = dclone($changes);
my $change_set = change_set_id();
+ my $is_public = is_public($object);
# detect when a bug changes from public to private (or back), so connectors
# can remove now-private bugs if required.
@@ -116,7 +117,6 @@ sub _object_modified {
# bug has already been updated, so for now assume that a bug without
# groups is public.
my $old_bug = $args->{'old_bug'};
- my $is_public = is_public($object);
my $was_public = $old_bug ? !@{$old_bug->groups_in} : $is_public;
if (!$is_public && $was_public) {
@@ -155,16 +155,18 @@ sub _object_modified {
# restructure the changes hash
my $changes_data = {timestamp => $args->{'timestamp'}, changes => [],};
- foreach my $field_name (sort keys %$changes) {
- my $new_field_name = $field_name;
- $new_field_name =~ s/isprivate/is_private/;
-
- push @{$changes_data->{'changes'}},
- {
- field => $new_field_name,
- removed => $changes->{$field_name}[0],
- added => $changes->{$field_name}[1],
- };
+ if ($is_public) {
+ foreach my $field_name (sort keys %$changes) {
+ my $new_field_name = $field_name;
+ $new_field_name =~ s/isprivate/is_private/;
+
+ push @{$changes_data->{'changes'}},
+ {
+ field => $new_field_name,
+ removed => $changes->{$field_name}[0],
+ added => $changes->{$field_name}[1],
+ };
+ }
}
$self->_push_object('modify', $object, $change_set, $changes_data);