I’m not sure if I like the change of the Map key type to Object (I’d probably go with two separate maps instead), but I don’t see how it might be harmful either.
It may be a good idea to make the sending behavior configurable (i.e. disable sending updates for group chats only).
If you don’t mind I’d create a PR in your name for more comfortable code review.
Thanks. It is only a proposal. You are welcome to make changes to make it better.
I am not sure if it needs to have an enable/disable option for group chat.
Current if the app (e.g. aTalk) has the chatState notification disabled, the ChatStateManager will only send ‘active’ state one time, then it will automatically block further sending the chat state as there is no further changes to the chat state.