Implement message_counts_by_date.