From 629a6553358b2dd0ee001b269154067b67cc4331 Mon Sep 17 00:00:00 2001 From: TAT Date: Fri, 18 Jul 2014 16:18:13 +0200 Subject: [PATCH] Convert numbers in args to actual numbers --- bin/client.js | 4 ++-- bin/client.js.map | 2 +- src/client.js | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/client.js b/bin/client.js index 3b344f9..e9dcde2 100644 --- a/bin/client.js +++ b/bin/client.js @@ -48,8 +48,8 @@ function send(a){return client.send(a)} function receivedChatMessage(a){var b,c,d,e,f,g,k;if(initialized){a.message=encoder.htmlDecode(a.message);if("message"!=a.type&&"pm"!=a.type||0!==a.message.indexOf(commandPrefix)||!_this.processOwnMessages&&a.from.id==room.self.id)"emote"==a.type&&_this.emit(messageTypes.CHAT_EMOTE,a);else{if("function"===typeof _this.preCommandHandler&&!1===_this.preCommandHandler(a))return;c="pm"==a.type;d=a.message.substr(commandPrefix.length).split(" ")[0];e={message:a,chatID:a.chatID,from:room.getUser(a.fromID), command:d,args:a.message.substr(commandPrefix.length+d.length+1),mentions:[],respond:function(){var b=Array.prototype.slice.call(arguments).join(" ");return c?intPM(this.from,b):_this.sendChat("@"+a.from+" "+b)},respondTimeout:function(){var b=Array.prototype.slice.call(arguments),d=b.splice(b.length-1,1),b=b.join(" ");return c?intPM(this.from,b):_this.sendChat("@"+a.from+" "+b,d)},havePermission:function(b,c,d){void 0===b&&(b=0);(b=void 0!==room.getUser(a.fromID)&&room.getUser(a.fromID).permission>= b)&&"function"===typeof c?c():b||"function"!==typeof d||d();return b},isFrom:function(b,c,d){"string"===typeof b&&(b=[b]);if(void 0===b||!util.isArray(b))return"function"===typeof d&&d(),!1;(b=-1h.username.length)&& -(h=g[b]);null!==h&&(e.args=e.args.substr(0,f)+"%MENTION-"+k+"-"+e.mentions.length+"%"+e.args.substr(f+h.username.length+1),e.mentions.push(h));f=e.args.indexOf("@",f+1)}e.args=e.args.split(" ");for(b in e.mentions)e.mentions.hasOwnProperty(b)&&(e.args[e.args.indexOf("%MENTION-"+k+"-"+b+"%")]=e.mentions[b]);_this.emit(messageTypes.CHAT_COMMAND,e);_this.emit(messageTypes.CHAT_COMMAND+":"+d,e);_this.moderateDeleteChat(a.chatID)}"pm"==a.type?_this.emit("pm",a):(_this.emit(messageTypes.CHAT,a),_this.emit(messageTypes.CHAT+ -":"+a.type,a),null!==room.getUser()&&-1