Fix some compiler warnings
Summary: There are several logic mistakes in the current code. Compiler warns about them and this patch tries to fix tnem.
Test Plan: Compiles and installs, XMPP part was not tested.
Reviewers: KDE Games, aacid
Reviewed By: aacid
Subscribers: nhirsl, aacid, chehrlic, kde-games-devel
Differential Revision: https://phabricator.kde.org/D25199