Exemplo n.º 1
0
        // Token: 0x06001FFA RID: 8186 RVA: 0x000B9298 File Offset: 0x000B7498
        protected bool RenderADEmailAddress(IListViewDataSource dataSource, TextWriter writer)
        {
            string text = dataSource.GetItemProperty <SmtpAddress>(ADRecipientSchema.PrimarySmtpAddress, SmtpAddress.Empty).ToString();

            if (text.Length == 0)
            {
                return(false);
            }
            RecipientAddress.RecipientAddressFlags recipientAddressFlags = RecipientAddress.RecipientAddressFlags.None;
            RecipientDisplayType?itemProperty = dataSource.GetItemProperty <RecipientDisplayType?>(ADRecipientSchema.RecipientDisplayType, null);

            if (itemProperty == RecipientDisplayType.ConferenceRoomMailbox || itemProperty == RecipientDisplayType.SyncedConferenceRoomMailbox)
            {
                recipientAddressFlags |= RecipientAddress.RecipientAddressFlags.Room;
            }
            RecipientType itemProperty2 = dataSource.GetItemProperty <RecipientType>(ADRecipientSchema.RecipientType, RecipientType.Invalid);

            if (Utilities.IsADDistributionList(itemProperty2))
            {
                recipientAddressFlags |= RecipientAddress.RecipientAddressFlags.DistributionList;
            }
            string itemProperty3 = dataSource.GetItemProperty <string>(ADRecipientSchema.LegacyExchangeDN, string.Empty);
            ProxyAddressCollection itemProperty4 = dataSource.GetItemProperty <ProxyAddressCollection>(ADRecipientSchema.EmailAddresses, null);
            string sipUri            = InstantMessageUtilities.GetSipUri(itemProperty4);
            string mobilePhoneNumber = Utilities.NormalizePhoneNumber(dataSource.GetItemProperty <string>(ADOrgPersonSchema.MobilePhone, string.Empty));

            this.RenderSingleEmailAddress(writer, dataSource.GetItemProperty <string>(ADRecipientSchema.DisplayName, string.Empty), text, text, itemProperty3, EmailAddressIndex.None, recipientAddressFlags, null, sipUri, mobilePhoneNumber);
            return(true);
        }
Exemplo n.º 2
0
 // Token: 0x06001D78 RID: 7544 RVA: 0x000AA76C File Offset: 0x000A896C
 private string GetSipUri()
 {
     if (!this.IsContactView)
     {
         ProxyAddressCollection itemProperty = this.DataSource.GetItemProperty <ProxyAddressCollection>(ADRecipientSchema.EmailAddresses, null);
         return(InstantMessageUtilities.GetSipUri(itemProperty));
     }
     return(string.Empty);
 }
Exemplo n.º 3
0
        // Token: 0x06002A93 RID: 10899 RVA: 0x000EEB70 File Offset: 0x000ECD70
        protected void RenderJavascriptEncodedSipUri()
        {
            string text = null;

            if (base.UserContext.InstantMessagingType == InstantMessagingTypeOptions.Ocs)
            {
                text = InstantMessageUtilities.GetSipUri(base.ADRecipient.EmailAddresses);
            }
            Utilities.JavascriptEncode((text != null) ? text : string.Empty, base.Response.Output);
        }
        // Token: 0x06002E47 RID: 11847 RVA: 0x00108A00 File Offset: 0x00106C00
        private string GetSipUriFromLegacyDn(string legacyDn, string defaultSipUri)
        {
            IRecipientSession recipientSession = Utilities.CreateADRecipientSession(ConsistencyMode.IgnoreInvalid, base.OwaContext.UserContext);

            Result <ADRawEntry>[] array = recipientSession.FindByLegacyExchangeDNs(new string[]
            {
                legacyDn
            }, InstantMessageEventHandler.recipientQueryProperties);
            if (array == null || array.Length != 1)
            {
                return(defaultSipUri);
            }
            ADRawEntry data = array[0].Data;

            if (data == null)
            {
                return(defaultSipUri);
            }
            return(InstantMessageUtilities.GetSipUri((ProxyAddressCollection)data[ADRecipientSchema.EmailAddresses]));
        }
