Disable receiving file transfers

 * This was recommended in #575 and #576.

 * Also refactor some common code.
Merge pull request #592 from arlolra/disable

Disable receiving file transfers