message_thread.php, procedures in friends.sql