How to get the unread message count using EntityFieldQuery Using below query I am getting the count of all messages of a user. Now i need to filter them to unread messages only.

global $user;
$query = new EntityFieldQuery();
$count = $query-&gt;entityCondition('entity_type', 'message') 
 -&gt;propertyCondition('uid', $user-&gt;uid)
 -&gt;count()
 -&gt;execute();
If you are using the privatemsg module you can use privatemsg_unread_count().