// Token: 0x0600010F RID: 271 RVA: 0x00006A18 File Offset: 0x00004C18 private static bool MergeDuplicateActionItems(MailboxSession session, ConversationActionItem actionItem, MailboxData mailboxData) { ActionsProcessor.Tracer.TraceDebug(0L, "{0}: Calling ActionsProcessor.MergeDuplicateActionItems", new object[] { TraceContext.Get() }); ConversationId conversationId = actionItem.ConversationId; int totalActionItemCount; IList <StoreId> list = ConversationActionItem.QueryConversationActionsFolder(session, conversationId, 10, out totalActionItemCount); mailboxData.UpdateConversationActionsEnabledStatus(totalActionItemCount); if (list == null || list.Count <= 1) { ActionsProcessor.Tracer.TraceDebug <object, int>(0L, "{0}: No duplicates found. Count = {1}", TraceContext.Get(), (list != null) ? list.Count : -1); return(false); } StoreId[] array = new StoreId[list.Count - 1]; bool result = false; for (int i = 1; i < list.Count; i++) { if (list[i].Equals(actionItem.Id)) { result = true; } array[i - 1] = list[i]; } ActionsProcessor.Tracer.TraceDebug <object, int>(0L, "{0}: Attempting to delete {1} duplicates...", TraceContext.Get(), array.Length); session.Delete(DeleteItemFlags.HardDelete, array); return(result); }
// Token: 0x06000125 RID: 293 RVA: 0x00007278 File Offset: 0x00005478 internal void LoadData(MailboxSession session) { if (this.sentItemsFolderId == null) { StoreObjectId defaultFolderId = session.GetDefaultFolderId(DefaultFolderType.SentItems); if (defaultFolderId != null) { this.sentItemsFolderId = defaultFolderId.ProviderLevelItemId; } else { MailboxData.Tracer.TraceError((long)this.GetHashCode(), "{0}: Sent items folder id is null", new object[] { TraceContext.Get() }); } } if (this.outboxFolderId == null) { StoreObjectId defaultFolderId2 = session.GetDefaultFolderId(DefaultFolderType.Outbox); if (defaultFolderId2 != null) { this.outboxFolderId = defaultFolderId2.ProviderLevelItemId; } else { MailboxData.Tracer.TraceError((long)this.GetHashCode(), "{0}: Outbox folder id is null", new object[] { TraceContext.Get() }); } } if (this.inboxFolderId == null) { StoreObjectId defaultFolderId3 = session.GetDefaultFolderId(DefaultFolderType.Inbox); if (defaultFolderId3 != null) { this.inboxFolderId = defaultFolderId3.ProviderLevelItemId; } else { MailboxData.Tracer.TraceError((long)this.GetHashCode(), "{0}: Inbox folder id is null", new object[] { TraceContext.Get() }); } } int totalActionItemCount; ConversationActionItem.QueryConversationActionsFolder(session, null, 0, out totalActionItemCount); this.UpdateConversationActionsEnabledStatus(totalActionItemCount); }
private void ProcessConversationActions(ConversationId conversationId, StoreDriverDeliveryEventArgsImpl argsImpl) { MailboxSession mailboxSession = argsImpl.MailboxSession; try { StoreId storeId = ConversationActionItem.QueryConversationActionsFolder(mailboxSession, conversationId); if (storeId != null) { using (ConversationActionItem conversationActionItem = ConversationActionItem.Bind(mailboxSession, storeId)) { ConversationsProcessingAgent.tracer.TraceDebug <ConversationId>((long)this.GetHashCode(), "Found CAT item for message with CID = {0}", conversationId); if (!conversationActionItem.IsCorrectVersion()) { ConversationsProcessingAgent.tracer.TraceDebug <int, ConversationId>((long)this.GetHashCode(), "Found CAT item with major version {0} for message with CID = {1}", conversationActionItem.ConversationActionVersionMajor, conversationId); } else { StoreId targetFolderId = conversationActionItem.TargetFolderId; if (targetFolderId != null) { argsImpl.DeliverToFolder = targetFolderId; argsImpl.ShouldSkipMoveRule = true; ConversationsProcessingAgent.tracer.TraceDebug((long)this.GetHashCode(), "Applied move action to item"); } List <string> categoriesForItem = conversationActionItem.GetCategoriesForItem(argsImpl.ReplayItem.TryGetProperty(ItemSchema.Categories) as string[]); if (categoriesForItem != null) { argsImpl.PropertiesForAllMessageCopies[ItemSchema.Categories] = categoriesForItem.ToArray(); ConversationsProcessingAgent.tracer.TraceDebug((long)this.GetHashCode(), "Applied categorize action to item"); } if (conversationActionItem.AlwaysClutterOrUnclutterValue != null) { if (argsImpl.SharedPropertiesBetweenAgents == null) { argsImpl.SharedPropertiesBetweenAgents = new Dictionary <PropertyDefinition, object>(); } argsImpl.SharedPropertiesBetweenAgents[ItemSchema.InferenceConversationClutterActionApplied] = conversationActionItem.AlwaysClutterOrUnclutterValue.Value; ConversationsProcessingAgent.tracer.TraceDebug((long)this.GetHashCode(), "Applied clutter action to item"); } conversationActionItem.Save(SaveMode.ResolveConflicts); } } } } catch (ObjectNotFoundException arg) { ConversationsProcessingAgent.tracer.TraceError <ObjectNotFoundException>((long)this.GetHashCode(), "Exception - {0}", arg); } }
// Token: 0x06000113 RID: 275 RVA: 0x00006C64 File Offset: 0x00004E64 internal static void HandleEventInternal(MapiEvent mapiEvent, MailboxSession session, StoreObject storeItem, MailboxData mailboxData) { SentItemsProcessor.Tracer.TraceDebug(0L, "{0}: Calling SentItemsProcessor.HandleEventInternal", new object[] { TraceContext.Get() }); Item item = (Item)storeItem; if (item == null) { SentItemsProcessor.Tracer.TraceError(0L, "{0}: HandleEventInternal received null item", new object[] { TraceContext.Get() }); return; } if (ObjectClass.IsSmsMessage(item.ClassName)) { try { ConversationIndexTrackingEx conversationIndexTrackingEx = ConversationIndexTrackingEx.Create(); SentItemsProcessor.HandleSmsMessage(session, item, mailboxData, conversationIndexTrackingEx); SentItemsProcessor.Tracer.TraceDebug <object, ConversationIndexTrackingEx>(0L, "{0}: ChunkSmsConversation traces: {1}", TraceContext.Get(), conversationIndexTrackingEx); } catch (ObjectNotFoundException) { SentItemsProcessor.Tracer.TraceDebug(0L, "{0}: ObjectNotFoundException thrown while processing SMS item in Sent Items folder", new object[] { TraceContext.Get() }); } return; } try { ConversationId valueOrDefault = item.GetValueOrDefault <ConversationId>(ItemSchema.ConversationId); if (valueOrDefault == null) { SentItemsProcessor.Tracer.TraceError(0L, "{0}: Found item without conversation id", new object[] { TraceContext.Get() }); } else { int totalActionItemCount; IList <StoreId> list = ConversationActionItem.QueryConversationActionsFolder(session, valueOrDefault, 1, out totalActionItemCount); StoreId storeId = (list != null) ? list[0] : null; mailboxData.UpdateConversationActionsEnabledStatus(totalActionItemCount); if (storeId == null) { SentItemsProcessor.Tracer.TraceDebug <object, ConversationId>(0L, "{0}: No action item associated found for message with conversation Id = {1}", TraceContext.Get(), valueOrDefault); } else { using (ConversationActionItem conversationActionItem = ConversationActionItem.Bind(session, storeId)) { if (conversationActionItem.IsCorrectVersion()) { if (conversationActionItem.AlwaysCategorizeValue != null) { List <string> categoriesForItem = conversationActionItem.GetCategoriesForItem(item.TryGetProperty(ItemSchema.Categories) as string[]); if (categoriesForItem != null) { SentItemsProcessor.Tracer.TraceDebug(0L, "{0}: Processed categories on item", new object[] { TraceContext.Get() }); item.SafeSetProperty(ItemSchema.Categories, categoriesForItem.ToArray()); item.Save(SaveMode.ResolveConflicts); item.Load(); } } conversationActionItem.Save(SaveMode.ResolveConflicts); } } } } } catch (ObjectNotFoundException) { SentItemsProcessor.Tracer.TraceDebug(0L, "{0}: ObjectNotFoundException thrown while processing action item", new object[] { TraceContext.Get() }); } }