Started work on personal emotes.
This commit is contained in:
parent
db5fac83ab
commit
a4a1f6a65b
16 changed files with 248 additions and 18 deletions
|
|
@ -19,6 +19,7 @@ const channelModel = require('../../schemas/channel/channelSchema');
|
|||
const permissionModel = require('../../schemas/permissionSchema');
|
||||
const flairModel = require('../../schemas/flairSchema');
|
||||
const emoteModel = require('../../schemas/emoteSchema');
|
||||
const { userModel } = require('../../schemas/userSchema');
|
||||
|
||||
module.exports = class{
|
||||
constructor(userDB, chanRank, channel, socket){
|
||||
|
|
@ -111,6 +112,20 @@ module.exports = class{
|
|||
this.emit('chanEmotes', emoteList);
|
||||
}
|
||||
|
||||
async sendPersonalEmotes(userDB){
|
||||
//if we wherent handed a channel document
|
||||
if(userDB == null){
|
||||
//Pull it based on channel name
|
||||
userDB = await userModel.findOne({user: this.user});
|
||||
}
|
||||
|
||||
//Pull emotes from channel
|
||||
const emoteList = userDB.getEmotes();
|
||||
|
||||
//Send it off to the user
|
||||
this.emit('personalEmotes', emoteList);
|
||||
}
|
||||
|
||||
updateFlair(flair){
|
||||
this.flair = flair;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue