javascript/index.js
//insert a new message into history_array
insert a new message into history_array
insert a new message into history_array
function insert_new_msg(roomid,author_id,msg)
{
	var room_obj = null;
	room_obj = get_room_obj(roomid);
	if(room_obj == null){
		room_obj = new room_record(roomid);
		history_array.push(room_obj);
	}
	var new_record=new record_msg(author_id,msg);
	room_obj.msg_list.push(new_record);
}
function insert_new_msg ( roomid , author_id , msg ) { var room_obj = null ; room_obj = get_room_obj ( roomid ) ; if ( room_obj == null ) { room_obj = new room_record ( roomid ) ; history_array . push ( room_obj ) ; } var new_record = new record_msg ( author_id , msg ) ; room_obj . msg_list . push ( new_record ) ; }
insert a new message into history_array
insert a new message into history_array
//find  room object //not find then  create //create a record