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
41c14117
Commit
41c14117
authored
14 years ago
by
Adrian Lang
Browse files
Options
Downloads
Patches
Plain Diff
Ignore small & own changes in digest & list mails
parent
45c5ecdc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inc/lang/de/lang.php
+2
-2
2 additions, 2 deletions
inc/lang/de/lang.php
inc/subscription.php
+10
-11
10 additions, 11 deletions
inc/subscription.php
lib/exe/indexer.php
+28
-18
28 additions, 18 deletions
lib/exe/indexer.php
with
40 additions
and
31 deletions
inc/lang/de/lang.php
+
2
−
2
View file @
41c14117
...
...
@@ -239,8 +239,8 @@ $lang['subscr_m_unsubscribe'] = 'Löschen';
$lang
[
'subscr_m_subscribe'
]
=
'Abonnieren'
;
$lang
[
'subscr_m_receive'
]
=
'Benachrichtigung'
;
$lang
[
'subscr_style_every'
]
=
'Email bei jeder Bearbeitung'
;
$lang
[
'subscr_style_digest'
]
=
'Zusammenfassung der Änderungen für jede veränderte Seite'
;
$lang
[
'subscr_style_list'
]
=
'Liste der geänderten Seiten'
;
$lang
[
'subscr_style_digest'
]
=
'Zusammenfassung der Änderungen für jede veränderte Seite
(Alle %.2f Tage)
'
;
$lang
[
'subscr_style_list'
]
=
'Liste der geänderten Seiten
(Alle %.2f Tage)
'
;
$lang
[
'authmodfailed'
]
=
'Benutzerüberprüfung nicht möglich. Bitte wenden Sie sich an den Systembetreuer.'
;
$lang
[
'authtempfail'
]
=
'Benutzerüberprüfung momentan nicht möglich. Falls das Problem andauert, wenden Sie sich an den Systembetreuer.'
;
$lang
[
'i_chooselang'
]
=
'Wählen Sie Ihre Sprache'
;
...
...
This diff is collapsed.
Click to expand it.
inc/subscription.php
+
10
−
11
View file @
41c14117
...
...
@@ -284,20 +284,18 @@ function subscription_addresslist(&$data){
* Sends a digest mail showing a bunch of changes.
*
* @param string $subscriber_mail The target mail address
* @param array $
change
The
newest change
* @param array $
id
The
ID
* @param int $lastupdate Time of the last notification
*
* @author Adrian Lang <lang@cosmocode.de>
*/
function
subscription_send_digest
(
$subscriber_mail
,
$change
,
$lastupdate
)
{
$id
=
$change
[
'id'
];
function
subscription_send_digest
(
$subscriber_mail
,
$id
,
$lastupdate
)
{
$n
=
0
;
do
{
$rev
=
getRevisions
(
$id
,
$n
++
,
1
);
$rev
=
(
count
(
$rev
)
>
0
)
?
$rev
[
0
]
:
null
;
}
while
(
!
is_null
(
$rev
)
&&
$rev
>
$lastupdate
);
$ip
=
$change
[
'ip'
];
$replaces
=
array
(
'NEWPAGE'
=>
wl
(
$id
,
''
,
true
,
'&'
),
'SUBSCRIBE'
=>
wl
(
$id
,
array
(
'do'
=>
'subscribe'
),
true
,
'&'
));
if
(
!
is_null
(
$rev
))
{
...
...
@@ -322,24 +320,25 @@ function subscription_send_digest($subscriber_mail, $change, $lastupdate) {
* Sends a list mail showing a list of changed pages.
*
* @param string $subscriber_mail The target mail address
* @param array $
changes
Array of
change
s
* @param string $
id
The id of the namespace
* @param array $
ids
Array of
id
s
* @param string $
ns_id
The id of the namespace
*
* @author Adrian Lang <lang@cosmocode.de>
*/
function
subscription_send_list
(
$subscriber_mail
,
$changes
,
$id
)
{
function
subscription_send_list
(
$subscriber_mail
,
$ids
,
$ns_id
)
{
if
(
count
(
$ids
)
===
0
)
return
;
global
$conf
;
$list
=
''
;
foreach
(
$
changes
as
$change
)
{
$list
.
=
'* '
.
wl
(
$
change
[
'id'
]
,
array
(),
true
)
.
NL
;
foreach
(
$
ids
as
$id
)
{
$list
.
=
'* '
.
wl
(
$
id
,
array
(),
true
)
.
NL
;
}
subscription_send
(
$subscriber_mail
,
array
(
'DIFF'
=>
rtrim
(
$list
),
'SUBSCRIBE'
=>
wl
(
$id
.
$conf
[
'start'
],
'SUBSCRIBE'
=>
wl
(
$
ns_
id
.
$conf
[
'start'
],
array
(
'do'
=>
'subscribe'
),
true
,
'&'
)),
'subscribe_list'
,
prettyprint_id
(
$id
),
prettyprint_id
(
$
ns_
id
),
'subscr_list'
);
}
...
...
This diff is collapsed.
Click to expand it.
lib/exe/indexer.php
+
28
−
18
View file @
41c14117
...
...
@@ -363,30 +363,40 @@ function sendDigest() {
if
(
substr
(
$id
,
-
1
,
1
)
===
':'
)
{
// The subscription target is a namespace
$changes
=
getRecentsSince
(
$lastupdate
,
null
,
getNS
(
$id
));
if
(
count
(
$changes
)
===
0
)
{
continue
;
}
if
(
$style
===
'digest'
)
{
foreach
(
$changes
as
$change
)
{
subscription_send_digest
(
$USERINFO
[
'mail'
],
$change
,
$lastupdate
);
}
}
elseif
(
$style
===
'list'
)
{
subscription_send_list
(
$USERINFO
[
'mail'
],
$changes
,
$id
);
}
// TODO: Handle duplicate subscriptions.
}
else
{
if
(
auth_quickaclcheck
(
$id
)
<
AUTH_READ
)
continue
;
$meta
=
p_get_metadata
(
$id
);
$rev
=
$meta
[
'last_change'
][
'date'
];
if
(
$rev
<
$lastupdate
)
{
// There is no new revision.
continue
;
$changes
=
array
(
$meta
[
'last_change'
]);
}
// Filter out pages only changed in small and own edits
$change_ids
=
array
();
foreach
(
$changes
as
$rev
)
{
$n
=
0
;
while
(
!
is_null
(
$rev
)
&&
$rev
[
'date'
]
>=
$lastupdate
&&
(
$_SERVER
[
'REMOTE_USER'
]
===
$rev
[
'user'
]
||
$rev
[
'type'
]
===
DOKU_CHANGE_TYPE_MINOR_EDIT
))
{
$rev
=
getRevisions
(
$rev
[
'id'
],
$n
++
,
1
);
$rev
=
(
count
(
$rev
)
>
0
)
?
$rev
[
0
]
:
null
;
}
if
(
!
is_null
(
$rev
)
&&
$rev
[
'date'
]
>=
$lastupdate
)
{
// Some change was not a minor one and not by myself
$change_ids
[]
=
$rev
[
'id'
];
}
subscription_send_digest
(
$USERINFO
[
'mail'
],
$meta
[
'last_change'
],
$lastupdate
);
}
if
(
$style
===
'digest'
)
{
foreach
(
$change_ids
as
$change_id
)
{
subscription_send_digest
(
$USERINFO
[
'mail'
],
$change_id
,
$lastupdate
);
}
}
elseif
(
$style
===
'list'
)
{
subscription_send_list
(
$USERINFO
[
'mail'
],
$change_ids
,
$id
);
}
// TODO: Handle duplicate subscriptions.
// Update notification time.
subscription_set
(
$user
,
$id
,
$style
,
time
(),
true
);
}
...
...
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