Per-Channel Emotes Implemented.
This commit is contained in:
parent
163cecf9f0
commit
c3d016e1af
14 changed files with 483 additions and 20 deletions
|
|
@ -15,9 +15,10 @@ You should have received a copy of the GNU Affero General Public License
|
|||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||
|
||||
//local imports
|
||||
const channelModel = require('../../schemas/channel/channelSchema');
|
||||
const permissionModel = require('../../schemas/permissionSchema');
|
||||
const flairModel = require('../../schemas/flairSchema');
|
||||
const emoteModel = require('../../schemas/emoteSchema');
|
||||
const permissionModel = require('../../schemas/permissionSchema');
|
||||
|
||||
module.exports = class{
|
||||
constructor(userDB, chanRank, channel, socket){
|
||||
|
|
@ -96,6 +97,20 @@ module.exports = class{
|
|||
this.emit('siteEmotes', emoteList);
|
||||
}
|
||||
|
||||
async sendChanEmotes(chanDB){
|
||||
//if we wherent handed a channel document
|
||||
if(chanDB == null){
|
||||
//Pull it based on channel name
|
||||
chanDB = await channelModel.findOne({name: this.channel.name});
|
||||
}
|
||||
|
||||
//Pull emotes from channel
|
||||
const emoteList = chanDB.getEmotes();
|
||||
|
||||
//Send it off to the user
|
||||
this.emit('chanEmotes', emoteList);
|
||||
}
|
||||
|
||||
updateFlair(flair){
|
||||
this.flair = flair;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue