Commit ff196fe9 authored by Chris Oelmueller's avatar Chris Oelmueller

Fix #789 overwritten mailbox name

replace :contains(...) - which matches everything that "contains" the
other mailbox name, if it came first (sort order is by mailbox ID,
so the names can be all over the place), with exact match. thus, stop
overwriting names who partially match other mailbox names :)
parent 6956040e
Pipeline #161606387 passed with stages
in 13 minutes and 7 seconds
......@@ -124,11 +124,16 @@ class MailboxXhr extends Control
}
$nc_js = '';
if ($boxes = $this->mailboxGateway->getBoxes($this->session->isAmbassador(), $this->session->id(), $this->mailboxPermissions->mayHaveMailbox())) {
// we already handled the "not a store manager case" (PERMISSION_DENIED) earlier
if ($boxes = $this->mailboxGateway->getBoxes($this->session->isAmbassador(), $this->session->id(), true)) {
if ($newcount = $this->mailboxGateway->getNewCount($boxes)) {
foreach ($newcount as $nc) {
// locate the tree entry for this mailbox with jQuery + append unread count
$mailboxName = $nc['name'] . '@' . PLATFORM_MAILBOX_HOST;
$nc_js .= '
$( "ul.dynatree-container a.dynatree-title:contains(\'' . $nc['name'] . '@' . PLATFORM_MAILBOX_HOST . '\')" ).addClass("newmail").attr("data-count","(' . $nc['count'] . ') ");';
$("ul.dynatree-container a.dynatree-title").filter(function () {
return $(this).text() === "' . $mailboxName . '";
}).addClass("newmail").attr("data-count","(' . $nc['count'] . ') ");';
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment