3 var ChannelModule = require("./module");
4 var Flags = require("../flags");
8 var possible = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
10 for (var i = 0; i < 3; i++)
11 text += possible.charAt(Math.floor(Math.random() * possible.length));
16 function AnonymousPost(_channel) {
17 ChannelModule.apply(this, arguments);
20 AnonymousPost.prototype = Object.create(ChannelModule.prototype);
22 AnonymousPost.prototype.onUserPreJoin = function (user, data, cb) {
23 const opts = this.channel.modules.options;
24 var anonymousPosting = opts.get("allow_anon_chat");
25 if(anonymousPosting && user.isAnonymous){
26 user.guestLogin("Anonymous-" + makeid() +"");
27 //user.guestLogin("Anonymous");
28 cb(null, ChannelModule.PASSTHROUGH);
31 cb(null, ChannelModule.PASSTHROUGH);
35 module.exports = AnonymousPost;
36 //# sourceMappingURL=anonymouspost.js.map