Implement instant message capture.

This covers both messages sent to other users and to group chat.