Closed Bug 365302 Opened 18 years ago Closed 17 years ago

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

Categories

(Bugzilla :: User Accounts, defect)

2.23.3
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: timeless, Assigned: timeless)

References

()

Details

(Keywords: ue)

Attachments

(1 file, 2 obsolete files)

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.
Attached patch something like this? (obsolete) — Splinter Review
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?
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 3.0
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-
Attached patch something like that (obsolete) — Splinter Review
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 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-
Attached patch use term.inologySplinter Review
Attachment #272750 - Attachment is obsolete: true
Attachment #273071 - Flags: review?(LpSolit)
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+
Flags: approval3.0+
Flags: approval+
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-
(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 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-
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
Closed: 17 years ago
Resolution: --- → FIXED
Keywords: relnote
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
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.