merge some of https://github.com/tux3/qTox/pull/642