summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Push/Extension.pm')
-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);