使用iOS Openfire和Robbie Hanson库加入具有所有者特权的现有XMPP MUC会议室 [英] Join an existing XMPP MUC Room with Owner Privileges using iOS Openfire and Robbie Hanson library
问题描述
我要使用以下代码加入现有的MUC会议室:
I am joining an existing MUC room using the next code:
XMPPRoomMemoryStorage *roomStorage = [[XMPPRoomMemoryStorage alloc] init];
XMPPJID *roomJID = [XMPPJID jidWithString:@"newRoom5@conference.administrator"];
xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:roomStorage
jid:roomJID
dispatchQueue:dispatch_get_main_queue()];
[xmppRoom activate:[self appDelegate].xmppStream];
[xmppRoom addDelegate:self
delegateQueue:dispatch_get_main_queue()];
[xmppRoom joinRoomUsingNickname:[self appDelegate].xmppStream.myJID.user
history:nil
password:nil];
XMPPMUC * xmppMUC = [[XMPPMUC alloc] initWithDispatchQueue:dispatch_get_main_queue()];
[xmppMUC activate:[self appDelegate].xmppStream];
[xmppMUC addDelegate:self delegateQueue:dispatch_get_main_queue()];
并且在用户加入聊天室之后,我试图将其权限更改为所有者,而不使用创建聊天室的用户(实际所有者帐户):
and in after the user joins the room I am trying to change his permissions to owner without using the user that created the room(the actual owners account):
- (void)xmppRoomDidJoin:(XMPPRoom *)sender {
// ADD USERS TO OWNERS LIST
[xmppRoom editRoomPrivileges:@[[XMPPRoom itemWithAffiliation:@"owner" jid:[XMPPJID jidWithString:[self appDelegate].xmppStream.myJID.user]]]];
}
我得到一个错误,我不确定它是否相关:
And I get the error, that I don't know for sure if it is related:
RECV: <iq xmlns="jabber:client" type="error"
id="64BBA616-56D7-4CB1-AC07-CBEA4C37E98C"
from="newroom5@conference.administrator"
to="newuser236@administrator/26ee7a3d">
<query xmlns="http://jabber.org/protocol/muc#admin">
<item affiliation="member" jid="newuser236"/>
</query>
<error code="403" type="auth">
<forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
,并且该用户未添加到Openfire的所有者"列表中.
and the user is not added to the Owners list in Openfire.
我还要添加我设置的内容:
Also I want to add that I set:
publicRoom : 1
moderated : 0
membersOnly : 0
canInvite : 1
roomPassword : nil
canRegister : 1
canDiscoverJID : 1
logEnabled : 1
关于如何将刚加入会议室的用户添加到所有者列表的任何建议?还有我为什么会收到错误的任何想法?
Any suggestions on how to add the user that just joined the room to the owners list? and also any ideas why I am getting the error?
推荐答案
由于无法使用xmpp库,因此我使用PHP创建了功能,因此无法解决此问题,但是使用PHP编码和DB可以解决该问题.
As I was unable to use the xmpp library I created functionality using PHP, so the issue is not solved but using PHP coding and DB you can go around it.
这篇关于使用iOS Openfire和Robbie Hanson库加入具有所有者特权的现有XMPP MUC会议室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!