summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Queue_Overlay.pm
diff options
context:
space:
mode:
authorivan <ivan>2004-11-11 12:13:50 +0000
committerivan <ivan>2004-11-11 12:13:50 +0000
commitb8cfd0780aa40bb07f3215bf9cb58011f5e32a35 (patch)
tree5b5deb6f64cf6eb9f4630675725b59e7bfad137a /rt/lib/RT/Queue_Overlay.pm
parent0a2e57727e8f00fdc8ec4596619fb206c95fa919 (diff)
parentc582e92888b4a5553e1b4e5214cf35217e4a0cf0 (diff)
This commit was generated by cvs2svn to compensate for changes in r3874,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/lib/RT/Queue_Overlay.pm')
-rw-r--r--rt/lib/RT/Queue_Overlay.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/rt/lib/RT/Queue_Overlay.pm b/rt/lib/RT/Queue_Overlay.pm
index fcc185b10..f40055b3b 100644
--- a/rt/lib/RT/Queue_Overlay.pm
+++ b/rt/lib/RT/Queue_Overlay.pm
@@ -48,6 +48,7 @@ no warnings qw(redefine);
use vars qw(@STATUS @ACTIVE_STATUS @INACTIVE_STATUS $RIGHTS);
use RT::Groups;
use RT::ACL;
+use RT::EmailParser;
@ACTIVE_STATUS = qw(new open stalled);
@@ -518,6 +519,8 @@ Email The email address of the new watcher. If a user with this
If the watcher you\'re trying to set has an RT account, set the Owner paremeter to their User Id. Otherwise, set the Email parameter to their Email address.
+Returns a tuple of (status/id, message).
+
=cut
sub AddWatcher {
@@ -602,10 +605,13 @@ sub _AddWatcher {
# if the user doesn't exist, we need to create a new user
my $new_user = RT::User->new($RT::SystemUser);
+ my ( $Address, $Name ) =
+ RT::EmailParser::ParseAddressFromHeader('', $args{'Email'});
+
my ( $Val, $Message ) = $new_user->Create(
- Name => $args{'Email'},
- EmailAddress => $args{'Email'},
- RealName => $args{'Email'},
+ Name => $Address,
+ EmailAddress => $Address,
+ RealName => $Name,
Privileged => 0,
Comments => 'Autocreated when added as a watcher');
unless ($Val) {