예제 #1
0
        private static uint EmailAddressIndexToIndex(EmailAddressIndex emailAddressIndex)
        {
            switch (emailAddressIndex)
            {
            case EmailAddressIndex.None:
                return(255U);

            case EmailAddressIndex.Email1:
                return(0U);

            case EmailAddressIndex.Email2:
                return(1U);

            case EmailAddressIndex.Email3:
                return(2U);

            case EmailAddressIndex.BusinessFax:
                return(3U);

            case EmailAddressIndex.HomeFax:
                return(4U);

            case EmailAddressIndex.OtherFax:
                return(5U);

            default:
                throw new ArgumentException();
            }
        }
예제 #2
0
 internal ContactFaxSlotParticipantProperty(EmailAddressIndex emailAddressIndex, NativeStorePropertyDefinition displayNamePropertyDefinition, NativeStorePropertyDefinition emailAddressPropertyDefinition, NativeStorePropertyDefinition routingTypePropertyDefinition, NativeStorePropertyDefinition entryIdPropertyDefinition, NativeStorePropertyDefinition faxPropDef) : base(emailAddressIndex, displayNamePropertyDefinition, emailAddressPropertyDefinition, routingTypePropertyDefinition, entryIdPropertyDefinition, null, new PropertyDependency[]
 {
     new PropertyDependency(faxPropDef, PropertyDependencyType.AllRead)
 })
 {
     this.faxPropDef = faxPropDef;
 }
예제 #3
0
        private static ParticipantEntryId.WabEntryFlag ToWabEntryFlag(EmailAddressIndex emailAddressIndex, bool isMapiPDL)
        {
            switch (emailAddressIndex)
            {
            case EmailAddressIndex.None:
                return((ParticipantEntryId.WabEntryFlag)((isMapiPDL ? 4 : 3) | 48));

            case EmailAddressIndex.Email1:
                return((ParticipantEntryId.WabEntryFlag) 67);

            case EmailAddressIndex.Email2:
                return((ParticipantEntryId.WabEntryFlag) 83);

            case EmailAddressIndex.Email3:
                return((ParticipantEntryId.WabEntryFlag) 99);

            case EmailAddressIndex.BusinessFax:
                return(ParticipantEntryId.WabEntryFlag.ContactPerson);

            case EmailAddressIndex.HomeFax:
                return((ParticipantEntryId.WabEntryFlag) 19);

            case EmailAddressIndex.OtherFax:
                return((ParticipantEntryId.WabEntryFlag) 35);

            default:
                throw new ArgumentException();
            }
        }
예제 #4
0
        private string GetContactPropertyStringValue(ContactPropertyInfo property)
        {
            string result = string.Empty;

            if (this.Contact == null)
            {
                return(result);
            }
            string result2 = null;
            string result3 = null;

            if (property == ContactUtilities.Email1EmailAddress || property == ContactUtilities.Email2EmailAddress || property == ContactUtilities.Email3EmailAddress)
            {
                EmailAddressIndex emailPropertyIndex = ContactUtilities.GetEmailPropertyIndex(property);
                ContactUtilities.GetContactEmailAddress(this.Contact, emailPropertyIndex, out result2, out result3);
                return(result2);
            }
            if (property == ContactUtilities.Email1DisplayName || property == ContactUtilities.Email2DisplayName || property == ContactUtilities.Email3DisplayName)
            {
                EmailAddressIndex emailPropertyIndex2 = ContactUtilities.GetEmailPropertyIndex(property);
                ContactUtilities.GetContactEmailAddress(this.Contact, emailPropertyIndex2, out result2, out result3);
                return(result3);
            }
            string text = this.Contact.TryGetProperty(property.PropertyDefinition) as string;

            if (text != null)
            {
                result = text;
            }
            return(result);
        }
 internal ContactEmailSlotParticipantProperty(EmailAddressIndex emailAddressIndex, NativeStorePropertyDefinition displayNamePropertyDefinition, NativeStorePropertyDefinition emailAddressPropertyDefinition, NativeStorePropertyDefinition routingTypePropertyDefinition, NativeStorePropertyDefinition entryIdPropertyDefinition, NativeStorePropertyDefinition emailAddressForDisplayPropertyDefinition, params PropertyDependency[] additionalDependencies) : base("Contact" + emailAddressIndex.ToString(), ParticipantEntryIdConsumer.ContactEmailSlot, displayNamePropertyDefinition, emailAddressPropertyDefinition, routingTypePropertyDefinition, entryIdPropertyDefinition, null, null, null, null, EmbeddedParticipantProperty.GetDependencies(additionalDependencies, new NativeStorePropertyDefinition[]
 {
     InternalSchema.EntryId,
     emailAddressForDisplayPropertyDefinition
 }))
 {
     this.emailAddressForDisplayPropDef = emailAddressForDisplayPropertyDefinition;
     this.emailAddressIndex             = emailAddressIndex;
 }
