// Token: 0x06000225 RID: 549 RVA: 0x00013E08 File Offset: 0x00012008 public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action) { if (owaContext == null) { throw new ArgumentNullException("owaContext"); } applicationElement = ApplicationElement.NotSet; type = string.Empty; action = string.Empty; state = string.Empty; PreFormActionResponse preFormActionResponse = new PreFormActionResponse(); Item item = null; Item item2 = null; Item item3 = null; try { HttpContext httpContext = owaContext.HttpContext; UserContext userContext = owaContext.UserContext; item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2); if (!(item is CalendarItemBase) && !(item is MessageItem)) { item3 = ReplyForwardUtilities.CreateForwardMessageWithItemAttached(item, userContext); } else { item3 = ReplyForwardUtilities.CreateForwardItem(BodyFormat.TextPlain, item, ReplyForwardFlags.None, userContext, Utilities.GetParentFolderId(item2, item)); } AttachmentUtility.PromoteInlineAttachments(item3); item3.Save(SaveMode.ResolveConflicts); item3.Load(); ReplyForwardUtilities.DeleteLevelOneAttachments(item3, userContext); preFormActionResponse.ApplicationElement = ApplicationElement.Item; preFormActionResponse.Type = item3.ClassName; preFormActionResponse.Action = "Forward"; preFormActionResponse.AddParameter("id", item3.Id.ObjectId.ToBase64String()); } finally { if (item != null) { item.Dispose(); item = null; } if (item2 != null) { item2.Dispose(); item2 = null; } if (item3 != null) { item3.Dispose(); item3 = null; } } return(preFormActionResponse); }
public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action) { if (owaContext == null) { throw new ArgumentNullException("owaContext"); } applicationElement = ApplicationElement.NotSet; type = string.Empty; action = string.Empty; state = string.Empty; PreFormActionResponse preFormActionResponse = new PreFormActionResponse(); Item item = null; Item item2 = null; Item item3 = null; try { HttpContext httpContext = owaContext.HttpContext; UserContext userContext = owaContext.UserContext; item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2); if (!(item is CalendarItemBase) && !(item is MessageItem)) { throw new OwaInvalidRequestException("Item is not supported for reply"); } if (item is ReportMessage) { Utilities.TransferToErrorPage(owaContext, LocalizedStrings.GetNonEncoded(2128562495)); } item3 = ReplyForwardUtilities.CreateReplyItem(BodyFormat.TextPlain, item, ReplyForwardFlags.None, userContext, null); AttachmentUtility.PromoteInlineAttachments(item3); item3.Save(SaveMode.ResolveConflicts); item3.Load(); preFormActionResponse.ApplicationElement = ApplicationElement.Item; preFormActionResponse.Type = "IPM.Note"; preFormActionResponse.Action = "Reply"; preFormActionResponse.AddParameter("id", item3.Id.ObjectId.ToBase64String()); } finally { if (item != null) { item.Dispose(); item = null; } if (item2 != null) { item2.Dispose(); item2 = null; } if (item3 != null) { item3.Dispose(); item3 = null; } } return(preFormActionResponse); }
// Token: 0x06002EFA RID: 12026 RVA: 0x0010E534 File Offset: 0x0010C734 private void ProcessApprovalResponse(bool isEdit) { MessageItem requestItem; MessageItem messageItem = requestItem = base.GetRequestItem <MessageItem>(ReadMessageEventHandler.ApprovalPrefetchProperties); try { if (!Utilities.IsValidUndecidedApprovalRequest(messageItem)) { throw new OwaInvalidRequestException("The approval request was invalid or was already decided"); } string[] array = (string[])messageItem.VotingInfo.GetOptionsList(); string text = (string)base.GetParameter("Vt"); if (string.IsNullOrEmpty(text)) { throw new OwaInvalidRequestException("The approval vote was not supplied."); } if (array == null || Array.IndexOf <string>(array, text) == -1) { throw new OwaInvalidRequestException("The attempted approval vote was invalid for the approval request."); } BodyFormat replyForwardBodyFormat = ReplyForwardUtilities.GetReplyForwardBodyFormat(messageItem, base.UserContext); OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("fId"); MessageItem messageItem3; MessageItem messageItem2 = messageItem3 = messageItem.CreateVotingResponse(string.Empty, replyForwardBodyFormat, base.UserContext.TryGetMyDefaultFolderId(DefaultFolderType.Drafts), text); try { messageItem2.Save(SaveMode.ResolveConflicts); messageItem2.Load(); if (!isEdit) { messageItem2.Send(); } else { base.WriteNewItemId(messageItem2); } } finally { if (messageItem3 != null) { ((IDisposable)messageItem3).Dispose(); } } } finally { if (requestItem != null) { ((IDisposable)requestItem).Dispose(); } } }
public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action) { if (owaContext == null) { throw new ArgumentNullException("owaContext"); } applicationElement = ApplicationElement.Item; type = string.Empty; action = string.Empty; state = string.Empty; PreFormActionResponse preFormActionResponse = new PreFormActionResponse(); Item item = null; Item item2 = null; Item item3 = null; try { HttpContext httpContext = owaContext.HttpContext; UserContext userContext = owaContext.UserContext; string queryStringParameter = Utilities.GetQueryStringParameter(httpContext.Request, "fId", true); item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2); BodyFormat replyForwardBodyFormat = ReplyForwardUtilities.GetReplyForwardBodyFormat(item, userContext); item3 = ReplyForwardUtilities.CreatePostReplyItem(replyForwardBodyFormat, item as PostItem, userContext, Utilities.GetParentFolderId(item2, item)); item3.Save(SaveMode.ResolveConflicts); item3.Load(); preFormActionResponse.ApplicationElement = ApplicationElement.Item; preFormActionResponse.Type = "IPM.Post"; preFormActionResponse.Action = "PostReply"; preFormActionResponse.AddParameter("Id", OwaStoreObjectId.CreateFromStoreObject(item3).ToBase64String()); preFormActionResponse.AddParameter("fId", queryStringParameter); } finally { if (item != null) { item.Dispose(); item = null; } if (item2 != null) { item2.Dispose(); item2 = null; } if (item3 != null) { item3.Dispose(); item3 = null; } } return(preFormActionResponse); }
// Token: 0x060022C1 RID: 8897 RVA: 0x000C69B8 File Offset: 0x000C4BB8 public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action) { if (owaContext == null) { throw new ArgumentNullException("owaContext"); } applicationElement = ApplicationElement.NotSet; type = string.Empty; action = string.Empty; state = string.Empty; Item item = null; Item item2 = null; Item item3 = null; bool flag = false; BodyFormat bodyFormat = BodyFormat.TextPlain; PreFormActionResponse result; try { HttpContext httpContext = owaContext.HttpContext; UserContext userContext = owaContext.UserContext; PreFormActionResponse preFormActionResponse = new PreFormActionResponse(httpContext.Request, new string[] { "cb", "smime" }); item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2); if (item != null && !ItemUtility.IsForwardSupported(item)) { throw new OwaInvalidRequestException("Forwarding of such a type item is not supported."); } CalendarItemBase calendarItemBase = item as CalendarItemBase; if (item is Task || item is ContactBase || (calendarItemBase != null && !calendarItemBase.IsMeeting)) { item3 = ReplyForwardUtilities.CreateForwardMessageWithItemAttached(item, userContext); preFormActionResponse.Action = "New"; preFormActionResponse.AddParameter("exdltdrft", "1"); } else { bool flag2 = false; string queryStringParameter = Utilities.GetQueryStringParameter(httpContext.Request, "smime", false); RightsManagedMessageDecryptionStatus decryptionStatus = RightsManagedMessageDecryptionStatus.FeatureDisabled; if (userContext.IsIrmEnabled) { try { flag = Utilities.IrmDecryptForReplyForward(owaContext, ref item, ref item2, ref bodyFormat, out decryptionStatus); } catch (RightsManagementPermanentException exception) { decryptionStatus = RightsManagedMessageDecryptionStatus.CreateFromException(exception); } } if (!flag) { bodyFormat = ReplyForwardUtilities.GetReplyForwardBodyFormat(item, userContext); } bool flag3 = Utilities.IsSMimeControlNeededForEditForm(queryStringParameter, owaContext); flag2 = ((flag3 && Utilities.IsSMime(item)) || flag); bool flag4 = userContext.IsSmsEnabled && ObjectClass.IsSmsMessage(owaContext.FormsRegistryContext.Type); ReplyForwardFlags replyForwardFlags = ReplyForwardFlags.None; if (flag2) { replyForwardFlags |= ReplyForwardFlags.DropBody; } if (flag4 || flag) { replyForwardFlags |= ReplyForwardFlags.DropHeader; } StoreObjectId parentFolderId = Utilities.GetParentFolderId(item2, item); item3 = ReplyForwardUtilities.CreateForwardItem(flag3 ? BodyFormat.TextHtml : bodyFormat, item, replyForwardFlags, userContext, parentFolderId); if (flag) { item3.AttachmentCollection.RemoveAll(); using (ItemAttachment itemAttachment = item3.AttachmentCollection.AddExistingItem(item)) { itemAttachment.Save(); goto IL_205; } } if (Utilities.IsIrmRestrictedAndNotDecrypted(item)) { ReplyForwardUtilities.SetAlternateIrmBody(item3, flag3 ? BodyFormat.TextHtml : bodyFormat, userContext, parentFolderId, decryptionStatus, ObjectClass.IsVoiceMessage(item.ClassName)); item3.AttachmentCollection.RemoveAll(); } IL_205: preFormActionResponse.Action = "Forward"; if (flag2) { preFormActionResponse.AddParameter("srcId", Utilities.GetItemIdQueryString(httpContext.Request)); if (Utilities.GetQueryStringParameter(httpContext.Request, "cb", false) == null && Utilities.IsWebBeaconsAllowed(item)) { preFormActionResponse.AddParameter("cb", "1"); } } if (flag4) { item3.ClassName = "IPM.Note.Mobile.SMS"; } } item3.Save(SaveMode.ResolveConflicts); item3.Load(); ReplyForwardUtilities.DeleteLevelOneAttachments(item3, userContext); preFormActionResponse.ApplicationElement = ApplicationElement.Item; preFormActionResponse.Type = item3.ClassName; preFormActionResponse.AddParameter("id", OwaStoreObjectId.CreateFromStoreObject(item3).ToBase64String()); if (userContext.IsInOtherMailbox(item)) { preFormActionResponse.AddParameter("fOMF", "1"); } if (flag) { preFormActionResponse.AddParameter("fIrmAsAttach", "1"); } result = preFormActionResponse; } finally { if (item != null) { item.Dispose(); item = null; } if (item2 != null) { item2.Dispose(); item2 = null; } if (item3 != null) { item3.Dispose(); item3 = null; } } return(result); }
public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action) { if (owaContext == null) { throw new ArgumentNullException("owaContext"); } applicationElement = ApplicationElement.NotSet; type = string.Empty; action = string.Empty; state = string.Empty; Item item = null; Item item2 = null; Item item3 = null; bool flag = false; BodyFormat bodyFormat = BodyFormat.TextPlain; PreFormActionResponse result; try { HttpContext httpContext = owaContext.HttpContext; UserContext userContext = owaContext.UserContext; item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2); RightsManagedMessageDecryptionStatus decryptionStatus = RightsManagedMessageDecryptionStatus.FeatureDisabled; if (userContext.IsIrmEnabled) { try { flag = Utilities.IrmDecryptForReplyForward(owaContext, ref item, ref item2, ref bodyFormat, out decryptionStatus); } catch (RightsManagementPermanentException exception) { decryptionStatus = RightsManagedMessageDecryptionStatus.CreateFromException(exception); } } if (!flag) { bodyFormat = ReplyForwardUtilities.GetReplyForwardBodyFormat(item, userContext); } string queryStringParameter = Utilities.GetQueryStringParameter(httpContext.Request, "smime", false); bool flag2 = Utilities.IsSMimeControlNeededForEditForm(queryStringParameter, owaContext); bool flag3 = userContext.IsSmsEnabled && ObjectClass.IsSmsMessage(owaContext.FormsRegistryContext.Type); bool flag4 = ObjectClass.IsMeetingRequest(owaContext.FormsRegistryContext.Type); bool flag5 = flag3 || (flag2 && Utilities.IsSMime(item)) || flag; ReplyForwardFlags replyForwardFlags = ReplyForwardFlags.None; if (flag5) { replyForwardFlags |= ReplyForwardFlags.DropBody; } if (flag3 || flag) { replyForwardFlags |= ReplyForwardFlags.DropHeader; } StoreObjectId parentFolderId = Utilities.GetParentFolderId(item2, item); item3 = ReplyForwardUtilities.CreateReplyAllItem(flag2 ? BodyFormat.TextHtml : bodyFormat, item, replyForwardFlags, userContext, parentFolderId); if (flag) { using (ItemAttachment itemAttachment = item3.AttachmentCollection.AddExistingItem(item)) { itemAttachment.Save(); goto IL_172; } } if (Utilities.IsIrmRestrictedAndNotDecrypted(item)) { ReplyForwardUtilities.SetAlternateIrmBody(item3, flag2 ? BodyFormat.TextHtml : bodyFormat, userContext, parentFolderId, decryptionStatus, ObjectClass.IsVoiceMessage(item.ClassName)); } IL_172: type = "IPM.Note"; if (flag3) { item3.ClassName = "IPM.Note.Mobile.SMS"; type = "IPM.Note.Mobile.SMS"; ReplyForwardUtilities.RemoveInvalidRecipientsFromSmsMessage((MessageItem)item3); } item3.Save(SaveMode.ResolveConflicts); item3.Load(); PreFormActionResponse preFormActionResponse = new PreFormActionResponse(httpContext.Request, new string[] { "cb", "smime" }); preFormActionResponse.ApplicationElement = ApplicationElement.Item; preFormActionResponse.Type = type; preFormActionResponse.Action = "Reply"; preFormActionResponse.AddParameter("id", OwaStoreObjectId.CreateFromStoreObject(item3).ToBase64String()); if (flag5) { preFormActionResponse.AddParameter("srcId", Utilities.GetItemIdQueryString(httpContext.Request)); if (Utilities.GetQueryStringParameter(httpContext.Request, "cb", false) == null && Utilities.IsWebBeaconsAllowed(item)) { preFormActionResponse.AddParameter("cb", "1"); } } if (userContext.IsInOtherMailbox(item)) { preFormActionResponse.AddParameter("fOMF", "1"); } if (item.GetValueOrDefault <bool>(MessageItemSchema.MessageBccMe) && !flag4) { preFormActionResponse.AddParameter("fRABcc", "1"); } if (flag) { preFormActionResponse.AddParameter("fIrmAsAttach", "1"); } result = preFormActionResponse; } finally { if (item != null) { item.Dispose(); item = null; } if (item2 != null) { item2.Dispose(); item2 = null; } if (item3 != null) { item3.Dispose(); item3 = null; } } return(result); }