public function getInviterDetails($member_id, $chatroom_id)
 {
     if ($this->checkInvited($member_id, $chatroom_id) == 'true') {
         $inviter_id = InviteMember::getInviterId($member_id, $chatroom_id);
         return UserPeer::getMemberDetailsFromId($inviter_id);
     }
 }
 public function registerChatroom($chatroom_id, $accept = null)
 {
     if ($accept == false) {
         InviteMember::deleteInvite($chatroom_id);
         return Redirect::route('home');
     } elseif ($accept == true) {
         InviteMember::deleteInvite($chatroom_id);
     }
     if (!$chatroom_id) {
         $chatroom_id = Input::get('chatroom_id');
     }
     if ($chatroom_id) {
         $register_room = new ChatRoomMember();
         $register_room->member_id = Auth::user()->id;
         $register_room->chatroom_id = $chatroom_id;
         $register_room->is_active = 0;
         $register_room->save();
     }
     return Redirect::route('home');
 }