예제 #6
0
        // Token: 0x06002DA3 RID: 11683 RVA: 0x001023F4 File Offset: 0x001005F4
        private void SetEmailPropertyValue(Contact contact, ContactPropertyInfo propertyInfo)
        {
            ContactPropertyInfo emailDisplayAsProperty = ContactUtilities.GetEmailDisplayAsProperty(propertyInfo);
            EmailAddressIndex   emailPropertyIndex     = ContactUtilities.GetEmailPropertyIndex(propertyInfo);
            string email       = (string)base.GetParameter(propertyInfo.Id);
            string displayName = (string)base.GetParameter(emailDisplayAsProperty.Id);

            ContactUtilities.SetContactEmailAddress(contact, emailPropertyIndex, email, displayName);
        }
예제 #7
0
 public StoreParticipantOrigin(StoreId originItemId, EmailAddressIndex emailAddressIndex)
 {
     EnumValidator.ThrowIfInvalid <EmailAddressIndex>(emailAddressIndex);
     if (originItemId == null)
     {
         throw new ArgumentNullException("originItemId");
     }
     this.originItemId      = StoreId.GetStoreObjectId(originItemId);
     this.emailAddressIndex = emailAddressIndex;
 }
예제 #8
0
        // Token: 0x060027E9 RID: 10217 RVA: 0x000E1F70 File Offset: 0x000E0170
        private void GetEmailAddressValue(ContactPropertyInfo propertyInfo, out string displayName, out string email)
        {
            displayName = string.Empty;
            email       = string.Empty;
            if (base.Item == null)
            {
                return;
            }
            EmailAddressIndex emailPropertyIndex = ContactUtilities.GetEmailPropertyIndex(propertyInfo);

            ContactUtilities.GetContactEmailAddress(this.contact, emailPropertyIndex, out email, out displayName);
        }
예제 #9
0
 private StoreParticipantEntryId(StoreObjectId itemId, bool isMapiPDL, EmailAddressIndex emailIndex, bool useWabFormat)
 {
     EnumValidator.AssertValid <EmailAddressIndex>(emailIndex);
     using (ParticipantEntryId.Reader reader = new ParticipantEntryId.Reader(itemId.ProviderLevelItemId))
     {
         this.ltEntryId = reader.ReadLTEntryId();
         reader.EnsureEnd();
     }
     this.isMapiPDL         = isMapiPDL;
     this.emailAddressIndex = emailIndex;
     this.useWabFormat      = useWabFormat;
 }
예제 #10
0
        private void SetEmail(ContactPropertyInfo propertyInfo)
        {
            ContactPropertyInfo emailDisplayAsProperty = ContactUtilities.GetEmailDisplayAsProperty(propertyInfo);
            string            text  = this.GetFormParameterStringValue(propertyInfo.Id);
            string            text2 = this.GetFormParameterStringValue(emailDisplayAsProperty.Id);
            EmailAddressIndex emailPropertyIndex = ContactUtilities.GetEmailPropertyIndex(propertyInfo);

            if (Utilities.WhiteSpaceOnlyOrNullEmpty(text))
            {
                text = null;
            }
            if (Utilities.WhiteSpaceOnlyOrNullEmpty(text2))
            {
                text2 = null;
            }
            ContactUtilities.SetContactEmailAddress(this.Contact, emailPropertyIndex, text, text2);
        }
