// Token: 0x06002B10 RID: 11024 RVA: 0x000F23E2 File Offset: 0x000F05E2
 private void AddIrmMessageToInfobar()
 {
     if (base.UserContext.IsIrmEnabled && Utilities.IsIrmRestrictedAndDecrypted(this.Message))
     {
         InfobarMessageBuilder.AddIrmInformation(this.infobar, this.Message, base.IsPreviewForm, true, this.IrmItemHelper.IsRemoveAllowed, false);
     }
 }
Example #2
0
        // Token: 0x06002B6F RID: 11119 RVA: 0x000F3A30 File Offset: 0x000F1C30
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Message = base.Initialize <MessageItem>(new PropertyDefinition[]
            {
                MessageItemSchema.IsRead,
                BodySchema.Codepage,
                BodySchema.InternetCpid,
                MessageItemSchema.MessageAudioNotes,
                MessageItemSchema.SenderTelephoneNumber,
                ItemSchema.FlagStatus,
                ItemSchema.FlagCompleteTime,
                MessageItemSchema.ReplyTime,
                MessageItemSchema.RequireProtectedPlayOnPhone,
                ItemSchema.UtcDueDate,
                ItemSchema.UtcStartDate,
                ItemSchema.ReminderDueBy,
                ItemSchema.ReminderIsSet,
                StoreObjectSchema.EffectiveRights
            });
            this.IrmItemHelper = new IRMItemHelper(this.Message, base.UserContext, base.IsPreviewForm, base.IsEmbeddedItem);
            using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
            {
                this.isUMEnabled          = umclientCommon.IsUMEnabled();
                this.isPlayOnPhoneEnabled = umclientCommon.IsPlayOnPhoneEnabled();
            }
            this.IrmItemHelper.IrmDecryptIfRestricted();
            bool isSuspectedPhishingItem = false;
            bool isLinkEnabled           = false;
            bool flag = false;

            this.isMacintoshPlatform = (Utilities.GetBrowserPlatform(base.Request.UserAgent) == BrowserPlatform.Macintosh);
            JunkEmailUtilities.GetJunkEmailPropertiesForItem(this.Message, base.IsEmbeddedItem, base.ForceEnableItemLink, base.UserContext, out this.isInJunkEmailFolder, out isSuspectedPhishingItem, out isLinkEnabled, out flag);
            this.toolbar             = new ReadMessageToolbar(base.IsInDeleteItems, base.IsEmbeddedItem, this.Message, this.isInJunkEmailFolder, isSuspectedPhishingItem, isLinkEnabled, false, this.IrmItemHelper.IsReplyRestricted, this.IrmItemHelper.IsReplyAllRestricted, this.IrmItemHelper.IsForwardRestricted, this.IrmItemHelper.IsPrintRestricted);
            this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
            this.recipientWell       = new MessageRecipientWell(this.Message);
            if (flag)
            {
                this.bodyMarkup = Markup.PlainText;
            }
            InfobarMessageBuilder.AddImportance(this.infobar, this.Message);
            InfobarMessageBuilder.AddFlag(this.infobar, this.Message, base.UserContext);
            InfobarMessageBuilder.AddSensitivity(this.infobar, this.Message);
            if (base.UserContext.IsIrmEnabled && Utilities.IsIrmRestrictedAndDecrypted(this.Message))
            {
                InfobarMessageBuilder.AddIrmInformation(this.infobar, this.Message, base.IsPreviewForm, false, false, false);
            }
            if (!this.Message.IsRead && !base.IsPreviewForm && !base.IsEmbeddedItem)
            {
                this.Message.MarkAsRead(Utilities.ShouldSuppressReadReceipt(base.UserContext, this.Message), false);
            }
        }
