Note: There are a few cases of duplicates in user autocompletion which are being worked on.

email userprefs doesn't tell you if you are a globalwatcher

RESOLVED FIXED in Bugzilla 3.0

Status

()

Bugzilla
User Accounts
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

({ue})

2.23.3
Bugzilla 3.0
Bug Flags:
approval +
approval3.0 +

Details

(URL)

Attachments

(1 attachment, 2 obsolete attachments)

2.08 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Assignee)

Description

11 years ago
steps:
1. log out
2. log in as timeless@gmail (or another global watcher)
3. load mail user prefs

actual results:
User Watching

If you watch a user, it is as if you are standing in their shoes for the purposes of getting email. Email is sent or not according to your preferences for their relationship to the bug (e.g. Assignee).

You are currently not watching any users. 

expected results:
Some indication that "You are currently configured to receive mail for all bugs that you can see" (or "You are a global watcher") plus a note explaining to contact the admin if you need to be removed from this role.
(Assignee)

Comment 1

11 years ago
Created attachment 250026 [details] [diff] [review]
something like this?

not sure i like the placement, but.... oh, and i have no idea if this works :)
Assignee: user-accounts → timeless
Status: NEW → ASSIGNED
Attachment #250026 - Flags: review?

Updated

11 years ago
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 3.0

Comment 2

11 years ago
Comment on attachment 250026 [details] [diff] [review]
something like this?

We should have a $user->is_global_watcher() method, so that we can easily reuse it, e.g. in BugMail.pm
Attachment #250026 - Flags: review? → review-
(Assignee)

Comment 3

10 years ago
Created attachment 272750 [details] [diff] [review]
something like that

i can't find any way to use this in BugMail, but i'm certainly fine with a method.
Attachment #250026 - Attachment is obsolete: true
Attachment #272750 - Flags: review?(LpSolit)

Comment 4

10 years ago
Comment on attachment 272750 [details] [diff] [review]
something like that

>Index: Bugzilla/User.pm

>+sub is_global_watcher {
>+    my $self = shift;
>+
>+    my @watchers = split /[,\s]+/, Bugzilla->params->{'globalwatchers'};
>+    my $index = grep $watchers[$_] eq $self->login, 0 .. $#watchers;
>+    return $index >= 0;
>+}

- Add parens to split(//, foo).
- Write: @foo = grep { $_ eq $self->login } @watchers;
         return scalar(@foo) ? 1 : 0;
  so that it's a bit more readable.
- Cache the result in $self->{'is_global_watcher'} as we do for ->is_insider.



>Index: template/en/default/account/prefs/email.html.tmpl

>+      You are watching all bugs. To stop watching all bugs you will need to contact

bugs -> [% terms.bugs %]
Attachment #272750 - Flags: review?(LpSolit) → review-
(Assignee)

Comment 5

10 years ago
Created attachment 273071 [details] [diff] [review]
use term.inology
Attachment #272750 - Attachment is obsolete: true
Attachment #273071 - Flags: review?(LpSolit)

Comment 6

10 years ago
Comment on attachment 273071 [details] [diff] [review]
use term.inology

>+        my @foo = grep { $_ eq $self->login } @watchers;

No comment about @foo as a variable name. :) r=LpSolit for 3.0 and 3.1.
Attachment #273071 - Flags: review?(LpSolit) → review+

Updated

10 years ago
Flags: approval3.0+
Flags: approval+

Comment 7

10 years ago
Comment on attachment 273071 [details] [diff] [review]
use term.inology

Well, I have a comment @foo is an unacceptable variable name.

We're trying to make Bugzilla's code *clearer*, not unreadable.

You could just do "my $is_in_array = grep".

You don't even need to cache that, it's an unnecessary optimization, all it does is read Bugzilla->params.
Attachment #273071 - Flags: review-

Comment 8

10 years ago
(In reply to comment #7)
> (From update of attachment 273071 [details] [diff] [review])
> Well, I have a comment @foo is an unacceptable variable name.

Max, you misunderstood my review comment. My "no comment" was clearly an incentive to change this variable name. I r+ it because I think timeless is able to do it on checkin.


> You don't even need to cache that, it's an unnecessary optimization

This optimization is fine and I asked him to do it. No reason to remove it.

Comment 9

10 years ago
Comment on attachment 273071 [details] [diff] [review]
use term.inology

Okay. As long as it's changed on checkin.

The optimization is premature and useless, though.
Attachment #273071 - Flags: review-

Comment 10

10 years ago
tip:

Checking in Bugzilla/User.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v  <--  User.pm
new revision: 1.155; previous revision: 1.154
done

3.0:

Checking in Bugzilla/User.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v  <--  User.pm
new revision: 1.148.2.2; previous revision: 1.148.2.1
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Updated

10 years ago
Keywords: relnote
(Assignee)

Comment 11

10 years ago
this was the other half

mozilla/webtools/bugzilla/Bugzilla/User.pm 	1.154
mozilla/webtools/bugzilla/template/en/default/account/prefs/email.html.tmpl 	1.29

BUGZILLA-3_0-BRANCH:
mozilla/webtools/bugzilla/Bugzilla/User.pm 	1.148.2.1 	mozilla/webtools/bugzilla/template/en/default/account/prefs/email.html.tmpl 	1.28.2.1

Comment 12

10 years ago
Has been relnoted in 3.0.1.
Keywords: relnote
You need to log in before you can comment on or make changes to this bug.