public override int GetHashCode() { return(UserId.GetHashCode() + ConversationId.GetHashCode() + BotId.GetHashCode() + ChannelId.GetHashCode()); }
public static string GetConversationString(ConversationId conversationId) { string key = string.Format(@"Chapter-{0}-{0}-{1}-{2}", StringUtils.Digit2(conversationId.ChapterId), StringUtils.Digit2(conversationId.SequenceId), StringUtils.Digit3(conversationId.Index)); return(LanguageManager.Instance.GetTextValue(key)); }
protected virtual void WriteMessageInternal(BinaryWriter writer) { writer.Write(SenderId.ToByteArray()); writer.Write(ConversationId.ToByteArray()); writer.Write(Created.ToBinary()); WriteString(writer, QueueName); }
public void ShowConversationDialog(FDCreature creature, ConversationId conversation) { // Canvas if (currentDialog != null) { Destroy(currentDialog); currentDialog = null; } // Move the map to corresponding location // Show dialog int animationId = creature?.Definition?.AnimationId ?? 0; string message = LocalizedStrings.GetConversationString(conversation); //Debug.Log("Showing message dialog: " + message); Vector3 popupPosition = Vector3.zero; if (creature != null) { UICreature uiCreature = GetUICreature(creature.CreatureId); Vector3 viewPoint = mainCamera.WorldToViewportPoint(uiCreature.transform.position); RectTransform canvasRect = GameCanvas.GetComponent <RectTransform>(); popupPosition = new Vector3( viewPoint.x * canvasRect.sizeDelta.x - canvasRect.sizeDelta.x * 0.5f, viewPoint.y * canvasRect.sizeDelta.y - canvasRect.sizeDelta.y * 0.5f, 0); } MessageDialog messageDialog = GameObjectExtension.CreateFromPrefab <MessageDialog>("Prefabs/MessageDialog"); messageDialog.Initialize(uiCamera, popupPosition, animationId, message, (index) => { this.OnDialogCallback(index); }, this.ChapterId); currentDialog = messageDialog.gameObject; }
private void btnOK_Click(object sender, EventArgs e) { bool bFail = false; if (txtConversationId.Text.Trim() == string.Empty) { bFail = true; MessageBox.Show("Conversation Id must not be blank."); } if (CurrentFolderId == null) { bFail = true; MessageBox.Show("FolderId is not set."); } if (CurrentPropertySet == null) { bFail = true; MessageBox.Show("PropertySet is not set."); } if (bFail == false) { CurrentConversationId = new ConversationId(txtConversationId.Text); ChoseOK = true; this.Close(); } }
public void TestConvID() { ConversationId test = new ConversationId(); string NewID = test.Id; Assert.IsNotNull(NewID); }
public bool Equals(GroupOptionalConversation input) { if (input == null) { return(false); } return (( GroupId == input.GroupId || (GroupId.Equals(input.GroupId)) ) && ( ConversationId == input.ConversationId || (ConversationId.Equals(input.ConversationId)) ) && ( ChatEnabled == input.ChatEnabled || (ChatEnabled != null && ChatEnabled.Equals(input.ChatEnabled)) ) && ( ChatName == input.ChatName || (ChatName != null && ChatName.Equals(input.ChatName)) ) && ( ChatSecurity == input.ChatSecurity || (ChatSecurity != null && ChatSecurity.Equals(input.ChatSecurity)) )); }
// Token: 0x06002E93 RID: 11923 RVA: 0x0010A058 File Offset: 0x00108258 protected override OwaStoreObjectId GetSeekId() { OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("SId"); if (owaStoreObjectId == null) { return(null); } if (!owaStoreObjectId.IsConversationId && this.IsConversationView) { ConversationId conversationId = ConversationUtilities.MapItemToConversation(base.UserContext, owaStoreObjectId); if (conversationId != null) { this.newSeekId = OwaStoreObjectId.CreateFromConversationId(conversationId, base.DataFolder, null); } } else if (owaStoreObjectId.IsConversationId && !this.IsConversationView) { StoreObjectId storeObjectId = ConversationUtilities.MapConversationToItem(base.UserContext, owaStoreObjectId.ConversationId, OwaStoreObjectId.CreateFromStoreObject(base.DataFolder)); if (storeObjectId != null) { this.newSeekId = OwaStoreObjectId.CreateFromStoreObjectId(storeObjectId, owaStoreObjectId); } } return(this.newSeekId ?? owaStoreObjectId); }
private OwaStoreObjectId(ConversationId conversationId, StoreObjectId folderId, byte[] instanceKey) { this.objectIdType = OwaStoreObjectIdType.Conversation; this.storeObjectId = conversationId; this.containerFolderId = folderId; this.instanceKey = instanceKey; }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (ConversationId != null) { hashCode = hashCode * 59 + ConversationId.GetHashCode(); } if (Token != null) { hashCode = hashCode * 59 + Token.GetHashCode(); } if (ExpiresIn != null) { hashCode = hashCode * 59 + ExpiresIn.GetHashCode(); } if (StreamUrl != null) { hashCode = hashCode * 59 + StreamUrl.GetHashCode(); } if (ReferenceGrammarId != null) { hashCode = hashCode * 59 + ReferenceGrammarId.GetHashCode(); } if (ETag != null) { hashCode = hashCode * 59 + ETag.GetHashCode(); } return(hashCode); } }
private string CalculateConversationMapKey(ConversationId conversationId, IList <StoreObjectId> folderIds, bool useFolderIdsAsExclusionList, bool isIrmEnabled, PropertyDefinition[] requestedProperties) { string text = null; if (folderIds != null) { List <string> list = new List <string>(from id in folderIds select id.ToString().ToLower()); list.Sort(new Comparison <string>(string.CompareOrdinal)); text = string.Join(",", list); } string text2 = null; if (requestedProperties != null) { List <string> list2 = new List <string>(from prop in requestedProperties select prop.Name.ToLower()); list2.Sort(new Comparison <string>(string.CompareOrdinal)); text2 = string.Join(",", list2); } return(string.Format("{0}-{1}-{2}-{3}-{4}", new object[] { conversationId, text ?? "<null>", useFolderIdsAsExclusionList, text2 ?? "<null>", isIrmEnabled })); }
// 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); }
public override bool Equals(object value) { ConversationId obj = value as ConversationId; return((obj != null) && (TriggerTarget == obj.TriggerTarget) && (TriggerHP == obj.TriggerHP)); }
private static Sql.Conversation GetConversationByID(ConversationId id) { using (var ctx = new EmailMonitorContext()) { Sql.Conversation conversation = ctx.Conversation.Find(id.ToString()); return(conversation); } }
public MessageMarkedAsReadDomainEvent(MessageId messageId, ConversationId conversationId, Participant sender, Participant receiver, DateTimeOffset readAt) { MessageId = messageId; ConversationId = conversationId; ReadAt = readAt; Sender = sender; Receiver = receiver; }
private OwaStoreObjectId(ConversationId conversationId, StoreObjectId folderId, string mailboxOwnerLegacyDN, byte[] instanceKey) { this.objectIdType = OwaStoreObjectIdType.ArchiveConversation; this.storeObjectId = conversationId; this.containerFolderId = folderId; this.mailboxOwnerLegacyDN = mailboxOwnerLegacyDN; this.instanceKey = instanceKey; }
public async Task <IActionResult> OnPost() { SetString("UserName", UserName); var identity = new ConversationId(GetString("identity")); var command = new AddMessage(identity, new Message(Message, UserName)); await CommandBus.PublishAsync(command, CancellationToken.None); return(this.RedirectToPage("Index")); }
public void ParseRequest(XmlNode node) { foreach (object obj in node.ChildNodes) { XmlNode xmlNode = (XmlNode)obj; string name; if ((name = xmlNode.Name) != null) { if (name == "ConversationId") { this.conversationIdNode = xmlNode; AirSyncByteArrayProperty airSyncByteArrayProperty = new AirSyncByteArrayProperty("ItemOperations:", "ConversationId", false); airSyncByteArrayProperty.Bind(xmlNode); if (airSyncByteArrayProperty.ByteArrayData != null) { try { this.conversationId = ConversationId.Create(airSyncByteArrayProperty.ByteArrayData); continue; } catch (CorruptDataException innerException) { throw new AirSyncPermanentException(StatusCode.Sync_ClientServerConversion, innerException, false) { ErrorStringForProtocolLogger = "BadConversationIdOnMove" }; } } throw new AirSyncPermanentException(StatusCode.Sync_ProtocolVersionMismatch, false) { ErrorStringForProtocolLogger = "InvalidConversationId(" + xmlNode.Name + ")OnMove" }; } if (name == "DstFldId") { this.dstSyncFolderId = xmlNode.InnerText; continue; } if (name == "Options") { this.ParseOptions(xmlNode); continue; } } throw new AirSyncPermanentException(StatusCode.Sync_ProtocolVersionMismatch, false) { ErrorStringForProtocolLogger = "InvalidNode(" + xmlNode.Name + ")OnConversationMove" }; } if (string.IsNullOrEmpty(this.dstSyncFolderId) || this.conversationId == null) { throw new AirSyncPermanentException(StatusCode.Sync_ProtocolVersionMismatch, false) { ErrorStringForProtocolLogger = "NoDstFldOrIdOnConversationMove" }; } }
public MessageCreatedDomainEvent(MessageId messageId, ConversationId conversationId, Participant sender, Participant receiver, MessageBody content, DateTimeOffset createdAt) { MessageId = messageId; ConversationId = conversationId; Sender = sender; Receiver = receiver; Content = content; CreatedAt = createdAt; }
ConversationId MyCustomConversationIdStrategy(ConversationIdStrategyContext context) { if (context.Message.Instance is MessageSentOutsideOfHandlerMatchingTheConvention message) { return(ConversationId.Custom($"{context.Headers[TennantIdHeaderKey]}-{message.MyBusinessId}")); } return(ConversationId.Default); }
public virtual Conversation CreateConversation(ConversationId conversationId, IList <StoreObjectId> folderIds, bool useFolderIdsAsExclusionList, bool isIrmEnabled, bool isSmimeSupported, string domainName, params PropertyDefinition[] requestedProperties) { HashSet <PropertyDefinition> hashSet = this.SanitizePropertiesRequested(requestedProperties); List <IStorePropertyBag> queryResult = this.MembersQuery.Query(conversationId, hashSet, folderIds, useFolderIdsAsExclusionList); IConversationTree conversationTree = this.TreeFactory.Create(queryResult, hashSet); ConversationStateFactory stateFactory = new ConversationStateFactory(this.Session, conversationTree); ConversationDataExtractor conversationDataExtractor = this.DataExtractorFactory.Create(isIrmEnabled, hashSet, conversationId, conversationTree, isSmimeSupported, domainName); return(this.InternalCreateConversation(conversationId, conversationDataExtractor, stateFactory, conversationTree)); }
protected virtual ConversationAggregationResult ConstructResult(ConversationIndex.FixupStage bySubjectResultingStage, ConversationIndex bySubjectResultingIndex, IStorePropertyBag parentItem) { return(new ConversationAggregationResult { Stage = bySubjectResultingStage, ConversationIndex = bySubjectResultingIndex, SupportsSideConversation = false, ConversationFamilyId = ConversationId.Create(bySubjectResultingIndex) }); }
public static int GetConversationCreatureId(ConversationId conversationId) { string key = string.Format(@"Chapter-{0}-{0}-{1}-{2}-Id", StringUtils.Digit2(conversationId.ChapterId), StringUtils.Digit2(conversationId.SequenceId), StringUtils.Digit3(conversationId.Index)); string creatureIdString = LanguageManager.Instance.GetTextValue(key); int creatureId = 0; int.TryParse(creatureIdString, out creatureId); return(creatureId); }
protected override ConversationAggregationResult ConstructResult(ConversationIndex.FixupStage bySubjectResultingStage, ConversationIndex bySubjectResultingIndex, IStorePropertyBag parentItem, bool participantRemoved) { ConversationAggregationResult conversationAggregationResult = this.ConstructResult(bySubjectResultingStage, bySubjectResultingIndex, parentItem); if (participantRemoved) { conversationAggregationResult.Stage |= ConversationIndex.FixupStage.TC; conversationAggregationResult.ConversationFamilyId = ConversationId.Create(Guid.NewGuid()); } return(conversationAggregationResult); }
public Receiver() { EndpointSetup <DefaultServer>( c => { c.ConfigureRouting() .RouteToEndpoint(typeof(AnyResponseMessage), typeof(Sender)); c.CustomConversationIdStrategy(ctx => ConversationId.Custom(GeneratedConversationId)); }); }
public override Conversation CreateConversation(ConversationId conversationId, IList <StoreObjectId> folderIds, bool useFolderIdsAsExclusionList, bool isIrmEnabled, params PropertyDefinition[] requestedProperties) { string key = this.CalculateConversationMapKey(conversationId, folderIds, useFolderIdsAsExclusionList, isIrmEnabled, requestedProperties); Conversation conversation; if (!this.conversationMap.TryGetValue(key, out conversation)) { conversation = base.CreateConversation(conversationId, folderIds, useFolderIdsAsExclusionList, isIrmEnabled, requestedProperties); this.conversationMap.Add(key, conversation); } return(conversation); }
public IThreadedConversation CreateConversation(ConversationId conversationId, IList <StoreObjectId> folderIds, bool useFolderIdsAsExclusionList, bool isIrmEnabled, bool isSmimeSupported, string domainName, params PropertyDefinition[] requestedItemProperties) { ICollection <PropertyDefinition> defaultThreadProperties = ThreadedConversationFactory.DefaultThreadProperties; HashSet <PropertyDefinition> hashSet = this.SanitizePropertiesRequested(requestedItemProperties, defaultThreadProperties); Dictionary <object, List <IStorePropertyBag> > aggregatedMessages = this.QueryMessages(conversationId, folderIds, useFolderIdsAsExclusionList, hashSet); IConversationTree conversationTree = this.CreateTree(hashSet, aggregatedMessages); ConversationStateFactory stateFactory = this.CreateStateFactory(conversationTree); List <IConversationTree> threadTrees = this.CreateThreadTrees(hashSet, aggregatedMessages); ConversationDataExtractor conversationDataExtractor = this.dataExtractorFactory.Create(isIrmEnabled, hashSet, conversationId, conversationTree, isSmimeSupported, domainName); return(this.InternalCreateConversation(conversationId, conversationDataExtractor, stateFactory, conversationTree, threadTrees, defaultThreadProperties)); }
public ConversationFamilyFactory(IMailboxSession mailboxSession, ConversationId conversationFamilyId) { Util.ThrowOnNullArgument(mailboxSession, "session"); this.mailboxSession = mailboxSession; XSOFactory @default = XSOFactory.Default; this.conversationFamilyId = conversationFamilyId; this.membersQuery = new ConversationFamilyMembersQuery(@default, this.MailboxSession); this.conversationFamilyTreeFactory = new ConversationTreeFactory(this.MailboxSession, ConversationTreeNodeFactory.ConversationFamilyTreeNodeIndexPropertyDefinition); this.selectedConversationTreeFactory = new ConversationTreeFactory(this.MailboxSession); this.dataExtractorFactory = new ConversationDataExtractorFactory(@default, this.MailboxSession); }
// Token: 0x06000F5C RID: 3932 RVA: 0x0003B790 File Offset: 0x00039990 private static ConversationType GetConversationFromDataRow(OwaSearchContext searchContext, MailboxSession mailboxSession, object[] row, Dictionary <PropertyDefinition, int> orderDictionary) { ConversationType conversationType = new ConversationType(); conversationType.InstanceKey = SearchFolderDataRetrieverBase.GetItemProperty <byte[]>(row, orderDictionary[ItemSchema.InstanceKey], null); ConversationId itemProperty = SearchFolderDataRetrieverBase.GetItemProperty <ConversationId>(row, orderDictionary[ConversationItemSchema.ConversationId], null); conversationType.ConversationId = new ItemId(IdConverter.ConversationIdToEwsId(mailboxSession.MailboxGuid, itemProperty), null); conversationType.ConversationTopic = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ConversationItemSchema.ConversationTopic]); conversationType.UniqueRecipients = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ConversationItemSchema.ConversationMVTo]); conversationType.UniqueSenders = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ConversationItemSchema.ConversationMVFrom]); conversationType.LastDeliveryTime = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[ConversationItemSchema.ConversationLastDeliveryTime]); conversationType.Categories = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ConversationItemSchema.ConversationCategories]); if (SearchFolderDataRetrieverBase.IsPropertyDefined(row, orderDictionary[ConversationItemSchema.ConversationFlagStatus])) { FlagStatus itemProperty2 = (FlagStatus)SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationFlagStatus], 0); if (itemProperty2 != FlagStatus.NotFlagged) { conversationType.FlagStatus = new FlagType { FlagStatus = itemProperty2 }.FlagStatus; } } conversationType.HasAttachments = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[ConversationItemSchema.ConversationHasAttach])); conversationType.HasIrm = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[ConversationItemSchema.ConversationHasIrm])); conversationType.MessageCount = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationMessageCount])); conversationType.GlobalMessageCount = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationGlobalMessageCount])); conversationType.UnreadCount = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationUnreadMessageCount])); conversationType.GlobalUnreadCount = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationGlobalUnreadMessageCount])); conversationType.Size = new int?(SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationMessageSize])); conversationType.ItemClasses = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ConversationItemSchema.ConversationMessageClasses]); conversationType.ImportanceString = ((ImportanceType)SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationImportance], 1)).ToString(); StoreId[] itemProperty3 = SearchFolderDataRetrieverBase.GetItemProperty <StoreId[]>(row, orderDictionary[ConversationItemSchema.ConversationItemIds], new StoreId[0]); conversationType.ItemIds = Array.ConvertAll <StoreId, ItemId>(itemProperty3, (StoreId s) => new ItemId(SearchFolderDataRetrieverBase.GetEwsId(s, mailboxSession.MailboxGuid), null)); StoreId[] itemProperty4 = SearchFolderDataRetrieverBase.GetItemProperty <StoreId[]>(row, orderDictionary[ConversationItemSchema.ConversationGlobalItemIds], new StoreId[0]); conversationType.GlobalItemIds = Array.ConvertAll <StoreId, ItemId>(itemProperty4, (StoreId s) => new ItemId(SearchFolderDataRetrieverBase.GetEwsId(s, mailboxSession.MailboxGuid), null)); conversationType.LastModifiedTime = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[StoreObjectSchema.LastModifiedTime]); conversationType.Preview = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ConversationItemSchema.ConversationPreview]); IconIndex itemProperty5 = (IconIndex)SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationReplyForwardState]); if (itemProperty5 > (IconIndex)0) { conversationType.IconIndexString = itemProperty5.ToString(); } itemProperty5 = (IconIndex)SearchFolderDataRetrieverBase.GetItemProperty <int>(row, orderDictionary[ConversationItemSchema.ConversationGlobalReplyForwardState]); if (itemProperty5 > (IconIndex)0) { conversationType.GlobalIconIndexString = itemProperty5.ToString(); } return(conversationType); }
public override int GetHashCode() { unchecked { var hashCode = ServiceUrl != null?ServiceUrl.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (ChannelId != null ? ChannelId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ConversationId != null ? ConversationId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (BotId != null ? BotId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserId != null ? UserId.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Initializes a new instance of the <see cref="ConversationRequest"/> class. /// </summary> /// <param name="conversationId">The conversation id.</param> /// <param name="syncState">State of the sync.</param> public ConversationRequest(ConversationId conversationId, string syncState) { this.ConversationId = conversationId; this.SyncState = syncState; }