I want to integrate XMPP chat into my website. Tried to create just a bare bone chat, where it should auto login and auto open a chat window. It just can auto login, but does nothing after that.
The whole code is as below. Why it does not auto open a chat window?
<body>
<script>
converse.initialize({
show_controlbox_by_default: true,
allow_muc: false,
show_controlbox_by_default: true,
auto_login: true,
authentication: 'login',
jid: 'kelvin@xmpp.mydomainhere.com',
password: 'kelvin',
websocket_url: 'wss://xmpp.mydomainhere.com:5280/websocket'
});
console.log("000");
converse.plugins.add('myplugin', {
initialize: function () {
this._converse.chats.open('jacky@xmpp.mydomainhere.com')
var msg = converse.env.$msg({
from: 'kelvin@xmpp.mydomainhere.com',
to:'jacky@xmpp.mydomainhere.com',
type:'chat'
});
this._converse.send(msg);
}
});
</script>
</body>