internal static List <BlobRecipient> ReadRecipients(Item item, PropertyDefinition propertyDefinition) { item.Load(new PropertyDefinition[] { propertyDefinition }); try { Stream stream = null; object obj = item.TryGetProperty(propertyDefinition); try { if (obj is byte[]) { stream = new MemoryStream(obj as byte[], false); } else if (PropertyError.IsPropertyValueTooBig(obj)) { stream = item.OpenPropertyStream(propertyDefinition, PropertyOpenMode.ReadOnly); } if (stream != null) { return(BlobRecipientParser.ReadRecipients(item.PropertyBag.ExTimeZone, stream)); } } finally { if (stream != null) { stream.Dispose(); } } } catch (PropertyErrorException) { } return(new List <BlobRecipient>()); }
internal List <BlobRecipient> GetUnsendableRecipients() { List <BlobRecipient> blobRecipientList = BlobRecipientParser.ReadRecipients(this, InternalSchema.UnsendableRecipients); return(MeetingRequest.FilterBlobRecipientList(blobRecipientList)); }
internal List <BlobRecipient> GetMFNAddedAttendees() { return(BlobRecipientParser.ReadRecipients(this, InternalSchema.MFNAddedRecipients)); }
public static MessageItem CreateForward(MessageItem originalItem, bool asAttachment, CultureInfo culture, string imceaDomain, string xLoop, ExTimeZone timeZone, IRuleEvaluationContext context) { Util.ThrowOnNullArgument(originalItem, "originalItem"); Util.ThrowOnNullArgument(culture, "culture"); Util.ThrowOnNullOrEmptyArgument(imceaDomain, "imceaDomain"); ExTraceGlobals.StorageTracer.Information(0L, "RuleMessageUtils::CreateForward."); MessageItem messageItem = null; bool flag = false; MessageItem result; try { ForwardCreationFlags forwardCreationFlags = ForwardCreationFlags.None; string className = originalItem.ClassName; if (ObjectClass.IsMeetingMessage(className)) { forwardCreationFlags |= ForwardCreationFlags.TreatAsMeetingMessage; } messageItem = context.CreateMessageItem(InternalSchema.ContentConversionProperties); messageItem[InternalSchema.ItemClass] = "IPM.Note"; StoreSession storeSession = context.StoreSession ?? originalItem.Session; if (asAttachment) { ForwardAsAttachmentCreation forwardAsAttachmentCreation = new ForwardAsAttachmentCreation(originalItem, messageItem, new ReplyForwardConfiguration(forwardCreationFlags, culture) { XLoop = xLoop, TimeZone = timeZone, ConversionOptionsForSmime = new InboundConversionOptions(storeSession.GetADRecipientSession(true, ConsistencyMode.IgnoreInvalid), imceaDomain) }); forwardAsAttachmentCreation.PopulateProperties(); } else { bool flag2 = ObjectClass.IsMeetingCancellation(className); bool flag3 = ObjectClass.IsMeetingRequest(className); bool isRestricted = originalItem.IsRestricted; if (flag2) { messageItem[InternalSchema.ItemClass] = "IPM.Schedule.Meeting.Canceled"; messageItem[InternalSchema.IconIndex] = IconIndex.AppointmentMeetCancel; } else if (flag3) { messageItem[InternalSchema.ItemClass] = "IPM.Schedule.Meeting.Request"; messageItem[InternalSchema.IsResponseRequested] = true; messageItem[InternalSchema.IsReplyRequested] = true; } else if (isRestricted) { messageItem[StoreObjectSchema.ContentClass] = "rpmsg.message"; messageItem.IconIndex = IconIndex.MailIrm; } BodyFormat format = originalItem.Body.Format; ReplyForwardConfiguration replyForwardConfiguration = new ReplyForwardConfiguration(format, forwardCreationFlags, culture); replyForwardConfiguration.XLoop = xLoop; replyForwardConfiguration.TimeZone = timeZone; replyForwardConfiguration.ConversionOptionsForSmime = new InboundConversionOptions(storeSession.GetADRecipientSession(true, ConsistencyMode.IgnoreInvalid), imceaDomain); RuleMessageUtils.GenerateHeader(replyForwardConfiguration, originalItem); ForwardCreation forwardCreation = new ForwardCreation(originalItem, messageItem, replyForwardConfiguration); forwardCreation.PopulateProperties(); if (flag2 || flag3) { AppointmentStateFlags appointmentStateFlags = messageItem.GetValueOrDefault <AppointmentStateFlags>(InternalSchema.AppointmentState); appointmentStateFlags |= (AppointmentStateFlags.Meeting | AppointmentStateFlags.Received); messageItem[InternalSchema.AppointmentState] = appointmentStateFlags; int num = messageItem.GetValueOrDefault <int>(InternalSchema.AppointmentAuxiliaryFlags, 0); num |= 4; messageItem[InternalSchema.AppointmentAuxiliaryFlags] = num; if (flag3) { List <BlobRecipient> list = BlobRecipientParser.ReadRecipients(originalItem, InternalSchema.UnsendableRecipients); list = MeetingRequest.FilterBlobRecipientList(list); list = MeetingRequest.MergeRecipientLists(originalItem.Recipients, list); list = MeetingRequest.FilterBlobRecipientList(list); BlobRecipientParser.WriteRecipients(messageItem, InternalSchema.UnsendableRecipients, list); } } } flag = true; result = messageItem; } finally { if (!flag && messageItem != null) { messageItem.Dispose(); messageItem = null; } } return(result); }
internal List <BlobRecipient> GetForwardedAttendees() { return(BlobRecipientParser.ReadRecipients(this, InternalSchema.ForwardNotificationRecipients)); }