Ejemplo n.º 1
0
        // Token: 0x06001AB5 RID: 6837 RVA: 0x00064C58 File Offset: 0x00062E58
        private List <BodyContentAttributedValue> GetNotesFromStore(PersonId personId)
        {
            StoreSession session = base.CallContext.SessionCache.GetMailboxIdentityMailboxSession();
            StoreId      storeId = null;

            if (this.folderId != null && this.folderId.BaseFolderId != null)
            {
                IdAndSession idAndSession = base.GetIdAndSession(this.folderId.BaseFolderId);
                if (idAndSession.Session.IsPublicFolderSession)
                {
                    session = idAndSession.Session;
                    storeId = idAndSession.Id;
                }
            }
            Person person = Person.LoadNotes(session, personId, this.maxBytesToFetch, storeId);
            List <BodyContentAttributedValue> list = new List <BodyContentAttributedValue>();

            if (person != null && person.Bodies != null)
            {
                foreach (AttributedValue <PersonNotes> attributedValue in person.Bodies)
                {
                    if (attributedValue.Value != null)
                    {
                        BodyContentAttributedValue item = new BodyContentAttributedValue(new BodyContentType
                        {
                            BodyType    = BodyType.Text,
                            Value       = attributedValue.Value.NotesBody,
                            IsTruncated = attributedValue.Value.IsTruncated
                        }, attributedValue.Attributions);
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
Ejemplo n.º 2
0
        // Token: 0x06001AB6 RID: 6838 RVA: 0x00064D7C File Offset: 0x00062F7C
        private List <BodyContentAttributedValue> GetNotesFromActiveDirectory(ADObjectId adObjectId)
        {
            PersonId personId = this.IsAdPersonLinkedInMailbox(adObjectId);

            if (personId != null)
            {
                return(this.GetNotesFromStore(personId));
            }
            ADRecipient adrecipient = this.adRecipientSession.FindByObjectGuid(adObjectId.ObjectGuid);
            List <BodyContentAttributedValue> list = new List <BodyContentAttributedValue>();

            if (adrecipient != null)
            {
                IADOrgPerson iadorgPerson = adrecipient as IADOrgPerson;
                if (iadorgPerson != null && !string.IsNullOrWhiteSpace(iadorgPerson.Notes))
                {
                    BodyContentType bodyContentType = new BodyContentType();
                    bodyContentType.BodyType = BodyType.Text;
                    if (iadorgPerson.Notes.Length > this.maxBytesToFetch)
                    {
                        bodyContentType.Value       = iadorgPerson.Notes.Substring(0, this.maxBytesToFetch);
                        bodyContentType.IsTruncated = true;
                    }
                    else
                    {
                        bodyContentType.Value       = iadorgPerson.Notes;
                        bodyContentType.IsTruncated = false;
                    }
                    BodyContentAttributedValue item = new BodyContentAttributedValue(bodyContentType, new string[]
                    {
                        WellKnownNetworkNames.GAL
                    });
                    list.Add(item);
                }
            }
            return(list);
        }