It was a hard decision, but finally, I have made it. I have removed the Group chat functionality from the code. This is not permanent, but for now, this is the case.
There are two main goals I want to achieve in my work. I would like to deliver as many features as I can, but at the same time, I would like to provide a clean, robust and more or less easy to understand code. Sometimes it's not easy to find the balance.
In this case, it was impossible for me. The user management needed to be refactored, and the Group chat functionality did not find a way to work together with the new database structure. I haven't given it up. I will try to bring the Private and Group chat functionalities together in the future again. But now we shall continue with the new and polished Private chat.
As I mentioned the user management and especially the way how we store the user related info at Firebase has been completely refactored. The current database structure is much more suitable for using the app with a large number of users.
Several smaller changes have also been performed along with a few bug fixes. Please check the latest implementation and let me know what you think.