1. User logs in
2. User joins room
3. User loads data from database - check if user is a moderator
- if database says user is a moderator but is not registered as a user in the sfs, I addModerator for the user account, and setAsModerator(true).
In your flow there is a problem because you set the moderator flag too late, after having joined the database data.
I would have expected that you loaded the User data immediately in the server side login event. That's the place where you can check the credentials and accept or refuse the client.
Once the User object is returned by the login call in your extension you just set it as Moderator and you should be done.
There is probably one more thing to do for the client side. Since the login response is custom created by your extension you should notify your client that he is a moderator by sending a flag.
When you receive that flag you can set the amIModerator boolean in the SmartFoxClient.
Hope it helps