diff --git a/application/Espo/Resources/i18n/en_US/Global.json b/application/Espo/Resources/i18n/en_US/Global.json
index f74fd07c7b..9cd434d6dd 100644
--- a/application/Espo/Resources/i18n/en_US/Global.json
+++ b/application/Espo/Resources/i18n/en_US/Global.json
@@ -277,6 +277,8 @@
"postTargetYou": "{user} posted to you",
"postTargetYouAndOthers": "{user} posted to {target} and you",
"postTargetAll": "{user} posted to all",
+ "postTargetSelf": "{user} posted to self",
+ "postTargetSelfAndOthers": "{user} posted to {target} and self",
"mentionInPost": "{user} mentioned {mentioned} in {entityType} {entity}",
diff --git a/application/Espo/Services/Stream.php b/application/Espo/Services/Stream.php
index 5dea9d9c03..bdcf7aa3b5 100644
--- a/application/Espo/Services/Stream.php
+++ b/application/Espo/Services/Stream.php
@@ -449,7 +449,7 @@ class Stream extends \Espo\Core\Services\Base
$e->set('relatedName', $entity->get('name'));
}
}
- if ($e->get('type') == 'Post' && $e->get('parentId') === null) {
+ if ($e->get('type') == 'Post' && $e->get('parentId') === null && !$e->get('isGlobal')) {
$e->loadLinkMultipleField('users');
if (count($e->get('usersIds')) == 0) {
$e->loadLinkMultipleField('teams');
diff --git a/frontend/client/src/views/stream/notes/post.js b/frontend/client/src/views/stream/notes/post.js
index df8b2f5626..a5ca7eed40 100644
--- a/frontend/client/src/views/stream/notes/post.js
+++ b/frontend/client/src/views/stream/notes/post.js
@@ -74,22 +74,34 @@ Espo.define('views/stream/notes/post', 'views/stream/note', function (Dep) {
this.messageData['targetType'] = this.translateEntityType('User', userIdList.length > 1);
- var userHtml = '';
- var userHtmlList = [];
- userIdList.forEach(function (userId) {
- if (userId === this.getUser().id) {
- this.messageName = 'postTargetYou';
- if (userIdList.length > 1) {
- this.messageName = 'postTargetYouAndOthers';
+ if (userIdList.length === 1 && userIdList[0] === this.model.get('createdById')) {
+ this.messageName = 'postTargetSelf';
+ } else {
+ var userHtml = '';
+ var userHtmlList = [];
+ userIdList.forEach(function (userId) {
+ if (userId === this.getUser().id) {
+ this.messageName = 'postTargetYou';
+ if (userIdList.length > 1) {
+ if (userId === this.model.get('createdById')) {
+ this.messageName = 'postTargetSelfAndOthers';
+ } else {
+ this.messageName = 'postTargetYouAndOthers';
+ }
+ }
+ } else {
+ if (userId === this.model.get('createdById')) {
+ this.messageName = 'postTargetSelfAndOthers';
+ } else {
+ var userName = userNameHash[userId];
+ if (userName) {
+ userHtmlList.push('' + userName + '');
+ }
+ }
}
- } else {
- var userName = userNameHash[userId];
- if (userName) {
- userHtmlList.push('' + userName + '');
- }
- }
- }, this);
- this.messageData['target'] = userHtmlList.join(', ');
+ }, this);
+ this.messageData['target'] = userHtmlList.join(', ');
+ }
}
}
}