Don't change ejabberd hosts or jwchat sitename when changing hostname.
Update these only when the domain name is changed.
Add a configuration field to change FQDN.
Allow user to change domain name, then determine the FQDN from it.
Use FQDN instead of hostname when registering an account.