public bool TryCalculateOnDelivery(ICorePropertyBag itemPropertyBag, ConversationIndex.FixupStage stage, ConversationIndex conversationIndex, out byte[] conversationCreatorSid, out bool updateAllConversationMessages) { ConversationCreatorSidCalculator.MessageType messageType = this.CalculateMessageTypeOnDelivery(conversationIndex, itemPropertyBag, stage); updateAllConversationMessages = (messageType == ConversationCreatorSidCalculator.MessageType.OutOfOrderRootMessage); byte[] valueOrDefault = itemPropertyBag.GetValueOrDefault <byte[]>(InternalSchema.SenderSID, null); return(this.TryCalculateConversationCreatorSid(conversationIndex, messageType, valueOrDefault, out conversationCreatorSid)); }
public bool TryCalculateOnSave(ICorePropertyBag itemPropertyBag, ConversationIndex.FixupStage stage, ConversationIndex conversationIndex, CoreItemOperation operation, out byte[] conversationCreatorSid) { conversationCreatorSid = null; if (operation != CoreItemOperation.Save) { return(false); } byte[] itemOwnerSid = ValueConvertor.ConvertValueToBinary(this.mailboxSession.MailboxOwner.Sid, null); ConversationCreatorSidCalculator.MessageType messageType = this.CalculateMessageTypeOnSave(stage); return(this.TryCalculateConversationCreatorSid(conversationIndex, messageType, itemOwnerSid, out conversationCreatorSid)); }
private bool TryCalculateConversationCreatorSid(ConversationIndex conversationIndex, ConversationCreatorSidCalculator.MessageType messageType, byte[] itemOwnerSid, out byte[] conversationCreatorSid) { switch (messageType) { case ConversationCreatorSidCalculator.MessageType.RootMessage: case ConversationCreatorSidCalculator.MessageType.OutOfOrderRootMessage: conversationCreatorSid = itemOwnerSid; break; case ConversationCreatorSidCalculator.MessageType.NonRootMessage: conversationCreatorSid = this.LoadConversation(conversationIndex).ConversationCreatorSID; break; default: conversationCreatorSid = null; break; } return(conversationCreatorSid != null); }