Example #3
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (this.IsPageCacheable)
     {
         Utilities.MakePageCacheable(base.Response);
     }
     else
     {
         Utilities.MakePageNoCacheNoStore(base.Response);
     }
     this.InitializeMessage();
     if (this.PageSupportSmime && this.message != null && Utilities.IsSMime(this.message))
     {
         if (!Utilities.IsSMimeFeatureUsable(base.OwaContext))
         {
             throw new OwaNeedsSMimeControlToEditDraftException(LocalizedStrings.GetNonEncoded(-1507367759));
         }
         if (Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 1))
         {
             throw new OwaNeedsSMimeControlToEditDraftException(LocalizedStrings.GetNonEncoded(-872682934));
         }
         if (Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 2))
         {
             throw new OwaNeedsSMimeControlToEditDraftException(LocalizedStrings.GetNonEncoded(-1103993212));
         }
         if (!Utilities.CheckSMimeEditFormBasicRequirement(base.ClientSMimeControlStatus, base.OwaContext))
         {
             throw new OwaNeedsSMimeControlToEditDraftException(LocalizedStrings.GetNonEncoded(-1507367759));
         }
     }
     if (!base.UserContext.IsIrmEnabled && this.message != null && Utilities.IsIrmRestricted(this.message))
     {
         SanitizedHtmlString sanitizedHtmlString = SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(1049269714), new object[]
         {
             Utilities.GetOfficeDownloadAnchor(Microsoft.Exchange.Data.Storage.BodyFormat.TextPlain, base.UserContext.UserCulture)
         });
         throw new OwaCannotEditIrmDraftException(sanitizedHtmlString.ToString());
     }
     if (this.message != null)
     {
         string action = base.OwaContext.FormsRegistryContext.Action;
         string state  = base.OwaContext.FormsRegistryContext.State;
         if (string.CompareOrdinal(action, "Reply") == 0 || string.CompareOrdinal(action, "ReplyAll") == 0)
         {
             this.newItemType = NewItemType.Reply;
         }
         else if (string.CompareOrdinal(action, "Forward") == 0)
         {
             this.newItemType = NewItemType.Forward;
         }
         else if (string.Equals(action, "Open", StringComparison.OrdinalIgnoreCase) && string.Equals(state, "Draft", StringComparison.OrdinalIgnoreCase))
         {
             this.newItemType = NewItemType.ExplicitDraft;
             if (this.message.GetValueOrDefault <bool>(MessageItemSchema.HasBeenSubmitted))
             {
                 this.message.AbortSubmit();
             }
         }
         else
         {
             this.newItemType         = NewItemType.ImplicitDraft;
             base.DeleteExistingDraft = true;
         }
     }
     else
     {
         this.CreateDraftMessage();
     }
     if (this.message != null && Utilities.IsPublic(this.message))
     {
         throw new OwaInvalidRequestException("No way to open a public message in edit form");
     }
     if (this.IsSMimeControlNeeded && this.PageSupportSmime)
     {
         this.bodyMarkup = Markup.Html;
     }
     else
     {
         this.bodyMarkup = BodyConversionUtilities.GetBodyFormatOfEditItem(base.Item, this.newItemType, base.UserContext.UserOptions);
     }
     this.SetIsOtherFolder();
     this.infobar.SetInfobarClass("infobarEdit");
     this.infobar.SetShouldHonorHideByDefault(true);
     if (this.newItemType != NewItemType.New)
     {
         if (this.newItemType == NewItemType.ExplicitDraft)
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(-1981719796), InfobarMessageType.Informational);
         }
         InfobarMessageBuilder.AddSensitivity(this.infobar, this.message);
         if (this.newItemType != NewItemType.ImplicitDraft)
         {
             InfobarMessageBuilder.AddCompliance(base.UserContext, this.infobar, this.message, true);
         }
         if (base.UserContext.IsIrmEnabled && this.message != null)
         {
             InfobarMessageBuilder.AddIrmInformation(this.infobar, this.message, false, true, false, this.IsIrmAsAttachment);
         }
         this.recipientWell       = new MessageRecipientWell(this.message);
         this.showBcc             = (this.recipientWell.HasRecipients(RecipientWellType.Bcc) || base.UserContext.UserOptions.AlwaysShowBcc);
         this.showFrom            = (this.recipientWell.HasRecipients(RecipientWellType.From) || base.UserContext.UserOptions.AlwaysShowFrom || this.isOtherFolder);
         this.toolbar             = this.BuildToolbar();
         this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
         this.addSignatureToBody  = base.ShouldAddSignatureToBody(this.bodyMarkup, this.newItemType);
     }
     else
     {
         this.recipientWell       = new MessageRecipientWell();
         this.showBcc             = base.UserContext.UserOptions.AlwaysShowBcc;
         this.showFrom            = (base.UserContext.UserOptions.AlwaysShowFrom || this.isOtherFolder);
         this.toolbar             = new EditMessageToolbar(Importance.Normal, this.bodyMarkup, this.IsSMimeControlMustUpdate, this.IsSMimeControlNeeded, false, false);
         this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
     }
     if (base.OwaContext.UserContext.IsFeatureEnabled(Feature.SMime) && this.PageSupportSmime)
     {
         if (this.IsSMimeControlNeeded && Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 4))
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(330022834), InfobarMessageType.Informational);
         }
         else if (this.IsSMimeControlMustUpdate)
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(1697878138), InfobarMessageType.Informational);
         }
         if (Utilities.IsSMimeControlNeededForEditForm(base.ClientSMimeControlStatus, base.OwaContext) && this.ShowFrom)
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(-1863471683), InfobarMessageType.Informational);
         }
         if (!Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 1) && !Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 16) && !base.OwaContext.UserContext.IsExplicitLogonOthersMailbox)
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(-1908761042), InfobarMessageType.Warning);
         }
     }
     if (this.Message != null && this.IsRemoveRestricted)
     {
         this.toolbar.IsComplianceButtonEnabledInForm = false;
     }
     if (this.ShowFrom && this.IsFromWellRestricted)
     {
         this.infobar.AddMessage(SanitizedHtmlString.FromStringId(885106754), InfobarMessageType.Informational);
     }
     if (this.message != null && this.newItemType == NewItemType.ExplicitDraft && Utilities.IsInArchiveMailbox(base.Item))
     {
         this.toolbar.IsSendButtonEnabledInForm = false;
     }
 }