瀏覽代碼

nick limits

Nathaniel van Diepen 11 年之前
父節點
當前提交
18376a3394
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 4 2
      app/OmnomIRC.js
  2. 2 1
      app/www/js/omnomirc.js

+ 4 - 2
app/OmnomIRC.js

@@ -114,8 +114,10 @@ io.sockets.on('connection',function(socket){
 	socket.on('auth',function(data){
 		logger.info(data.nick+' registered');
 		// TODO - authorize
-		socket.set('nick',data.nick);
-		socket.emit('authorized');
+		socket.set('nick',data.nick.substr(0,12));
+		socket.emit('authorized',{
+			nick: data.nick.substr(0,12)
+		});
 	});
 	var usersInRoom = function(room){
 			var sockets = io.sockets.clients(room),

+ 2 - 1
app/www/js/omnomirc.js

@@ -133,7 +133,8 @@
 			},
 			{
 				on: 'authorized',
-				fn: function(){
+				fn: function(data){
+					properties.nick = data.nick;
 					for(var i in settings.autojoin){
 						socket.emit('join',{
 							name: settings.autojoin[i]