This is a possible fix for #5655.
While running SM45/SM52 in debug mode, it triggered compartment failures. Indeed, it seems XMPP is initialised with a ScriptInterface that isn't the same as the scriptInterface calling "guiPollNewMessages".
I couldn't reproduce the crash using P221 with this fix applied on SM52.