Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
b9baa2cc
Commit
b9baa2cc
authored
10 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
collabs: Skip activity notice if collabs included in Cc header
parent
e8cedfd6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class.thread.php
+27
-0
27 additions, 0 deletions
include/class.thread.php
include/class.ticket.php
+16
-4
16 additions, 4 deletions
include/class.ticket.php
with
43 additions
and
4 deletions
include/class.thread.php
+
27
−
0
View file @
b9baa2cc
...
...
@@ -380,6 +380,33 @@ Class ThreadEntry {
return
$references
;
}
/**
* Retrieve a list of all the recients of this message if the message
* was received via email.
*
* Returns:
* (array<RFC_822>) list of recipients parsed with the Mail/RFC822
* address parsing utility. Returns an empty array if the message was
* not received via email.
*/
function
getAllEmailRecipients
()
{
$headers
=
self
::
getEmailHeaderArray
();
$recipients
=
array
();
if
(
!
$headers
)
return
$recipients
;
foreach
(
array
(
'To'
,
'Cc'
)
as
$H
)
{
if
(
!
isset
(
$headers
[
$H
]))
continue
;
if
(
!
(
$all
=
Mail_Parse
::
parseAddressList
(
$headers
[
$H
])))
continue
;
$recipients
=
array_merge
(
$recipients
,
$all
);
}
return
$recipients
;
}
function
getUIDFromEmailReference
(
$ref
)
{
$info
=
unpack
(
'Vtid/Vuid'
,
...
...
This diff is collapsed.
Click to expand it.
include/class.ticket.php
+
16
−
4
View file @
b9baa2cc
...
...
@@ -1102,15 +1102,24 @@ class Ticket {
return
;
//Who posted the entry?
$
uid
=
0
;
$
skip
=
array
()
;
if
(
$entry
instanceof
Message
)
{
$poster
=
$entry
->
getUser
();
// Skip the person who sent in the message
$uid
=
$entry
->
getUserId
();
$skip
[
$entry
->
getUserId
()]
=
1
;
// Skip all the other recipients of the message
foreach
(
$entry
->
getEmailAllRecipients
()
as
$R
)
{
foreach
(
$recipients
as
$R2
)
{
if
(
$R2
->
getEmail
()
==
(
$R
->
mailbox
.
'@'
.
$R
->
hostname
))
{
$skip
[
$R2
->
getUserId
()]
=
true
;
break
;
}
}
}
}
else
{
$poster
=
$entry
->
getStaff
();
// Skip the ticket owner
$
uid
=
$this
->
getUserId
();
$
skip
[
$this
->
getUserId
()
]
=
1
;
}
$vars
=
array_merge
(
$vars
,
array
(
...
...
@@ -1125,7 +1134,10 @@ class Ticket {
$options
=
array
(
'inreplyto'
=>
$entry
->
getEmailMessageId
(),
'thread'
=>
$entry
);
foreach
(
$recipients
as
$recipient
)
{
if
(
$uid
==
$recipient
->
getUserId
())
continue
;
// Skip folks who have already been included on this part of
// the conversation
if
(
isset
(
$skip
[
$recipient
->
getUserId
()]))
continue
;
$notice
=
$this
->
replaceVars
(
$msg
,
array
(
'recipient'
=>
$recipient
));
$email
->
send
(
$recipient
,
$notice
[
'subj'
],
$notice
[
'body'
],
$attachments
,
$options
);
...
...
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