Exemplo n.º 5
0
        // Token: 0x06001D79 RID: 7545 RVA: 0x000AA7A0 File Offset: 0x000A89A0
        private string GetUri()
        {
            if (!this.IsContactView)
            {
                ProxyAddressCollection itemProperty = this.DataSource.GetItemProperty <ProxyAddressCollection>(ADRecipientSchema.EmailAddresses, null);
                string text = InstantMessageUtilities.GetSipUri(itemProperty);
                if (string.IsNullOrEmpty(text))
                {
                    text = InstantMessageUtilities.ToSipFormat(this.DataSource.GetItemProperty <SmtpAddress>(ADRecipientSchema.PrimarySmtpAddress, SmtpAddress.Empty).ToString());
                }
                return(text);
            }
            string itemProperty2 = this.DataSource.GetItemProperty <string>(ContactSchema.IMAddress, string.Empty);

            if (!string.IsNullOrEmpty(itemProperty2))
            {
                return(InstantMessageUtilities.ToSipFormat(itemProperty2));
            }
            Participant itemProperty3 = this.DataSource.GetItemProperty <Participant>(ContactSchema.Email1, null);

            if (itemProperty3 != null && !string.IsNullOrEmpty(itemProperty3.EmailAddress))
            {
                return(InstantMessageUtilities.ToSipFormat(itemProperty3.EmailAddress));
            }
            itemProperty3 = this.DataSource.GetItemProperty <Participant>(ContactSchema.Email2, null);
            if (itemProperty3 != null && !string.IsNullOrEmpty(itemProperty3.EmailAddress))
            {
                return(InstantMessageUtilities.ToSipFormat(itemProperty3.EmailAddress));
            }
            itemProperty3 = this.DataSource.GetItemProperty <Participant>(ContactSchema.Email3, null);
            if (itemProperty3 != null && !string.IsNullOrEmpty(itemProperty3.EmailAddress))
            {
                return(InstantMessageUtilities.ToSipFormat(itemProperty3.EmailAddress));
            }
            return(string.Empty);
        }
