[Patch Included] FastPath bug: Invisible chat window if username not taken

I’ve been experiencing an irritating behavior with Openfire, FastPath, and Spark. If there is a workgroup that does not take the variable “username” from the Form UI workgroup settings page, the agent who accepts the chat does not get a new window until the requestor sends a message. I use FastPath exclusively with the XMPP chat bot and I have created a patch that will make the chat bot assign the username variable as the node of the JID of the requesting user at the time of request creation.

This does not solve the same problem if a chat is initiated via a web form–but then I never use it in that manner.

Please see the attached patch.