private void AddChatMessage(CommunityChatMessage message) { string text = message.TimeStamp.ToString("MMM dd, yyyy"); if (this.m_earliestDate == string.Empty) { this.m_earliestDate = text; } if (this.m_latestDate != text) { this.m_latestDate = text; GameObject gameObject = this.m_chatContent.AddAsChildObject(this.m_dateObjectPrefab); Text componentInChildren = gameObject.GetComponentInChildren <Text>(); componentInChildren.text = text.ToUpper(); } GameObject gameObject2 = this.m_chatContent.AddAsChildObject(this.m_chatObjectPrefab); CommunityChatItem component = gameObject2.GetComponent <CommunityChatItem>(); component.SetChatInfo(message); if (this.ShouldMinimizeChatItem(message)) { gameObject2.GetComponent <CommunityChatItem>().MinimizeChatItem(); } else { this.m_lastChatItem = component; } }
private void AddChatMessage(CommunityChatMessage message) { CultureInfo cultureInfoLocale = MobileDeviceLocale.GetCultureInfoLocale(); CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; Thread.CurrentThread.CurrentCulture = cultureInfoLocale; string text = message.TimeStamp.ToString(StaticDB.GetString("FULL_DATE", "dddd, MMMM d, yyyy")); if (this.m_earliestDate == string.Empty) { this.m_earliestDate = text; } if (this.m_latestDate != text) { this.m_latestDate = text; GameObject gameObject = this.m_chatContent.AddAsChildObject(this.m_dateObjectPrefab); Text componentInChildren = gameObject.GetComponentInChildren <Text>(); componentInChildren.text = text; } GameObject gameObject2 = this.m_chatContent.AddAsChildObject(this.m_chatObjectPrefab); CommunityChatItem component = gameObject2.GetComponent <CommunityChatItem>(); component.SetChatInfo(message); if (string.IsNullOrEmpty(message.Author)) { if (this.m_pendingMemberIDs.Count == 0) { Club.OnClubMemberUpdated += new Club.ClubMemberUpdatedHandler(this.UpdatePendingMessages); } this.m_pendingMemberIDs.Add(message.MemberID); } if (this.ShouldMinimizeChatItem(message)) { gameObject2.GetComponent <CommunityChatItem>().MinimizeChatItem(); } else { this.m_lastChatItem = component; } Thread.CurrentThread.CurrentCulture = currentCulture; }
private void OnMessageUpdated(Club.ClubMessageUpdatedEvent messageEvent) { CommunityChatMessage newMessage = null; if (this.m_focusedStream != null) { newMessage = this.m_focusedStream.HandleMessageUpdatedEvent(messageEvent); } if (newMessage != null) { CommunityChatItem communityChatItem = this.m_chatContent.GetComponentsInChildren <CommunityChatItem>().FirstOrDefault((CommunityChatItem item) => item.IsSameMessage(newMessage)); if (communityChatItem != null) { communityChatItem.SetChatInfo(newMessage); } } else { CommunityData.Instance.HandleMessageUpdatedEvent(messageEvent); } }