private listType GroupToList(Group group) { listType list = new listType(); list.name = group.Name; list.displayname = new displaynameType(); list.displayname.Value = group.DisplayName; return list; }
private Group ListToGroup(listType list) { Group group = new Group(list.name, list.displayname.Value); group.Authorization = SpecialNames.GetAutorization(group.Name); if (group.Authorization == Authorization.UnKnown) { group.Authorization = Authorization.Allowed; // FIXME } return group; }
/* oma_buddylist (not explicitly used in RCS) * -->rcs * -->oma_pocbuddylist * -->list-c * -->list-d * oma_grantedcontacts * -->rcs * -->oma_buddylist * oma_blockedcontacts * -->rcs_blockedcontacts * -->rcs_revokedcontacts * rcs * -->me (RCS 2) * -->Default * -->list-a * -->list-b */ private listType[] GetRCSLists() { listType[] rcsLists; // Do not cache rcsLists = new listType[3] { new listType(), new listType(), new listType() }; /*== rcs ==*/ rcsLists[0].displayname = new displaynameType(); rcsLists[0].name = SpecialNames.SHARED_RCS; rcsLists[0].displayname.Value = "All Contacts"; rcsLists[0].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_DOUBANGO)); /* rcs 2: The RCS presentity is always part of this list, refer to § 11.4 */ entryType me = new entryType(); me.uri = this.xcapStack.XUI; rcsLists[0].EntryTypes.Add(me); /*== rcs_blockedcontacts ==*/ rcsLists[1].displayname = new displaynameType(); rcsLists[1].name = SpecialNames.SHARED_RCS_BLOCKEDCONTACTS; rcsLists[1].displayname.Value = "Blocked Contacts"; /*== rcs_revokedcontacts ==*/ rcsLists[2].displayname = new displaynameType(); rcsLists[2].name = SpecialNames.SHARED_RCS_REVOKEDCONTACTS; rcsLists[2].displayname.Value = "Revoked Contacts"; return rcsLists; }
/* oma_buddylist (not explicitly used in RCS) * -->rcs * -->oma_pocbuddylist * -->list-c * -->list-d * oma_grantedcontacts * -->rcs * -->oma_buddylist * oma_blockedcontacts * -->rcs_blockedcontacts * -->rcs_revokedcontacts * rcs * -->Default * -->list-a * -->list-b */ private listType[] GetOMALists() { listType[] omaLists; // Do not cache omaLists = new listType[5] { new listType(), new listType(), new listType(), new listType(), new listType() }; /*== oma_allcontacts ==*/ omaLists[0] = new listType(); omaLists[0].displayname = new displaynameType(); omaLists[0].name = SpecialNames.SHARED_OMA_ALLCONTACTS; omaLists[0].displayname.Value = "OMA All Contacts"; /*== oma_blockedcontacts ==*/ omaLists[1] = new listType(); omaLists[1].displayname = new displaynameType(); omaLists[1].name = SpecialNames.SHARED_OMA_BLOCKEDCONTACTS; omaLists[1].displayname.Value = "OMA Blocked Contacts"; omaLists[1].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_RCS_BLOCKEDCONTACTS)); omaLists[1].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_RCS_REVOKEDCONTACTS)); /*== oma_buddylist ==*/ omaLists[2] = new listType(); omaLists[2].displayname = new displaynameType(); omaLists[2].name = SpecialNames.SHARED_OMA_BUDDYLIST; omaLists[2].displayname.Value = "OMA BuddyList"; omaLists[2].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_RCS)); omaLists[2].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_OMA_POCBUDDYLIST)); /*== oma_grantedcontacts ==*/ omaLists[3] = new listType(); omaLists[3].displayname = new displaynameType(); omaLists[3].name = SpecialNames.SHARED_OMA_GRANTEDCONTACTS; omaLists[3].displayname.Value = "OMA Granted Contacts"; omaLists[3].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_RCS)); omaLists[3].ExternalTypes.Add(this.GetResourceListAnchorAsExternalType(SpecialNames.SHARED_OMA_BUDDYLIST)); /*== oma_pocbuddylist ==*/ omaLists[4] = new listType(); omaLists[4].displayname = new displaynameType(); omaLists[4].name = SpecialNames.SHARED_OMA_POCBUDDYLIST; omaLists[4].displayname.Value = "OMA POC BuddyList"; return omaLists; }