本文整理汇总了C#中ASC.Xmpp.Core.protocol.client.IQ.RemoveAllChildNodes方法的典型用法代码示例。如果您正苦于以下问题:C# IQ.RemoveAllChildNodes方法的具体用法?C# IQ.RemoveAllChildNodes怎么用?C# IQ.RemoveAllChildNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASC.Xmpp.Core.protocol.client.IQ
的用法示例。
在下文中一共展示了IQ.RemoveAllChildNodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AdminCommand
public void AdminCommand(IQ iq, MucRoomMember member)
{
Admin admin = iq.Query as Admin;
Admin returnAdmin = new Admin();
if (admin != null)
{
if (iq.Type == IqType.get)
{
foreach (Core.protocol.x.muc.iq.admin.Item item in admin.GetItems())
{
if (item.Actor == null && item.Affiliation != Affiliation.none)
{
foreach (MucRoomMemberInfo mucRoomMember in RoomSettings.Members)
{
if (mucRoomMember.Affiliation == item.Affiliation)
{
returnAdmin.AddItem(
new Core.protocol.x.muc.iq.admin.Item(mucRoomMember.Affiliation,
mucRoomMember.Role,
mucRoomMember.Jid));
}
}
}
}
iq.Query = returnAdmin;
iq.Type = IqType.result;
}
else if (iq.Type == IqType.set)
{
// Change affilation
foreach (Core.protocol.x.muc.iq.admin.Item item in admin.GetItems())
{
if (item.Actor == null)
{
Actor actor = new Actor(){Jid = iq.From};
MucRoomMemberInfo memberToModify = FindMemberInfo(item);
if (memberToModify != null)
{
//Get member
if ((int)item.Affiliation != -1)
{
if (RoomSettings.CanChangeAffilation(memberToModify.Affiliation,
item.Affiliation,
member.Affiliation))
{
memberToModify.Affiliation = item.Affiliation;
//Try notify online
MucRoomMember onlineMember = members.FindByBareJid(memberToModify.Jid);
if (onlineMember != null)
{
onlineMember.Affiliation = item.Affiliation;
}
}
else
{
// Error!
XmppStanzaError.ToErrorStanza(iq, new Error(ErrorCondition.NotAllowed));
return;
}
}
if ((int)item.Role != -1)
{
if (RoomSettings.CanChangeRole(memberToModify.Role,
item.Role,
member.Role,
member.Affiliation))
{
memberToModify.Role = item.Role;
MucRoomMember onlineMember = members.FindByBareJid(memberToModify.Jid);
if (onlineMember != null)
{
if (item.Role != Role.none)
{
onlineMember.Role = item.Role;
}
else
{
//Role == none it's a kick
onlineMember.Kick(actor,item.Reason);
}
}
}
else
{
// Error!
XmppStanzaError.ToErrorStanza(iq, new Error(ErrorCondition.NotAllowed));
return;
}
}
}
}
}
SettingsSave();
iq.RemoveAllChildNodes();
iq.Type = IqType.result;
}
}
//.........这里部分代码省略.........