Several bugfixes, first step for implementing features needed for munich.

Signed-off-by: Raffaele Di Fazio <raffo@mir.local>
Fixed a little bug with private chats.

Signed-off-by: Raffaele Di Fazio <raffo@mir.local>
Reordering a part of code

Signed-off-by: Raffaele Di Fazio <raffo@mir.local>
Removed console.log.

Signed-off-by: Raffaele Di Fazio <raffo@mir.local>
Fixed a bug with private chats.

Signed-off-by: Raffaele Di Fazio <raffo@mir.local>