Exemplo n.º 6
0
        // Token: 0x06001D72 RID: 7538 RVA: 0x000AA454 File Offset: 0x000A8654
        private bool RenderMobileRecipient(TextWriter writer, string displayString)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            string itemProperty = this.DataSource.GetItemProperty <string>(this.IsContactView ? ContactSchema.MobilePhone : ADOrgPersonSchema.MobilePhone, null);
            string text         = Utilities.NormalizePhoneNumber(itemProperty);

            if (string.IsNullOrEmpty(text))
            {
                return(false);
            }
            string itemProperty2 = this.DataSource.GetItemProperty <string>(this.isContactView ? ContactBaseSchema.FileAs : ADRecipientSchema.DisplayName, string.Empty);
            string sipUri        = null;

            if (!this.isContactView)
            {
                ProxyAddressCollection itemProperty3 = this.DataSource.GetItemProperty <ProxyAddressCollection>(ADRecipientSchema.EmailAddresses, null);
                sipUri = InstantMessageUtilities.GetSipUri(itemProperty3);
            }
            base.RenderSingleEmailAddress(writer, itemProperty2, text, displayString ?? itemProperty, null, EmailAddressIndex.None, RecipientAddress.RecipientAddressFlags.None, "MOBILE", sipUri, text);
            return(true);
        }
        public void ExpandDistributionList()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "RecipientWellEventHandler.ExpandDistributionList");
            RecipientInfo[]    array = (RecipientInfo[])base.GetParameter("Recips");
            List <Participant> list  = new List <Participant>();

            foreach (RecipientInfo recipientInfo in array)
            {
                if (recipientInfo.StoreObjectId == null || !Utilities.IsMapiPDL(recipientInfo.RoutingType))
                {
                    throw new OwaEventHandlerException("The requested recipient is not personal distribution list");
                }
                list.AddRange(DistributionList.ExpandDeep(base.UserContext.MailboxSession, recipientInfo.StoreObjectId));
            }
            using (List <Participant> .Enumerator enumerator = list.GetEnumerator())
            {
                AdRecipientBatchQuery adRecipientBatchQuery = new AdRecipientBatchQuery(enumerator, base.UserContext);
                bool flag = false;
                foreach (Participant participant in list)
                {
                    string            smtpAddress       = null;
                    string            sipUri            = null;
                    ADObjectId        adObjectId        = null;
                    StoreObjectId     storeObjectId     = null;
                    EmailAddressIndex emailAddressIndex = EmailAddressIndex.None;
                    string            mobilePhoneNumber = null;
                    if (participant.RoutingType == "EX")
                    {
                        ADRecipient adRecipient = adRecipientBatchQuery.GetAdRecipient(participant.EmailAddress);
                        if (adRecipient != null)
                        {
                            smtpAddress       = adRecipient.PrimarySmtpAddress.ToString();
                            adObjectId        = adRecipient.Id;
                            sipUri            = InstantMessageUtilities.GetSipUri((ProxyAddressCollection)adRecipient[ADRecipientSchema.EmailAddresses]);
                            mobilePhoneNumber = Utilities.NormalizePhoneNumber((string)adRecipient[ADOrgPersonSchema.MobilePhone]);
                        }
                    }
                    else
                    {
                        smtpAddress = participant.EmailAddress;
                        sipUri      = participant.EmailAddress;
                    }
                    RecipientAddress.RecipientAddressFlags recipientAddressFlags = RecipientAddress.RecipientAddressFlags.None;
                    if (participant.GetValueOrDefault <bool>(ParticipantSchema.IsDistributionList))
                    {
                        recipientAddressFlags |= RecipientAddress.RecipientAddressFlags.DistributionList;
                    }
                    else if (participant.GetValueOrDefault <bool>(ParticipantSchema.IsRoom))
                    {
                        recipientAddressFlags |= RecipientAddress.RecipientAddressFlags.Room;
                    }
                    StoreParticipantOrigin storeParticipantOrigin = participant.Origin as StoreParticipantOrigin;
                    if (storeParticipantOrigin != null)
                    {
                        storeObjectId     = storeParticipantOrigin.OriginItemId;
                        emailAddressIndex = storeParticipantOrigin.EmailAddressIndex;
                    }
                    RecipientWellNode.Render(this.Writer, base.UserContext, participant.DisplayName, smtpAddress, participant.EmailAddress, participant.RoutingType, participant.GetValueOrDefault <string>(ParticipantSchema.Alias), RecipientAddress.ToAddressOrigin(participant), (int)recipientAddressFlags, storeObjectId, emailAddressIndex, adObjectId, flag ? RecipientWellNode.RenderFlags.RenderCommas : RecipientWellNode.RenderFlags.None, sipUri, mobilePhoneNumber);
                    flag = true;
                }
            }
        }
