Changes filtered conversation thread database query to account for groups.

Fixes #1954