mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 12:36:02 +01:00 
			
		
		
		
	closes #1986
This commit is contained in:
		@@ -8,6 +8,7 @@ var async = require('async'),
 | 
			
		||||
	user = require('../user'),
 | 
			
		||||
	utils = require('../../public/src/utils'),
 | 
			
		||||
	db = require('../database'),
 | 
			
		||||
	meta = require('../meta'),
 | 
			
		||||
	notifications = require('../notifications'),
 | 
			
		||||
	posts = require('../posts'),
 | 
			
		||||
	postTools = require('../postTools'),
 | 
			
		||||
@@ -295,6 +296,25 @@ var async = require('async'),
 | 
			
		||||
		});
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	UserNotifications.sendWelcomeNotification = function(uid) {
 | 
			
		||||
		if (!meta.config.welcomeNotification) {
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		var path = meta.config.welcomeLink ? meta.config.welcomeLink : '#';
 | 
			
		||||
 | 
			
		||||
		notifications.create({
 | 
			
		||||
			bodyShort: meta.config.welcomeNotification,
 | 
			
		||||
			bodyLong: meta.config.welcomeNotification,
 | 
			
		||||
			path: path,
 | 
			
		||||
			nid: 'welcome_' + uid
 | 
			
		||||
		}, function(err, notification) {
 | 
			
		||||
			if (!err && notification) {
 | 
			
		||||
				notifications.push(notification, [uid]);
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	UserNotifications.pushCount = function(uid) {
 | 
			
		||||
		var websockets = require('./../socket.io');
 | 
			
		||||
		UserNotifications.getUnreadCount(uid, function(err, count) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user