private Contact EntryToContact(entryType entry, String groupName) { Contact contact = new Contact(); contact.DisplayName = entry.displayname == null ? null : entry.displayname.Value; contact.UriString = entry.uri; contact.GroupName = groupName; return contact; }
private entryType ContactToEntry(Contact contact) { entryType entry = new entryType(); entry.uri = contact.UriString; entry.displayname = new entryTypeDisplayname(); entry.displayname.Value = contact.DisplayName; return entry; }
/* 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; }