예제 #11
0
        private void OnBeforeSaveUpdateInteropValues()
        {
            this.OnBeforeSaveUpdateFaxParticipant(ContactSchema.WorkFax, EmailAddressIndex.BusinessFax);
            this.OnBeforeSaveUpdateFaxParticipant(ContactSchema.HomeFax, EmailAddressIndex.HomeFax);
            this.OnBeforeSaveUpdateFaxParticipant(ContactSchema.OtherFax, EmailAddressIndex.OtherFax);
            EmailListType emailListType = EmailListType.None;
            List <int>    list          = new List <int>(6);

            EmailAddressIndex[] array = new EmailAddressIndex[]
            {
                EmailAddressIndex.Email1,
                EmailAddressIndex.Email2,
                EmailAddressIndex.Email3,
                EmailAddressIndex.BusinessFax,
                EmailAddressIndex.HomeFax,
                EmailAddressIndex.OtherFax
            };
            int i   = 0;
            int num = 1;

            while (i < array.Length)
            {
                Participant participant = this.EmailAddresses[array[i]];
                if (participant != null && participant.RoutingType != null)
                {
                    emailListType |= (EmailListType)num;
                    list.Add(i);
                }
                i++;
                num <<= 1;
            }
            this[InternalSchema.EmailListType] = (int)emailListType;
            if (list.Count > 0)
            {
                this[InternalSchema.EmailList] = list.ToArray();
            }
            else
            {
                base.DeleteProperties(new PropertyDefinition[]
                {
                    InternalSchema.EmailList
                });
            }
            base.SetOrDeleteProperty(ContactSchema.LegacyWebPage, base.TryGetProperty(ContactSchema.BusinessHomePage));
        }
        internal static RecipientInfoCacheEntry ParseEntry(XmlReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            if (!string.Equals(reader.Name, "entry", StringComparison.OrdinalIgnoreCase))
            {
                throw new CorruptDataException(ServerStrings.InvalidTagName("entry", reader.Name));
            }
            string            text              = string.Empty;
            string            text2             = string.Empty;
            string            text3             = string.Empty;
            string            text4             = string.Empty;
            string            text5             = string.Empty;
            AddressOrigin     addressOrigin     = AddressOrigin.Unknown;
            string            text6             = string.Empty;
            short             num               = 0;
            long              num2              = 0L;
            short             num3              = 0;
            short             num4              = 0;
            int               num5              = 0;
            EmailAddressIndex emailAddressIndex = EmailAddressIndex.None;
            string            text7             = string.Empty;
            int               num6              = 0;
            string            text8             = string.Empty;

            try
            {
                if (reader.HasValue)
                {
                    throw new CorruptDataException(ServerStrings.ElementHasUnsupportedValue(reader.Name));
                }
                if (reader.HasAttributes)
                {
                    int i = 0;
                    while (i < reader.AttributeCount)
                    {
                        reader.MoveToAttribute(i);
                        string name;
                        if ((name = reader.Name) != null)
                        {
                            if (< PrivateImplementationDetails > { 495E4232 - B7DB - 45E0 - 83EB - 134F 7677B64F }.$$method0x6000f59 - 1 == null)
                            {
예제 #13
0
 private void OnBeforeSaveUpdateFaxParticipant(StorePropertyDefinition prop, EmailAddressIndex index)
 {
     if (base.IsNew || base.PropertyBag.IsPropertyDirty(prop))
     {
         string valueOrDefault = base.GetValueOrDefault <string>(prop);
         if (string.IsNullOrEmpty(valueOrDefault))
         {
             this.EmailAddresses.Remove(index);
             return;
         }
         Participant participant = this.EmailAddresses[index];
         if (participant == null || participant.EmailAddress != valueOrDefault || participant.RoutingType != "FAX")
         {
             string      valueOrDefault2 = base.GetValueOrDefault <string>(StoreObjectSchema.DisplayName);
             Participant value           = new Participant(valueOrDefault2, valueOrDefault, "FAX");
             this.EmailAddresses[index] = value;
         }
     }
 }
예제 #14
0
        public static ResolvedRecipientDetail[] ParseFromForm(HttpRequest request, string parameterName, bool isRequired)
        {
            string[] array = ResolvedRecipientDetail.SplitConcatStringsFromForm(request, parameterName, isRequired);
            if (array.Length % 8 != 0)
            {
                throw new OwaInvalidRequestException("Invalid account of resolved recipient details. Details received:" + string.Join("\n", array));
            }
            int num = array.Length / 8;
            List <ResolvedRecipientDetail> list = new List <ResolvedRecipientDetail>();

            for (int i = 0; i < num; i++)
            {
                int    num2  = i * 8;
                string text  = array[num2];
                string text2 = array[num2 + 1];
                string text3 = array[num2 + 2];
                string text4 = array[num2 + 3];
                string s     = array[num2 + 4];
                string s2    = array[num2 + 5];
                string text5 = array[num2 + 6];
                string s3    = array[num2 + 7];
                int    num3;
                if (!int.TryParse(s, out num3))
                {
                    throw new OwaInvalidRequestException("The addressOrigin should be a valid integerDetails received:" + string.Join("\n", array));
                }
                AddressOrigin addressOrigin = (AddressOrigin)num3;
                int           num4;
                if (!int.TryParse(s3, out num4))
                {
                    throw new OwaInvalidRequestException("The emailAddressIndex should be a valid integerDetails received:" + string.Join("\n", array));
                }
                EmailAddressIndex emailAddressIndex = (EmailAddressIndex)num4;
                int num5;
                if (!int.TryParse(s2, out num5))
                {
                    throw new OwaInvalidRequestException("The recipientFlags should be a valid integerDetails received:" + string.Join("\n", array));
                }
                ResolvedRecipientDetail item = new ResolvedRecipientDetail(text, text2, text3, text4, addressOrigin, num5, text5, emailAddressIndex);
                list.Add(item);
            }
            return(list.ToArray());
        }
예제 #15
0
        internal static void SetContactEmailAddress(Contact contact, EmailAddressIndex emailIndex, string email, string displayName)
        {
            if (Utilities.WhiteSpaceOnlyOrNullEmpty(email))
            {
                email = null;
            }
            if (Utilities.WhiteSpaceOnlyOrNullEmpty(displayName))
            {
                displayName = null;
            }
            Participant copyFrom = contact.EmailAddresses[emailIndex];
            string      strB     = null;
            string      text     = null;

            ContactUtilities.GetContactEmailAddress(contact, emailIndex, out strB, out text);
            Participant.Builder builder;
            if (email != null && string.CompareOrdinal(email, strB) == 0)
            {
                builder = new Participant.Builder(copyFrom);
            }
            else if (email != null)
            {
                builder = new Participant.Builder(Participant.Parse(email));
                if (builder.RoutingType == null)
                {
                    builder[ParticipantSchema.EmailAddressForDisplay] = email;
                }
            }
            else
            {
                builder = new Participant.Builder();
            }
            builder.DisplayName = displayName;
            Participant value = builder.ToParticipant();

            contact.EmailAddresses[emailIndex] = value;
        }
예제 #16
0
 // Token: 0x06002523 RID: 9507 RVA: 0x000D6DDC File Offset: 0x000D4FDC
 internal new static bool Render(TextWriter writer, UserContext userContext, string displayName, string smtpAddress, string routingAddress, string routingType, string alias, AddressOrigin addressOrigin, int recipientFlags, StoreObjectId storeObjectId, EmailAddressIndex emailAddressIndex, ADObjectId adObjectId, RecipientWellNode.RenderFlags flags, string sipUri, string mobilePhoneNumber)
 {
     if (writer == null)
     {
         throw new ArgumentNullException("writer");
     }
     if (string.IsNullOrEmpty(routingAddress) || string.IsNullOrEmpty(routingType))
     {
         if (string.IsNullOrEmpty(displayName))
         {
             ExTraceGlobals.CoreTracer.TraceDebug(0L, "Found recipient without an email address or display name");
             return(false);
         }
         routingAddress = null;
         smtpAddress    = null;
         routingType    = null;
     }
     else if (string.IsNullOrEmpty(displayName))
     {
         if (!string.IsNullOrEmpty(smtpAddress))
         {
             displayName = smtpAddress;
         }
         else if (!string.IsNullOrEmpty(routingAddress))
         {
             displayName = routingAddress;
         }
     }
     if ((flags & RecipientWellNode.RenderFlags.RenderCommas) != RecipientWellNode.RenderFlags.None)
     {
         writer.Write("; ");
     }
     if (displayName != null)
     {
         Utilities.HtmlEncode(displayName.Trim(new char[]
         {
             '\''
         }), writer);
     }
     RecipientWellNode.RenderFormattedAddress(writer, userContext, displayName, smtpAddress, routingAddress, routingType);
     return(true);
 }
예제 #17
0
 private void OnEmailAddressChanged(EmailAddressIndex emailAddressIndex)
 {
     base.SetOrDeleteProperty(ContactEmailSlotParticipantProperty.AllInstances[emailAddressIndex], this.emailAddresses[emailAddressIndex]);
 }
예제 #18
0
 internal static void GetContactEmailAddress(Contact contact, EmailAddressIndex emailIndex, out string email, out string displayName)
 {
     ContactUtilities.GetContactEmailAddress(contact, emailIndex, out email, out displayName, true);
 }
예제 #19
0
        internal static void GetContactEmailAddress(Contact contact, EmailAddressIndex emailIndex, out string email, out string displayName, bool appendRoutingType)
        {
            Participant participant = contact.EmailAddresses[emailIndex];

            ContactUtilities.GetParticipantEmailAddress(participant, out email, out displayName, appendRoutingType);
        }
예제 #20
0
        // Token: 0x06002AD3 RID: 10963 RVA: 0x000F1110 File Offset: 0x000EF310
        private void RenderMemberEmailLink(string routingAddress, string displayName, string smtpAddress, string routingType, AddressOrigin addressOrigin, StoreObjectId storeObjectId, EmailAddressIndex emailAddressIndex)
        {
            StringBuilder stringBuilder = new StringBuilder("openItm(\"?ae=Item&t=IPM.Note&a=New&to=");

            stringBuilder.Append(Utilities.JavascriptEncode(Utilities.HtmlEncode(Utilities.UrlEncode(routingAddress))));
            stringBuilder.Append("&nm=");
            stringBuilder.Append(Utilities.JavascriptEncode(Utilities.HtmlEncode(Utilities.UrlEncode(displayName))));
            stringBuilder.Append("&rt=");
            stringBuilder.Append(Utilities.JavascriptEncode(Utilities.HtmlEncode(Utilities.UrlEncode(routingType))));
            if (addressOrigin != AddressOrigin.Unknown)
            {
                stringBuilder.Append("&ao=");
                stringBuilder.Append((int)addressOrigin);
            }
            if (storeObjectId != null)
            {
                stringBuilder.Append("&stId=");
                stringBuilder.Append(Utilities.JavascriptEncode(Utilities.HtmlEncode(Utilities.UrlEncode(storeObjectId.ToBase64String()))));
                if (!Utilities.IsMapiPDL(routingType))
                {
                    stringBuilder.Append("&ei=");
                    stringBuilder.Append((int)emailAddressIndex);
                }
            }
            string text = smtpAddress ?? routingAddress;

            if (Utilities.IsCustomRoutingType(text, routingType))
            {
                text = string.Concat(new string[]
                {
                    "[",
                    routingType,
                    ": ",
                    text,
                    "]"
                });
            }
            stringBuilder.Append("\");");
            base.Response.Write("<a class=lnk ");
            Utilities.RenderScriptHandler(base.Response.Output, "onclick", stringBuilder.ToString());
            base.Response.Write(" title=\"");
            Utilities.HtmlEncode(text, base.Response.Output);
            base.Response.Write("\">");
            Utilities.HtmlEncode(text, base.Response.Output);
            base.Response.Write("</a>");
        }
        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;
                }
            }
        }
예제 #22
0
 // Token: 0x0600147C RID: 5244 RVA: 0x000765DE File Offset: 0x000747DE
 public XsoEmailProperty(EmailAddressIndex emailIndex) : base(null)
 {
     this.emailIndex = emailIndex;
 }
예제 #23
0
        // Token: 0x0600251F RID: 9503 RVA: 0x000D67BC File Offset: 0x000D49BC
        internal static bool Render(TextWriter writer, UserContext userContext, string displayName, string smtpAddress, string routingAddress, string routingType, string alias, AddressOrigin addressOrigin, int recipientFlags, StoreObjectId storeObjectId, EmailAddressIndex emailAddressIndex, ADObjectId adObjectId, RecipientWellNode.RenderFlags flags, string sipUri, string mobilePhoneNumber)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            if (string.CompareOrdinal(routingType, "SMTP") == 0 && ImceaAddress.IsImceaAddress(routingAddress) && Utilities.TryDecodeImceaAddress(routingAddress, ref routingType, ref routingAddress))
            {
                smtpAddress = null;
            }
            bool   flag  = (flags & RecipientWellNode.RenderFlags.ReadOnly) != RecipientWellNode.RenderFlags.None;
            bool   flag2 = false;
            string text  = "rwRR";

            if (string.CompareOrdinal(routingType, "MAPIPDL") != 0 && (string.IsNullOrEmpty(routingAddress) || string.IsNullOrEmpty(routingType)))
            {
                if (string.IsNullOrEmpty(displayName))
                {
                    ExTraceGlobals.MailDataTracer.TraceDebug(0L, "Found recipient without an email address or display name");
                    return(false);
                }
                text           = "rwUR";
                flag2          = true;
                routingAddress = null;
                smtpAddress    = null;
                routingType    = null;
            }
            else if (string.IsNullOrEmpty(displayName))
            {
                if (!string.IsNullOrEmpty(smtpAddress))
                {
                    displayName = smtpAddress;
                }
                else if (!string.IsNullOrEmpty(routingAddress))
                {
                    displayName = routingAddress;
                }
            }
            if (flag)
            {
                text = (flag2 ? "rwURO" : "rwRRO");
            }
            if ((recipientFlags & 1) != 0)
            {
                text += " rwDL";
            }
            if ((flags & RecipientWellNode.RenderFlags.RenderCommas) != RecipientWellNode.RenderFlags.None)
            {
                writer.Write(userContext.DirectionMark);
                writer.Write("; ");
            }
            if ((flags & RecipientWellNode.RenderFlags.RenderSkinnyHtml) != RecipientWellNode.RenderFlags.None)
            {
                if (!flag)
                {
                    writer.Write("<span>");
                }
                writer.Write("<span class=\"");
            }
            else if (flag)
            {
                writer.Write("<span id=\"spnR\" ");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "oncontextmenu", "onRwCm(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "ondblclick", "onDblClkReadRcp(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "onclick", "onClkRcp(event);");
                writer.Write(" class=\"");
            }
            else
            {
                writer.Write("<span tabindex=\"-1\" contenteditable=\"false\">");
                if (userContext.BrowserType == BrowserType.IE)
                {
                    writer.Write("<span tabindex=\"-1\" contenteditable=\"true\" id=\"spnR\" ");
                }
                else
                {
                    writer.Write("<span tabindex=\"-1\" contenteditable=\"false\" id=\"spnR\" ");
                }
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "oncontextmenu", "onContextMenuSpnRw(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "onclick", "onClkRcp(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "onkeydown", "onKDRcp(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "ondblclick", "onDblClkRcp(event);");
                writer.Write(" ondrop=\"return(false);\" class=\"");
            }
            writer.Write(text);
            writer.Write("\" _ao=\"{0}\" _rf=\"{1}\" _rt=\"", (int)addressOrigin, recipientFlags);
            if (routingType != null)
            {
                Utilities.SanitizeHtmlEncode(routingType, writer);
            }
            writer.Write("\" _em=\"");
            if (routingAddress != null)
            {
                Utilities.SanitizeHtmlEncode(routingAddress, writer);
            }
            if (storeObjectId != null)
            {
                writer.Write("\" _id=\"");
                Utilities.SanitizeHtmlEncode(storeObjectId.ToBase64String(), writer);
                writer.Write("\" _ei=\"");
                writer.Write((int)emailAddressIndex);
            }
            else if (adObjectId != null)
            {
                writer.Write("\" _id=\"");
                Utilities.SanitizeHtmlEncode(Convert.ToBase64String(adObjectId.ObjectGuid.ToByteArray()), writer);
            }
            writer.Write("\" title=\"");
            if (smtpAddress != null)
            {
                Utilities.SanitizeHtmlEncode(smtpAddress, writer);
            }
            if (!flag || addressOrigin == AddressOrigin.OneOff || (addressOrigin == AddressOrigin.Directory && !userContext.IsFeatureEnabled(Feature.GlobalAddressList)))
            {
                if (smtpAddress != null)
                {
                    writer.Write("\" _sa=\"");
                    Utilities.SanitizeHtmlEncode(smtpAddress, writer);
                }
                else if (routingType != null && routingAddress != null)
                {
                    writer.Write("\" _imcea=\"");
                    Utilities.SanitizeHtmlEncode(ImceaAddress.Encode(routingType, routingAddress, OwaConfigurationManager.Configuration.DefaultAcceptedDomain.DomainName.ToString()), writer);
                }
            }
            if (userContext.IsInstantMessageEnabled() && userContext.InstantMessagingType == InstantMessagingTypeOptions.Ocs && sipUri != null)
            {
                writer.Write("\" ");
                if (adObjectId == null)
                {
                    writer.Write("_sipTrsp=1 ");
                }
                writer.Write("_uri=\"");
                Utilities.SanitizeHtmlEncode(sipUri, writer);
            }
            if (userContext.IsSmsEnabled && mobilePhoneNumber != null)
            {
                writer.Write("\" _mo=\"");
                Utilities.SanitizeHtmlEncode(mobilePhoneNumber, writer);
            }
            if ((smtpAddress != null || routingAddress != null || mobilePhoneNumber != null || Utilities.IsMapiPDL(routingType)) && (!flag || addressOrigin == AddressOrigin.OneOff || (addressOrigin == AddressOrigin.Store && (!userContext.IsFeatureEnabled(Feature.Contacts) || userContext.IsSmsEnabled)) || (addressOrigin == AddressOrigin.Directory && (!userContext.IsFeatureEnabled(Feature.GlobalAddressList) || userContext.IsSmsEnabled))) && displayName != null)
            {
                writer.Write("\" _dn=\"");
                Utilities.SanitizeHtmlEncode(displayName, writer);
            }
            if (!flag && alias != null)
            {
                writer.Write("\" _al=\"");
                Utilities.SanitizeHtmlEncode(alias, writer);
            }
            writer.Write("\">");
            if (userContext.IsInstantMessageEnabled() && flag && !string.IsNullOrEmpty(routingType) && ((string.CompareOrdinal(routingType, "EX") == 0 && (recipientFlags & 1) == 0) || string.CompareOrdinal(routingType, "SMTP") == 0))
            {
                RenderingUtilities.RenderPresenceJellyBean(writer, userContext, true, "onRwCmJb(event);", false, null);
            }
            if (displayName != null)
            {
                Utilities.SanitizeHtmlEncode(displayName, writer);
            }
            RecipientWellNode.RenderFormattedAddress(writer, userContext, displayName, smtpAddress, routingAddress, routingType);
            writer.Write("</span>");
            if (!flag)
            {
                writer.Write("</span>");
            }
            return(true);
        }
예제 #24
0
 // Token: 0x06001FFF RID: 8191 RVA: 0x000B9750 File Offset: 0x000B7950
 private void RenderSingleEmailAddress(TextWriter writer, string displayName, string emailAddress, string emailAddressForDisplay, string legacyExchangeDN, EmailAddressIndex emailAddressIndex, RecipientAddress.RecipientAddressFlags recipientAddressFlags, string routingType)
 {
     this.RenderSingleEmailAddress(writer, displayName, emailAddress, emailAddressForDisplay, legacyExchangeDN, emailAddressIndex, recipientAddressFlags, routingType, null, null);
 }
예제 #25
0
        // Token: 0x06000B33 RID: 2867 RVA: 0x0004F58C File Offset: 0x0004D78C
        public static string GetSingleEmailAddress(IListViewDataSource dataSource, string displayName, string emailAddress, string emailAddressForDisplay, string legacyExchangeDN, EmailAddressIndex emailAddressIndex, RecipientAddress.RecipientAddressFlags recipientAddressFlags, string routingType, string sipUri, string mobilePhoneNumber, bool htmlEncodeEmailAddress)
        {
            StringBuilder stringBuilder = new StringBuilder();

            using (StringWriter stringWriter = new StringWriter(stringBuilder))
            {
                InstantMessageUtilities.RenderSingleEmailAddress(dataSource, stringWriter, displayName, emailAddress, emailAddressForDisplay, legacyExchangeDN, emailAddressIndex, recipientAddressFlags, routingType, sipUri, mobilePhoneNumber, htmlEncodeEmailAddress);
            }
            return(stringBuilder.ToString());
        }
예제 #26
0
 public void AddEntry(string displayName, string smtpAddress, string routingAddress, string alias, string routingType, AddressOrigin addressOrigin, int recipientFlags, string itemId, EmailAddressIndex emailAddressIndex, string sipUri, string mobilePhoneNumber)
 {
     if (!Utilities.IsMapiPDL(routingType) && string.IsNullOrEmpty(routingAddress))
     {
         return;
     }
     this.AddEntry(new RecipientInfoCacheEntry(displayName, smtpAddress, routingAddress, alias, routingType, addressOrigin, recipientFlags, itemId, emailAddressIndex, sipUri, mobilePhoneNumber));
 }
예제 #27
0
        // Token: 0x06000B32 RID: 2866 RVA: 0x0004F400 File Offset: 0x0004D600
        public static void RenderSingleEmailAddress(IListViewDataSource dataSource, TextWriter writer, string displayName, string emailAddress, string emailAddressForDisplay, string legacyExchangeDN, EmailAddressIndex emailAddressIndex, RecipientAddress.RecipientAddressFlags recipientAddressFlags, string routingType, string sipUri, string mobilePhoneNumber, bool htmlEncodeEmailAddress)
        {
            writer.Write("<span id=\"ea\"");
            if (dataSource is FolderListViewDataSource)
            {
                writer.Write(" aO=1");
            }
            else
            {
                writer.Write(" aO=2");
            }
            writer.Write(" dn=\"");
            if (htmlEncodeEmailAddress)
            {
                Utilities.HtmlEncode(displayName, writer);
            }
            else
            {
                writer.Write(displayName);
            }
            writer.Write("\" rf=");
            int num = (int)recipientAddressFlags;

            Utilities.HtmlEncode(num.ToString(CultureInfo.InvariantCulture), writer);
            writer.Write(" rt=\"");
            if (!string.IsNullOrEmpty(routingType))
            {
                writer.Write(routingType);
            }
            else if (!string.IsNullOrEmpty(legacyExchangeDN))
            {
                writer.Write("EX\" lgDn=\"");
                Utilities.HtmlEncode(legacyExchangeDN, writer);
            }
            else if (recipientAddressFlags == RecipientAddress.RecipientAddressFlags.DistributionList)
            {
                writer.Write("MAPIPDL");
            }
            else
            {
                writer.Write("SMTP");
            }
            writer.Write("\" em=\"");
            if (htmlEncodeEmailAddress)
            {
                Utilities.HtmlEncode(emailAddress, writer);
            }
            else
            {
                writer.Write(emailAddress);
            }
            writer.Write("\" ei=\"");
            int num2 = (int)emailAddressIndex;

            Utilities.HtmlEncode(num2.ToString(), writer);
            if (!string.IsNullOrEmpty(sipUri))
            {
                writer.Write("\" uri=\"");
                if (htmlEncodeEmailAddress)
                {
                    Utilities.HtmlEncode(sipUri, writer);
                }
                else
                {
                    writer.Write(sipUri);
                }
            }
            if (!string.IsNullOrEmpty(mobilePhoneNumber))
            {
                writer.Write("\" mo=\"");
                if (htmlEncodeEmailAddress)
                {
                    Utilities.HtmlEncode(mobilePhoneNumber, writer);
                }
                else
                {
                    writer.Write(mobilePhoneNumber);
                }
            }
            writer.Write("\">");
            if (htmlEncodeEmailAddress)
            {
                Utilities.HtmlEncode(emailAddressForDisplay, writer);
            }
            else
            {
                writer.Write(emailAddressForDisplay);
            }
            writer.Write("</span>");
        }
예제 #28
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;
                    }
                }
            }
        }
예제 #29
0
 // Token: 0x06000B34 RID: 2868 RVA: 0x0004F5E0 File Offset: 0x0004D7E0
 public static string GetSingleEmailAddress(IListViewDataSource dataSource, string displayName, string emailAddress, string emailAddressForDisplay, string legacyExchangeDN, EmailAddressIndex emailAddressIndex, RecipientAddress.RecipientAddressFlags recipientAddressFlags, string routingType, string sipUri, string mobilePhoneNumber)
 {
     return(InstantMessageUtilities.GetSingleEmailAddress(dataSource, displayName, emailAddress, emailAddressForDisplay, legacyExchangeDN, emailAddressIndex, recipientAddressFlags, routingType, sipUri, mobilePhoneNumber, true));
 }
예제 #30
0
        // Token: 0x06001FFD RID: 8189 RVA: 0x000B94D4 File Offset: 0x000B76D4
        private bool RenderEmailAddresses(TextWriter writer)
        {
            Dictionary <EmailAddressIndex, StorePropertyDefinition> dictionary  = new Dictionary <EmailAddressIndex, StorePropertyDefinition>();
            Dictionary <EmailAddressIndex, Participant>             dictionary2 = new Dictionary <EmailAddressIndex, Participant>();

            dictionary.Add(EmailAddressIndex.Email1, ContactSchema.Email1);
            dictionary.Add(EmailAddressIndex.Email2, ContactSchema.Email2);
            dictionary.Add(EmailAddressIndex.Email3, ContactSchema.Email3);
            dictionary.Add(EmailAddressIndex.BusinessFax, ContactSchema.ContactBusinessFax);
            dictionary.Add(EmailAddressIndex.HomeFax, ContactSchema.ContactHomeFax);
            dictionary.Add(EmailAddressIndex.OtherFax, ContactSchema.ContactOtherFax);
            EmailAddressIndex emailAddressIndex = EmailAddressIndex.None;

            foreach (KeyValuePair <EmailAddressIndex, StorePropertyDefinition> keyValuePair in dictionary)
            {
                Participant itemProperty = this.dataSource.GetItemProperty <Participant>(keyValuePair.Value, null);
                if (itemProperty != null && !string.IsNullOrEmpty(itemProperty.EmailAddress))
                {
                    emailAddressIndex = keyValuePair.Key;
                    dictionary2.Add(keyValuePair.Key, itemProperty);
                }
            }
            string text  = null;
            string text2 = null;
            string text3 = null;
            string text4 = null;

            if (dictionary2.Count > 1)
            {
                writer.Write("<select id=ea>");
                foreach (KeyValuePair <EmailAddressIndex, Participant> keyValuePair2 in dictionary2)
                {
                    Participant value = keyValuePair2.Value;
                    if (value != null && !string.IsNullOrEmpty(value.EmailAddress))
                    {
                        LegacyListViewContents.GetEmailAddressData(value, out text, out text2, out text3, out text4);
                        writer.Write("<option aO=1 dn=\"");
                        Utilities.HtmlEncode(text3, writer);
                        writer.Write("\" rt=\"");
                        if (string.IsNullOrEmpty(text4))
                        {
                            writer.Write("SMTP");
                        }
                        else
                        {
                            writer.Write(text4);
                        }
                        writer.Write("\" rf=\"");
                        writer.Write(0);
                        writer.Write("\" em=\"");
                        Utilities.HtmlEncode(text, writer);
                        writer.Write("\" ei=\"");
                        writer.Write((int)keyValuePair2.Key);
                        writer.Write("\">");
                        Utilities.HtmlEncode(text2, writer);
                        writer.Write("</option>");
                    }
                }
                writer.Write("</select>");
            }
            else
            {
                if (dictionary2.Count != 1)
                {
                    return(false);
                }
                Participant participant = dictionary2[emailAddressIndex];
                LegacyListViewContents.GetEmailAddressData(participant, out text, out text2, out text3, out text4);
                this.RenderSingleEmailAddress(writer, text3, text, text2, string.Empty, emailAddressIndex, RecipientAddress.RecipientAddressFlags.None, text4);
            }
            return(true);
        }