convertCubeItemToXmpp function
Implementation
xmpp.PrivacyListItem convertCubeItemToXmpp(
CubePrivacyListItem cubeItem, int order, bool inGroup) {
var controlStanzas = <xmpp.PrivacyControlStanza>[];
if (!cubeItem.isMutual) {
controlStanzas.add(xmpp.PrivacyControlStanza.IQ);
controlStanzas.add(xmpp.PrivacyControlStanza.MESSAGE);
controlStanzas.add(xmpp.PrivacyControlStanza.PRESENCE_OUT);
controlStanzas.add(xmpp.PrivacyControlStanza.PRESENCE_IN);
}
var item = xmpp.PrivacyListItem(
type: xmpp.PrivacyType.JID,
value: inGroup
? getUserNickWithMucDomain(cubeItem.userId)
: getJidForUser(cubeItem.userId),
action: cubeItem.action.toEnum(xmpp.PrivacyAction.values)!,
order: order,
controlStanzas: controlStanzas);
return item;
}