mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	updated topic viewing so that markAsRead marks any relevant notifications read (issue #219)
This commit is contained in:
		@@ -7,6 +7,7 @@ var	RDB = require('./redis.js')
 | 
			
		||||
	posts = require('./posts.js'),
 | 
			
		||||
	threadTools = require('./threadTools.js'),
 | 
			
		||||
	postTools = require('./postTools'),
 | 
			
		||||
	Notifications = require('./notifications'),
 | 
			
		||||
	async = require('async'),
 | 
			
		||||
	feed = require('./feed.js'),
 | 
			
		||||
	favourites = require('./favourites.js'),
 | 
			
		||||
@@ -511,6 +512,14 @@ var	RDB = require('./redis.js')
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		user.notifications.getUnreadByUniqueId(uid, 'topic:' + tid, function(err, nids) {
 | 
			
		||||
			if (nids.length > 0) {
 | 
			
		||||
				async.each(nids, function(nid, next) {
 | 
			
		||||
					Notifications.mark_read(nid, uid, next);
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Topics.hasReadTopics = function(tids, uid, callback) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user