Update to latest main tree code changes.

Signed-off-by: Przemek Rudy <prudy1@o2.pl>
Merge commit 'refs/merge-requests/242' of git://gitorious.org/kadu/kadu into merge-requests/242