notifications socket callbacks
parent
e95da77fe8
commit
111776d878
@ -1,17 +1,15 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
var user = require('../user'),
|
var user = require('../user'),
|
||||||
|
|
||||||
SocketNotifs = {};
|
SocketNotifs = {};
|
||||||
|
|
||||||
SocketNotifs.get = function(socket, data, callback) {
|
SocketNotifs.get = function(socket, data, callback) {
|
||||||
user.notifications.get(socket.uid, function(notifs) {
|
user.notifications.get(socket.uid, callback);
|
||||||
callback(notifs);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketNotifs.getCount = function(socket, data, callback) {
|
SocketNotifs.getCount = function(socket, data, callback) {
|
||||||
user.notifications.getUnreadCount(socket.uid, function(err, count) {
|
user.notifications.getUnreadCount(socket.uid, callback);
|
||||||
callback(err ? err.message : null, count);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = SocketNotifs;
|
module.exports = SocketNotifs;
|
Loading…
Reference in New Issue