Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
10eac673
Commit
10eac673
authored
12 years ago
by
Michael Hamann
Browse files
Options
Downloads
Patches
Plain Diff
Add threading headers to change notification mails as proposed in PR #120
parent
dfbe4adf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc/subscription.php
+35
-2
35 additions, 2 deletions
inc/subscription.php
with
35 additions
and
2 deletions
inc/subscription.php
+
35
−
2
View file @
10eac673
...
...
@@ -424,9 +424,14 @@ class Subscription {
$trep
[
'DIFF'
]
=
$tdiff
;
$hrep
[
'DIFF'
]
=
$hdiff
;
$headers
=
array
(
'Message-Id'
=>
$this
->
getMessageID
(
$id
));
if
(
$rev
)
{
$headers
[
'In-Reply-To'
]
=
$this
->
getMessageID
(
$id
,
$rev
);
}
return
$this
->
send
(
$subscriber_mail
,
$subject
,
$id
,
$template
,
$trep
,
$hrep
$template
,
$trep
,
$hrep
,
$headers
);
}
...
...
@@ -542,9 +547,10 @@ class Subscription {
* template (in text format)
* @param array $hrep Predefined parameters used to parse the
* template (in HTML format), null to default to $trep
* @param array $headers Additional mail headers in the form 'name' => 'value'
* @return bool
*/
protected
function
send
(
$subscriber_mail
,
$subject
,
$context
,
$template
,
$trep
,
$hrep
=
null
)
{
protected
function
send
(
$subscriber_mail
,
$subject
,
$context
,
$template
,
$trep
,
$hrep
=
null
,
$headers
=
array
()
)
{
global
$lang
;
global
$conf
;
...
...
@@ -560,9 +566,36 @@ class Subscription {
if
(
isset
(
$trep
[
'SUBSCRIBE'
]))
{
$mail
->
setHeader
(
'List-Unsubscribe'
,
'<'
.
$trep
[
'SUBSCRIBE'
]
.
'>'
,
false
);
}
foreach
(
$headers
as
$header
=>
$value
)
{
$mail
->
setHeader
(
$header
,
$value
);
}
return
$mail
->
send
();
}
/**
* Get a valid message id for a certain $id and revision (or the current revision)
* @param string $id The id of the page (or media file) the message id should be for
* @param string $rev The revision of the page, set to the current revision of the page $id if not set
* @return string
*/
protected
function
getMessageID
(
$id
,
$rev
=
NULL
)
{
static
$listid
=
null
;
if
(
is_null
(
$listid
))
{
$server
=
parse_url
(
DOKU_URL
,
PHP_URL_HOST
);
$listid
=
join
(
'.'
,
array_reverse
(
explode
(
'/'
,
DOKU_BASE
)))
.
$server
;
$listid
=
urlencode
(
$listid
);
$listid
=
strtolower
(
trim
(
$listid
,
'.'
));
}
if
(
is_null
(
$rev
))
{
$rev
=
@
filemtime
(
wikiFN
(
$id
));
}
return
"<
$id
?rev=
$rev
@
$listid
>"
;
}
/**
* Default callback for COMMON_NOTIFY_ADDRESSLIST
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment