我正在使用http://xmppjs.prosody.im/编写一个XMPP组件。我想向JID发送消息,但仅在用户在线时才发送。实现这一目标的最快/最有效的方法是什么?
我希望能够检测到此情况,以便例如在用户离线时发送电子邮件。
我希望能够检测到此情况,以便例如在用户离线时发送电子邮件。
<presence type='subscribe' from='my.component' to='user@domain'/>
<presence type='subscribed' to='my.component' from='user@domain'/>
<presence type='subscribe' to='my.component' from='user@domain'/>
<presence type='subscribe' from='my.component' to='user@domain'/>
每次当你需要他们的存在或者每次你的组件启动时,它都需要向该用户发送探针:
<presence type='probe' from='my.component' to='user@domain'/>