mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
resolved #1372 -- username clashes will now cause a random # to be appended to the username
This commit is contained in:
@@ -3,11 +3,13 @@
|
||||
var async = require('async'),
|
||||
winston = require('winston'),
|
||||
cron = require('cron').CronJob,
|
||||
nconf = require('nconf'),
|
||||
|
||||
db = require('./database'),
|
||||
utils = require('../public/src/utils'),
|
||||
events = require('./events'),
|
||||
User = require('./user');
|
||||
User = require('./user'),
|
||||
meta = require('./meta');
|
||||
|
||||
(function(Notifications) {
|
||||
|
||||
@@ -29,14 +31,22 @@ var async = require('async'),
|
||||
if (exists) {
|
||||
db.sortedSetRank('uid:' + uid + ':notifications:read', nid, function(err, rank) {
|
||||
|
||||
db.getObjectFields('notifications:' + nid, ['nid', 'from', 'text', 'importance', 'score', 'path', 'datetime', 'uniqueId'], function(err, notification) {
|
||||
db.getObjectFields('notifications:' + nid, ['nid', 'from', 'text', 'image', 'importance', 'score', 'path', 'datetime', 'uniqueId'], function(err, notification) {
|
||||
notification.read = rank !== null ? true:false;
|
||||
|
||||
if (notification.from) {
|
||||
if (notification.from && !notification.image) {
|
||||
User.getUserField(notification.from, 'picture', function(err, picture) {
|
||||
notification.image = picture;
|
||||
callback(notification);
|
||||
});
|
||||
} else if (notification.image) {
|
||||
switch(notification.image) {
|
||||
case 'brand:logo':
|
||||
notification.image = meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png';
|
||||
break;
|
||||
}
|
||||
|
||||
callback(notification);
|
||||
} else {
|
||||
callback(notification);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user