If there is at least one unread message among the selected messages the action is "mark as read". Otherwise, "mark as unread". If there is at least one unstarred message among the selected messages the action is "add star". Otherwise, "remove star".