// Token: 0x06002FBF RID: 12223 RVA: 0x00115BA4 File Offset: 0x00113DA4
        public static void GeneratePrintMessageBody(Item item, TextWriter writer, OwaContext owaContext, bool isEmbeddedItem, string embeddedItemUrl, bool forceAllowWebBeacon, bool forceEnableItemLink)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("context");
            }
            UserContext           userContext = owaContext.UserContext;
            WebBeaconFilterLevels filterWebBeaconsAndHtmlForms = userContext.Configuration.FilterWebBeaconsAndHtmlForms;
            bool flag = JunkEmailUtilities.IsJunkOrPhishing(item, isEmbeddedItem, forceEnableItemLink, userContext);
            OwaSafeHtmlCallbackBase callBack;

            if (!flag)
            {
                if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.DisableFilter || forceAllowWebBeacon || (!Utilities.IsPublic(item) && Utilities.IsWebBeaconsAllowed(item)))
                {
                    callBack = new OwaSafeHtmlAllowWebBeaconCallbacks(item, userContext.IsPublicLogon, isEmbeddedItem, embeddedItemUrl, owaContext, false);
                }
                else
                {
                    callBack = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbeddedItem, embeddedItemUrl, false, owaContext, false);
                }
            }
            else
            {
                callBack = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbeddedItem, embeddedItemUrl, true, owaContext, false);
            }
            BodyConversionUtilities.RenderReadBody(writer, item, callBack, flag);
        }
        // Token: 0x0600061F RID: 1567 RVA: 0x000307CC File Offset: 0x0002E9CC
        public static IList <AttachmentLink> GenerateNonEditableMessageBodyAndRenderInfobarMessages(Item item, TextWriter writer, OwaContext owaContext, Infobar infobar, bool allowWebBeacon, bool forceEnableItemLink, string itemType, string action, string state, bool isEmbedded, string attachmentUrl)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (infobar == null)
            {
                throw new ArgumentNullException("infobar");
            }
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            UserContext           userContext = owaContext.UserContext;
            WebBeaconFilterLevels filterWebBeaconsAndHtmlForms = userContext.Configuration.FilterWebBeaconsAndHtmlForms;
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;
            bool flag4 = false;

            JunkEmailUtilities.GetJunkEmailPropertiesForItem(item, isEmbedded, forceEnableItemLink, userContext, out flag, out flag2, out flag3, out flag4);
            OwaSafeHtmlCallbackBase owaSafeHtmlCallbackBase;

            if (!flag4)
            {
                if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.DisableFilter || allowWebBeacon || Utilities.IsWebBeaconsAllowed(item))
                {
                    owaSafeHtmlCallbackBase = new OwaSafeHtmlAllowWebBeaconCallbacks(item, userContext.IsPublicLogon, isEmbedded, attachmentUrl, owaContext, false);
                }
                else
                {
                    owaSafeHtmlCallbackBase = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbedded, attachmentUrl, false, owaContext, false);
                }
            }
            else
            {
                owaSafeHtmlCallbackBase = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbedded, attachmentUrl, true, owaContext, false);
            }
            BodyConversionUtilities.RenderReadBody(writer, item, owaSafeHtmlCallbackBase, flag4);
            bool hasBlockedImages = owaSafeHtmlCallbackBase.HasBlockedImages;

            if (flag)
            {
                if (flag2)
                {
                    infobar.AddMessageText(LocalizedStrings.GetNonEncoded(1581910613) + " " + LocalizedStrings.GetNonEncoded(614784743), InfobarMessageType.Phishing);
                }
                else if (userContext.IsJunkEmailEnabled)
                {
                    infobar.AddMessageText(LocalizedStrings.GetNonEncoded(59853257) + " " + LocalizedStrings.GetNonEncoded(385373859), InfobarMessageType.JunkEmail);
                }
            }
            else if (flag2 && !flag3)
            {
                string s = string.Format(CultureInfo.InvariantCulture, "<a id=\"aIbBlk\" href=\"#\" onclick=\"return onClkBm('{0}', 1, 0)\">{1}</a> {2} ", new object[]
                {
                    itemType,
                    LocalizedStrings.GetHtmlEncoded(-672110188),
                    LocalizedStrings.GetHtmlEncoded(-1020475744)
                });
                string format = "<a href=\"#\" onClick=opnHlp('" + Utilities.JavascriptEncode(Utilities.BuildEhcHref(HelpIdsLight.EmailSafetyLight.ToString())) + "')>{0}</a>";
                string s2     = string.Format(CultureInfo.InvariantCulture, format, new object[]
                {
                    LocalizedStrings.GetHtmlEncoded(338562664)
                });
                infobar.AddMessageHtml(SanitizedHtmlString.Format("{0}{1}{2}", new object[]
                {
                    LocalizedStrings.GetNonEncoded(1581910613),
                    SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s),
                    SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s2)
                }), InfobarMessageType.Phishing);
            }
            else if (hasBlockedImages)
            {
                if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.UserFilterChoice)
                {
                    string s3 = string.Format(CultureInfo.InvariantCulture, "<a id=\"aIbBlk\" href=\"#\" onclick=\"return onClkBm('{0}', 1, 1);\">{1}</a>", new object[]
                    {
                        itemType,
                        LocalizedStrings.GetHtmlEncoded(469213884)
                    });
                    infobar.AddMessageHtml(SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(2063285740), new object[]
                    {
                        SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s3)
                    }), InfobarMessageType.Informational);
                }
                else if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.ForceFilter)
                {
                    infobar.AddMessageLocalized(-1196115124, InfobarMessageType.Informational);
                }
            }
            if (owaSafeHtmlCallbackBase.HasRtfEmbeddedImages)
            {
                infobar.AddMessageLocalized(1338319428, InfobarMessageType.Informational);
            }
            return(owaSafeHtmlCallbackBase.AttachmentLinks);
        }
        // Token: 0x06002FBB RID: 12219 RVA: 0x001156A4 File Offset: 0x001138A4
        public static IList <AttachmentLink> GenerateNonEditableMessageBodyAndRenderInfobarMessages(Item item, TextWriter writer, OwaContext owaContext, Infobar infobar, bool allowWebBeacon, bool forceEnableItemLink, string itemType, string action, string state, bool isEmbedded, string attachmentUrl)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (infobar == null)
            {
                throw new ArgumentNullException("infobar");
            }
            if (owaContext == null)
            {
                throw new ArgumentNullException("context");
            }
            UserContext           userContext = owaContext.UserContext;
            WebBeaconFilterLevels filterWebBeaconsAndHtmlForms = userContext.Configuration.FilterWebBeaconsAndHtmlForms;
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;
            bool flag4 = false;

            JunkEmailUtilities.GetJunkEmailPropertiesForItem(item, isEmbedded, forceEnableItemLink, userContext, out flag, out flag2, out flag3, out flag4);
            OwaSafeHtmlOutboundCallbacks owaSafeHtmlOutboundCallbacks;

            if (!flag4)
            {
                if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.DisableFilter || allowWebBeacon || (!Utilities.IsPublic(item) && Utilities.IsWebBeaconsAllowed(item)))
                {
                    owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlAllowWebBeaconCallbacks(item, userContext.IsPublicLogon, isEmbedded, attachmentUrl, owaContext, false);
                }
                else
                {
                    owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbedded, attachmentUrl, false, owaContext, false);
                }
            }
            else
            {
                owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbedded, attachmentUrl, true, owaContext, false);
            }
            BodyConversionUtilities.RenderReadBody(writer, item, owaSafeHtmlOutboundCallbacks, flag4, userContext.IsIrmEnabled);
            bool flag5 = owaSafeHtmlOutboundCallbacks.HasBlockedImages || owaSafeHtmlOutboundCallbacks.HasBlockedForms;

            if (flag)
            {
                if (flag2)
                {
                    infobar.AddMessage(SanitizedHtmlString.Format("{0} {1}", new object[]
                    {
                        LocalizedStrings.GetNonEncoded(1581910613),
                        LocalizedStrings.GetNonEncoded(-2026026928)
                    }), InfobarMessageType.Phishing);
                }
                else if (userContext.IsJunkEmailEnabled)
                {
                    infobar.AddMessage(SanitizedHtmlString.Format("{0} {1}", new object[]
                    {
                        LocalizedStrings.GetNonEncoded(59853257),
                        LocalizedStrings.GetNonEncoded(-2129859766)
                    }), InfobarMessageType.JunkEmail);
                }
            }
            else if (flag2 && !flag3)
            {
                string s = "<a id=\"aIbBlk\" href=\"#\"" + SanitizedHtmlString.Format("_sIT=\"{0}\" _sAct=\"{1}\" _iSt=\"{2}\" _fPhsh=1 _fAWB={3}", new object[]
                {
                    itemType,
                    action,
                    state,
                    allowWebBeacon ? 1 : 0
                }) + string.Format(CultureInfo.InvariantCulture, ">{0}</a> {1} ", new object[]
                {
                    LocalizedStrings.GetHtmlEncoded(-672110188),
                    LocalizedStrings.GetHtmlEncoded(-1020475744)
                });
                string s2 = string.Format(CultureInfo.InvariantCulture, "<a href=\"#\" " + Utilities.GetScriptHandler("onclick", "opnHlp(\"" + Utilities.JavascriptEncode(Utilities.BuildEhcHref(HelpIdsLight.EmailSafetyLight.ToString())) + "\");") + ">{0}</a>", new object[]
                {
                    LocalizedStrings.GetHtmlEncoded(338562664)
                });
                infobar.AddMessage(SanitizedHtmlString.Format("{0}{1}{2}", new object[]
                {
                    SanitizedHtmlString.FromStringId(1581910613),
                    SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s),
                    SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s2)
                }), InfobarMessageType.Phishing);
            }
            else if (flag5)
            {
                infobar.AddMessage(BodyConversionUtilities.GetWebBeaconBlockedInfobarMessage(filterWebBeaconsAndHtmlForms, SanitizedHtmlString.Format("_sIT=\"{0}\" _sAct=\"{1}\" _iSt=\"{2}\" _fPhsh={3} _fAWB=1", new object[]
                {
                    itemType,
                    action,
                    state,
                    forceEnableItemLink ? 1 : 0
                }).ToString()), InfobarMessageType.Informational);
            }
            if (owaSafeHtmlOutboundCallbacks.HasRtfEmbeddedImages)
            {
                infobar.AddMessage(1338319428, InfobarMessageType.Informational);
            }
            return(owaSafeHtmlOutboundCallbacks.AttachmentLinks);
        }
        // Token: 0x06002FBE RID: 12222 RVA: 0x00115A4C File Offset: 0x00113C4C
        public static bool GenerateEditableMessageBodyAndRenderInfobarMessages(Item item, TextWriter writer, NewItemType newItemType, OwaContext owaContext, ref bool shouldPromptUserOnFormLoad, ref bool hasInlineImages, Infobar infobar, bool allowWebBeacon, Markup markup)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (infobar == null)
            {
                throw new ArgumentNullException("infobar");
            }
            if (owaContext == null)
            {
                throw new ArgumentNullException("context");
            }
            UserContext userContext = owaContext.UserContext;
            OwaSafeHtmlOutboundCallbacks owaSafeHtmlOutboundCallbacks = null;
            WebBeaconFilterLevels        filterWebBeaconsAndHtmlForms = userContext.Configuration.FilterWebBeaconsAndHtmlForms;
            bool flag = false;

            if (item != null)
            {
                flag = JunkEmailUtilities.IsJunkOrPhishing(item, false, userContext);
                if (!flag)
                {
                    if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.DisableFilter || allowWebBeacon || (!Utilities.IsPublic(item) && Utilities.IsWebBeaconsAllowed(item)))
                    {
                        owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlAllowWebBeaconCallbacks(item, userContext.IsPublicLogon, owaContext, true);
                    }
                    else if (filterWebBeaconsAndHtmlForms != WebBeaconFilterLevels.DisableFilter && (newItemType == NewItemType.Reply || newItemType == NewItemType.Forward || newItemType == NewItemType.ExplicitDraft || newItemType == NewItemType.PostReply) && !allowWebBeacon)
                    {
                        owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlRemoveWebBeaconCallbacks(item, userContext.IsPublicLogon, owaContext, true);
                    }
                    else
                    {
                        owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, false, owaContext, true);
                    }
                }
                else
                {
                    owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, true, owaContext, true);
                }
            }
            if (flag)
            {
                markup = Markup.PlainText;
            }
            BodyConversionUtilities.RenderComposeBody(writer, item, owaSafeHtmlOutboundCallbacks, userContext, markup);
            if (owaSafeHtmlOutboundCallbacks != null)
            {
                hasInlineImages = owaSafeHtmlOutboundCallbacks.HasInlineImages;
            }
            if (item != null)
            {
                if (!flag && (owaSafeHtmlOutboundCallbacks.HasBlockedImages || owaSafeHtmlOutboundCallbacks.HasBlockedForms))
                {
                    if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.UserFilterChoice)
                    {
                        shouldPromptUserOnFormLoad = true;
                    }
                    else if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.ForceFilter)
                    {
                        infobar.AddMessage(SanitizedHtmlString.FromStringId(-1196115124), InfobarMessageType.Informational, "divIbImg");
                    }
                }
                if (owaSafeHtmlOutboundCallbacks.HasRtfEmbeddedImages)
                {
                    infobar.AddMessage(1338319428, InfobarMessageType.Informational);
                }
                if (!ObjectClass.IsCalendarItemCalendarItemOccurrenceOrRecurrenceException(item.ClassName))
                {
                    return(owaSafeHtmlOutboundCallbacks.ApplyAttachmentsUpdates(item));
                }
            }
            return(false);
        }