Skip to content

Node.js based forum software built for the modern web

fix: notifications for tag followers not being sent if author is a remote user

Julian Lam8de2352e64c8
diff --git a/src/topics/create.js b/src/topics/create.js
index 581017eff5..8a6c8dafe6 100644
--- a/src/topics/create.js
+++ b/src/topics/create.js
@@ -153,8 +153,11 @@ module.exports = function (Topics) {
analytics.increment(['topics', `topics:byCid:${topicData.cid}`]);
plugins.hooks.fire('action:topic.post', { topic: topicData, post: postData, data: data });
- if (parseInt(uid, 10) && !topicData.scheduled) {
- user.notifications.sendTopicNotificationToFollowers(uid, topicData, postData);
+ if (!topicData.scheduled) {
+ if (utils.isNumber(uid)) {
+ // New topic notifications only sent for local-to-local follows only
+ user.notifications.sendTopicNotificationToFollowers(uid, topicData, postData);
+ }
Topics.notifyTagFollowers(postData, uid);
categories.notifyCategoryFollowers(postData, uid);
}