<commit_before><?php
class ChatController extends BaseController {
	//message box
	public function chat($username){
		$user_receive = User::where('username','=',$username);
		if($user_receive->count()){
			$user_receive=$user_receive->first();
			$chatbox=new chat;
			$chatbox->setSender(Auth::user()->username);
			$chatbox->setReceiver($user_receive->username);
			$chat=$chatbox->getChatbox();
			//when never create chatbox
			if($chat==NULL){
 				$chatbox=$chatbox->createChatbox();
 				return View::make('chat.chat', array('chats'=>NULL,'user_send' => Auth::user()))
				->with(array("user_receive"=>$user_receive->username));
			}
			//if don't have meesage
			$status=$chatbox->getMessageAll();
			if($status==NULL){
				return View::make('chat.chat', array('chats'=>NULL,'user_send' => Auth::user()))
				->with(array("user_receive"=>$user_receive->username));
			}
			else{
				return View::make('chat.chat', array('chats'=> $status,'user_send' => Auth::user()))
				->with(array("user_receive"=>$user_receive->username));
			}
			
		}
		return App::abort(404);
	}
<commit_msg>fix chatcontroller<commit_after><?php
class ChatController extends BaseController {
	//message box
	public function chat($username){
		$user_receive = User::where('username','=',$username);
		if($user_receive->count()){
			$user_receive=$user_receive->first();
			$chatbox=new Chat;
			$chatbox->setSender(Auth::user()->username);
			$chatbox->setReceiver($user_receive->username);
			$chat=$chatbox->getChatbox();
			//when never create chatbox
			if($chat==NULL){
 				$chatbox=$chatbox->createChatbox();
 				return View::make('chat.chat', array('chats'=>NULL,'user_send' => Auth::user()))
				->with(array("user_receive"=>$user_receive->username));
			}
			//if don't have meesage
			$status=$chatbox->getMessageAll();
			if($status==NULL){
				return View::make('chat.chat', array('chats'=>NULL,'user_send' => Auth::user()))
				->with(array("user_receive"=>$user_receive->username));
			}
			else{
				return View::make('chat.chat', array('chats'=> $status,'user_send' => Auth::user()))
				->with(array("user_receive"=>$user_receive->username));
			}
			
		}
		return App::abort(404);
	}

{'fraction_non_alphanumeric': 0.211441647597254, 'fraction_numerical': 0.002745995423340961, 'mean_word_length': 5.354651162790698, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5088793', 'n_tokens_mistral': 847, 'n_tokens_neox': 712, 'n_words': 101}