It's not required, but it is considered good practice, since in theory, you can send interesting information when you go unavailable, like how long you expect to be gone. In practice, it almost never makes a difference.
Keep in mind that a conformant server will send your unavailable presence (whether automatically, or when you ask it to by sending type='unavailable'), it will go to all of your subscribers (subscription='both' or 'from'), as well as every JID you have directed presence to. This is crucial to ensure that you get dropped out of all of the chat rooms you have joined (by sending them presence), for example.
发布评论
评论(1)
这不是必需的,但它被认为是良好的做法,因为理论上,当您无法联系时,您可以发送有趣的信息,例如您预计会离开多长时间。实际上,这几乎不会产生任何影响。
请记住,一致的服务器将发送您不可用的状态(无论是自动发送,还是当您通过发送 type='unavailable' 请求时),它将发送给您的所有订阅者(订阅='both' 或 'from') ,以及您指定的每个 JID。例如,这对于确保您退出已加入的所有聊天室(通过向他们发送状态)至关重要。
It's not required, but it is considered good practice, since in theory, you can send interesting information when you go unavailable, like how long you expect to be gone. In practice, it almost never makes a difference.
Keep in mind that a conformant server will send your unavailable presence (whether automatically, or when you ask it to by sending type='unavailable'), it will go to all of your subscribers (subscription='both' or 'from'), as well as every JID you have directed presence to. This is crucial to ensure that you get dropped out of all of the chat rooms you have joined (by sending them presence), for example.