javascript/index.js
//this methods receives messages from other users (author_id is an unique identifier per user)
this methods receives messages from other users (author_id is an unique identifier per user)
this methods receives messages from other users ( author_id is an unique identifier per user )
function resp_on_message( author_id, msg ){
	  var str = "";
	  var show_text = "";
	  var show_id = "";
	  console.log("author_id id is %s,said :",author_id,msg); 
	  var  msg_obj = JSON.parse(msg);
	  if("normal" == msg_obj.type){
	  	show_id = author_id;
		show_text = msg_obj.text;
		insert_new_msg(this.roomid, show_id,show_text);
	  	if(this.roomid == active_room_name){
	  		console.log("show : %s",show_text);
	  		show_current_message(show_id,show_text);
	  	}
	  }
	  else if("history" == msg_obj.type){
		show_id = msg_obj.original_id;
		show_text = msg_obj.text;
		 insert_new_msg(this.roomid, show_id,show_text);
		 if(this.roomid == active_room_name){
		  	console.log("show : %s",show_text);
		  	show_current_message(show_id,show_text);
		}
	  }
	  else if("user_infor" == msg_obj.type){
	  	if(UserInfor[msg_obj.user_id] == null){
			UserInfor[msg_obj.user_id] = msg_obj.user_name;
		}
		return;
	  }
	  else if("private" == msg_obj.type){
	  	show_private_msg(author_id,msg_obj.text)
	  }
	  else if("trigger" == msg_obj.type){
		  console.log(" test 3");
	  	update_room_list(this);
	  }
}
function resp_on_message ( author_id , msg ) { var str = "" ; var show_text = "" ; var show_id = "" ; console . log ( "author_id id is %s,said :" , author_id , msg ) ; var msg_obj = JSON . parse ( msg ) ; if ( "normal" == msg_obj . type ) { show_id = author_id ; show_text = msg_obj . text ; insert_new_msg ( this . roomid , show_id , show_text ) ; if ( this . roomid == active_room_name ) { console . log ( "show : %s" , show_text ) ; show_current_message ( show_id , show_text ) ; } } else if ( "history" == msg_obj . type ) { show_id = msg_obj . original_id ; show_text = msg_obj . text ; insert_new_msg ( this . roomid , show_id , show_text ) ; if ( this . roomid == active_room_name ) { console . log ( "show : %s" , show_text ) ; show_current_message ( show_id , show_text ) ; } } else if ( "user_infor" == msg_obj . type ) { if ( UserInfor [ msg_obj . user_id ] == null ) { UserInfor [ msg_obj . user_id ] = msg_obj . user_name ; } return ; } else if ( "private" == msg_obj . type ) { show_private_msg ( author_id , msg_obj . text ) } else if ( "trigger" == msg_obj . type ) { console . log ( " test 3" ) ; update_room_list ( this ) ; } }
this methods receives messages from other users (author_id is an unique identifier per user)
this methods receives messages from other users ( author_id is an unique identifier per user )
//data received // console.log("this.roomid %s, active_room_name = %s", this.roomid,active_room_name) // console.log("this.roomid %s, active_room_name = %s", this.roomid,active_room_name) //save user name infor