Extract accepting invitation to a method

For easier overriding in sublcasses. As 8fa5a88699479a2e1cc3e1d8f068297f99cbd668 did for invites.
Merge pull request #424 from mikz/patch-1

Extract accepting invitation to a method