Skip to content

Commit cf95611

Browse files
author
vikasrohit
authored
fix: part two of fixing the coderbot notifications
Applied the logic with both initiatorUserId and userId
1 parent 5afe050 commit cf95611

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

connect/connectNotificationServer.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ const handler = (topic, message, logger, callback) => {
456456
logger.debug(message.initiatorUserId, 'message.initiatorUserId');
457457
if (message.initiatorUserId) {
458458
// if message is posted by the coder bot, use useId of the predefined system user i.e. tcwebserivce
459-
if (botIds.indexOf(message.userId.toString()) !== -1) {
459+
if (botIds.indexOf(message.initiatorUserId.toString()) !== -1) {
460460
ids.push(config.TCWEBSERVICE_ID);
461461
} else {
462462
ids.push(message.initiatorUserId);
@@ -466,7 +466,12 @@ const handler = (topic, message, logger, callback) => {
466466
// so let's get it
467467
logger.debug(message.userId, 'message.userId');
468468
if (message.userId) {
469-
ids.push(message.userId);
469+
// if message is posted by the coder bot, use useId of the predefined system user i.e. tcwebserivce
470+
if (botIds.indexOf(message.userId.toString()) !== -1) {
471+
ids.push(config.TCWEBSERVICE_ID);
472+
} else {
473+
ids.push(message.userId);
474+
}
470475
}
471476
return service.getUsersById(ids);
472477
// return [];

0 commit comments

Comments
 (0)