Exemplo n.º 8
0
        internal override void RenderContents(TextWriter writer, UserContext userContext, RecipientWellType type, RecipientWellNode.RenderFlags flags, RenderRecipientWellNode wellNode)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            if (!this.HasRecipients(type))
            {
                return;
            }
            IEnumerator <Participant> recipientsCollection = this.GetRecipientsCollection(type);

            RecipientWellNode.RenderFlags renderFlags = flags & ~RecipientWellNode.RenderFlags.RenderCommas;
            bool flag  = true;
            bool flag2 = userContext.IsInstantMessageEnabled();

            Result <ADRawEntry>[] array = null;
            int num = 0;

            while (recipientsCollection.MoveNext())
            {
                Participant participant       = recipientsCollection.Current;
                string      smtpAddress       = null;
                string      alias             = null;
                string      text              = null;
                int         num2              = 0;
                ADObjectId  adObjectId        = null;
                string      mobilePhoneNumber = null;
                if (participant.RoutingType == "EX" && !string.IsNullOrEmpty(participant.EmailAddress))
                {
                    bool flag3 = (flags & RecipientWellNode.RenderFlags.ReadOnly) != RecipientWellNode.RenderFlags.None;
                    if (flag3)
                    {
                        alias = Utilities.GetParticipantProperty <string>(participant, ParticipantSchema.Alias, null);
                    }
                    bool participantProperty = Utilities.GetParticipantProperty <bool>(participant, ParticipantSchema.IsDistributionList, false);
                    if (participantProperty)
                    {
                        num2 |= 1;
                    }
                    bool participantProperty2 = Utilities.GetParticipantProperty <bool>(participant, ParticipantSchema.IsRoom, false);
                    if (participantProperty2)
                    {
                        num2 |= 2;
                    }
                    smtpAddress = Utilities.GetParticipantProperty <string>(participant, ParticipantSchema.SmtpAddress, null);
                    if (flag2 && !participantProperty && !participantProperty2)
                    {
                        text = Utilities.GetParticipantProperty <string>(participant, ParticipantSchema.SipUri, null);
                        if (text == null || text.Trim().Length == 0)
                        {
                            if (array == null)
                            {
                                array = AdRecipientBatchQuery.FindAdResultsByLegacyExchangeDNs(this.GetRecipientsCollection(type), userContext);
                            }
                            ADRawEntry data = array[num].Data;
                            if (data != null)
                            {
                                adObjectId = (ADObjectId)data[ADObjectSchema.Id];
                                text       = InstantMessageUtilities.GetSipUri((ProxyAddressCollection)data[ADRecipientSchema.EmailAddresses]);
                                if (text != null && text.Trim().Length == 0)
                                {
                                    text = null;
                                }
                            }
                        }
                    }
                    if (userContext.IsSmsEnabled)
                    {
                        if (array == null)
                        {
                            array = AdRecipientBatchQuery.FindAdResultsByLegacyExchangeDNs(this.GetRecipientsCollection(type), userContext);
                        }
                        ADRawEntry data2 = array[num].Data;
                        if (data2 != null)
                        {
                            mobilePhoneNumber = (string)data2[ADOrgPersonSchema.MobilePhone];
                        }
                    }
                    num++;
                }
                else if (participant.RoutingType == "SMTP")
                {
                    smtpAddress = participant.EmailAddress;
                    if (flag2)
                    {
                        text = participant.EmailAddress;
                    }
                }
                else if (string.CompareOrdinal(participant.RoutingType, "MAPIPDL") == 0)
                {
                    num2 |= 1;
                }
                StoreObjectId          storeObjectId          = null;
                EmailAddressIndex      emailAddressIndex      = EmailAddressIndex.None;
                StoreParticipantOrigin storeParticipantOrigin = participant.Origin as StoreParticipantOrigin;
                if (storeParticipantOrigin != null && storeParticipantOrigin.OriginItemId != null)
                {
                    storeObjectId     = storeParticipantOrigin.OriginItemId;
                    emailAddressIndex = storeParticipantOrigin.EmailAddressIndex;
                }
                if (wellNode(writer, userContext, participant.DisplayName, smtpAddress, participant.EmailAddress, participant.RoutingType, alias, RecipientAddress.ToAddressOrigin(participant), num2, storeObjectId, emailAddressIndex, adObjectId, renderFlags, text, mobilePhoneNumber) && flag)
                {
                    flag = false;
                    if ((flags & RecipientWellNode.RenderFlags.RenderCommas) != RecipientWellNode.RenderFlags.None)
                    {
                        renderFlags |= RecipientWellNode.RenderFlags.RenderCommas;
                    }
                }
            }
        }