如何在xmpp服务器中创建新组
我使用 Strope.js 库在我的应用程序与 XMPP(Openfire) 服务器之间进行通信。
我想添加用户和组, 我怎样才能创建新群组? 如何通过添加好友查询提及群组名称?
这是我添加新用户的代码
var str1=$pres({'xmlns':'jabber:client','from':[email protected],'to':[email protected],'type':'subscribe'}).c('nick',{'xmlns':'http://jabber.org/protocol/nick'}).t(userName);
connection.send(str1.tree());
,我在一天中引用了 XMPP 扩展,但我找不到正确的结果
Am using Strophe.js library for communication between my application with XMPP(Openfire) server.
I want add user with group,
How can i create new group?
How can i mention group name with add buddy query?
This is my code for adding new user
var str1=$pres({'xmlns':'jabber:client','from':[email protected],'to':[email protected],'type':'subscribe'}).c('nick',{'xmlns':'http://jabber.org/protocol/nick'}).t(userName);
connection.send(str1.tree());
I refer XMPP extension over day but i cant find proper result
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要发送名册更新。 阅读 RFC 6121 第 2 节了解详细信息。您将发送此协议:
使用类似以下的代码:
You need to send a roster update. Read RFC 6121, Section 2 for details. You'll be sending this protocol:
With code something like:
我用下面的代码做了这个。
XMPPRoomCoreDataStorage *rosterstorage =[[XMPPRoomCoreDataStorage alloc] init];
XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:rosterstorage jid:[XMPPJID jidWithString:@"[电子邮件受保护]"]dispatchQueue:dispatch_get_main_queue()];
然后
{
NSXMLElement *iq = [NSXMLElement elementWithName:@"iq"];
}
I have made this Using below code.
XMPPRoomCoreDataStorage *rosterstorage =[[XMPPRoomCoreDataStorage alloc] init];
XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:rosterstorage jid:[XMPPJID jidWithString:@"[email protected]"] dispatchQueue:dispatch_get_main_queue()];
Then
{
NSXMLElement *iq = [NSXMLElement elementWithName:@"iq"];
}