wip: filter messages by type.

Initial work.

see #376