如何在smack中设置我的名字?

发布于 2024-10-14 13:35:31 字数 91 浏览 5 评论 0原文

我可以使用 connection.getRoster(),getName 来获取联系人的名册名称。 但是如何设置当前认证帐户的名称呢?

I can use connection.getRoster(),getName to get roster names of contact.
But how to set the name of current authenticated account?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只等公子 2024-10-21 13:35:31

使用不同的帐户登录? :)

说真的,你的帐户名与你的身份验证绑定在一起,没有办法强迫对方为你使用特定的昵称,但如果双方都实现 XEP-172,订阅时可以给对方发送提示:

<presence from='[email protected]' to='[email protected]' type='subscribe'>
  <nick xmlns='http://jabber.org/protocol/nick'>Ishmael</nick>
</presence>

Log in with a different account? :)

Seriously, your account name is tied to your authentication, and there's no way to force the other side to use a particular nickname for you, but if both sides implement XEP-172, you can send a hint to the other side when you subscribe:

<presence from='[email protected]' to='[email protected]' type='subscribe'>
  <nick xmlns='http://jabber.org/protocol/nick'>Ishmael</nick>
</presence>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文