Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
ef56c491
Commit
ef56c491
authored
Aug 28, 2008
by
dkl%redhat.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 449791 â Allow flag notification emails to be threaded similar to normal bug change emails
Patch by Dave Lawrence <dkl@redhat.com> - r/a=LpSolit
parent
745f9e65
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
22 deletions
+39
-22
BugMail.pm
Bugzilla/BugMail.pm
+1
-17
Flag.pm
Bugzilla/Flag.pm
+9
-4
Mailer.pm
Bugzilla/Mailer.pm
+28
-1
email.txt.tmpl
template/en/default/request/email.txt.tmpl
+1
-0
No files found.
Bugzilla/BugMail.pm
View file @
ef56c491
...
...
@@ -636,22 +636,6 @@ sub sendMail {
push
(
@watchingrel
,
'None'
)
unless
@watchingrel
;
push
@watchingrel
,
map
{
user_id_to_login
(
$_
)
}
@$watchingRef
;
my
$sitespec
=
'@'
.
Bugzilla
->
params
->
{
'urlbase'
};
$sitespec
=~
s/:\/\//\./
;
# Make the protocol look like part of the domain
$sitespec
=~
s/^([^:\/]+):(\d+)/$1/
;
# Remove a port number, to relocate
if
(
$2
)
{
$sitespec
=
"-$2$sitespec"
;
# Put the port number back in, before the '@'
}
my
$threadingmarker
;
if
(
$isnew
)
{
$threadingmarker
=
"Message-ID: <bug-$id-"
.
$user
->
id
.
"$sitespec>"
;
}
else
{
$threadingmarker
=
"In-Reply-To: <bug-$id-"
.
$user
->
id
.
"$sitespec>"
.
"\nReferences: <bug-$id-"
.
$user
->
id
.
"$sitespec>"
;
}
my
$vars
=
{
isnew
=>
$isnew
,
to
=>
$user
->
email
,
...
...
@@ -678,7 +662,7 @@ sub sendMail {
reporter
=>
$values
{
'reporter'
},
reportername
=>
Bugzilla::
User
->
new
({
name
=>
$values
{
'reporter'
}})
->
name
,
diffs
=>
$diffs
,
threadingmarker
=>
$threadingmarker
threadingmarker
=>
build_thread_marker
(
$id
,
$user
->
id
,
$isnew
),
};
my
$msg
;
...
...
Bugzilla/Flag.pm
View file @
ef56c491
...
...
@@ -1104,10 +1104,15 @@ sub notify {
}
foreach
my
$to
(
keys
%
recipients
)
{
my
$vars
=
{
'flag'
=>
$flag
,
'to'
=>
$to
,
'bug'
=>
$bug
,
'attachment'
=>
$attachment
};
# Add threadingmarker to allow flag notification emails to be the
# threaded similar to normal bug change emails.
my
$thread_user_id
=
$recipients
{
$to
}
?
$recipients
{
$to
}
->
id
:
0
;
my
$vars
=
{
'flag'
=>
$flag
,
'to'
=>
$to
,
'bug'
=>
$bug
,
'attachment'
=>
$attachment
,
'threadingmarker'
=>
build_thread_marker
(
$bug
->
id
,
$thread_user_id
)
};
my
$lang
=
$recipients
{
$to
}
?
$recipients
{
$to
}
->
settings
->
{
'lang'
}
->
{
'value'
}
:
$default_lang
;
...
...
Bugzilla/Mailer.pm
View file @
ef56c491
...
...
@@ -35,7 +35,7 @@ package Bugzilla::Mailer;
use
strict
;
use
base
qw(Exporter)
;
@
Bugzilla::Mailer::
EXPORT
=
qw(MessageToMTA)
;
@
Bugzilla::Mailer::
EXPORT
=
qw(MessageToMTA
build_thread_marker
)
;
use
Bugzilla::
Constants
;
use
Bugzilla::
Error
;
...
...
@@ -154,4 +154,31 @@ sub MessageToMTA {
}
}
# Builds header suitable for use as a threading marker in email notifications
sub
build_thread_marker
{
my
(
$bug_id
,
$user_id
,
$is_new
)
=
@_
;
if
(
!
defined
$user_id
)
{
$user_id
=
Bugzilla
->
user
->
id
;
}
my
$sitespec
=
'@'
.
Bugzilla
->
params
->
{
'urlbase'
};
$sitespec
=~
s/:\/\//\./
;
# Make the protocol look like part of the domain
$sitespec
=~
s/^([^:\/]+):(\d+)/$1/
;
# Remove a port number, to relocate
if
(
$2
)
{
$sitespec
=
"-$2$sitespec"
;
# Put the port number back in, before the '@'
}
my
$threadingmarker
;
if
(
$is_new
)
{
$threadingmarker
=
"Message-ID: <bug-$bug_id-$user_id$sitespec>"
;
}
else
{
$threadingmarker
=
"In-Reply-To: <bug-$bug_id-$user_id$sitespec>"
.
"\nReferences: <bug-$bug_id-$user_id$sitespec>"
;
}
return
$threadingmarker
;
}
1
;
template/en/default/request/email.txt.tmpl
View file @
ef56c491
...
...
@@ -49,6 +49,7 @@ Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ bug.bu
[%- IF attachment %] :
[Attachment [% attachment.id %]] [% attachment.description %][% END %]
X-Bugzilla-Type: request
[%+ threadingmarker %]
[%+ USE wrap -%]
[%- FILTER bullet = wrap(80) -%]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment