<?php

if (isset($_POST['post']))
{
	$post = system :: check(mb_substr(system :: text($_POST['post']), 0, 300,'UTF-8'));
   	if($post != $user['status']) {
		db :: $pdo -> query('update users set status = ? where id = ?', [emoji :: Encode($post), $user['id']]);
  	}
   	die(json_encode(['emoji'=>emoji :: Text($post),'text'=>emoji :: Decode($post)]));
}