public void SetCommunityInfo(Community community, CommunityStream stream)
 {
     this.m_channelName.text = stream.Name.ToUpper();
     this.m_communityStream  = stream;
     this.m_community        = community;
     this.UpdateNotificationVisibility();
 }
Example #2
0
        public bool HasUnreadMessages(CommunityStream ignoreStream = null)
        {
            bool flag;

            Dictionary <ulong, CommunityStream> .ValueCollection.Enumerator enumerator = this.m_streamList.Values.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    CommunityStream current = enumerator.Current;
                    if (current == ignoreStream || !current.HasUnreadMessages())
                    {
                        continue;
                    }
                    flag = true;
                    return(flag);
                }
                return(false);
            }
            finally
            {
                ((IDisposable)enumerator).Dispose();
            }
            return(flag);
        }
Example #3
0
 private void AddStream(ClubStreamInfo info)
 {
     if (!this.m_streamList.ContainsKey(info.streamId))
     {
         CommunityStream communityStream = new CommunityStream(this.ClubId, info);
         this.m_streamList.Add(communityStream.StreamId, communityStream);
     }
 }
 public void SetChannel(CommunityStream stream)
 {
     this.m_stream           = stream;
     this.m_channelName.text = this.m_stream.Name.ToUpper();
     this.m_leaderModeratorImage.SetActive(this.m_stream.ForLeadersAndModerators);
     this.UpdateToggleState();
     this.m_allButton.onValueChanged.AddListener((bool argument0) => this.TurnOnNotifications());
     this.m_nothingButton.onValueChanged.AddListener((bool argument1) => this.TurnOffNotifications());
 }
 private void ResetFocusedStream()
 {
     if (this.m_focusedStream != null)
     {
         this.m_childCountBeforeRefresh = 0;
         this.m_requestPending          = false;
         this.m_focusedStream.UnfocusStream();
         this.m_focusedStream = null;
     }
 }
Example #6
0
 public bool HasUnreadMessages(CommunityStream ignoreStream = null)
 {
     foreach (CommunityStream communityStream in this.m_streamList.Values)
     {
         if (communityStream != ignoreStream && communityStream.HasUnreadMessages())
         {
             return(true);
         }
     }
     return(false);
 }
 public void InitializeChatContent(Community community, CommunityStream stream)
 {
     if (this.m_focusedStream == null || this.m_focusedStream.StreamId != stream.StreamId)
     {
         this.ResetFocusedStream();
         this.ResetChatPanel();
         this.m_community       = community;
         this.m_focusedStream   = stream;
         this.m_headerText.text = this.m_focusedStream.Name.ToUpper();
         this.UpdateNotificationMarkers();
         this.m_focusedStream.FocusStream();
         if (this.m_focusedStream.IsSubscribed())
         {
             this.BuildMessageList();
         }
         this.m_channelSelectDialog.GetComponent <CommunityChannelDialog>().InitializeContentPane(this.m_community, new UnityAction <CommunityChannelButton>(base.GetComponentInParent <SocialPanel>().SelectChannelButton), () => this.m_channelSelectDialog.SetActive(false));
     }
     this.m_focusedStream.ClearNotifications();
 }
Example #8
0
        public void SelectCommunityButton(CommunityButton button)
        {
            ulong  streamId = 0UL;
            string key      = "DefaultChannel_" + button.m_community.ClubId.ToString();

            if (SecurePlayerPrefs.HasKey(key))
            {
                streamId = Convert.ToUInt64(SecurePlayerPrefs.GetString(key, Main.uniqueIdentifier));
            }
            CommunityStream defaultStream = button.m_community.GetDefaultStream(streamId);

            if (defaultStream == null)
            {
                Main.instance.AddChildToLevel2Canvas(this.m_noChannelsAvailableDialogPrefab);
            }
            else
            {
                SecurePlayerPrefs.SetString(key, defaultStream.StreamId.ToString(), Main.uniqueIdentifier);
                this.OpenChatPanel(button.m_community, defaultStream);
            }
        }
        public void SelectCommunityButton(CommunityButton button)
        {
            ulong  num    = (ulong)0;
            ulong  clubId = button.m_community.ClubId;
            string str    = string.Concat("DefaultChannel_", clubId.ToString());

            if (SecurePlayerPrefs.HasKey(str))
            {
                num = Convert.ToUInt64(SecurePlayerPrefs.GetString(str, Main.uniqueIdentifier));
            }
            CommunityStream defaultStream = button.m_community.GetDefaultStream(num);

            if (defaultStream != null)
            {
                ulong streamId = defaultStream.StreamId;
                SecurePlayerPrefs.SetString(str, streamId.ToString(), Main.uniqueIdentifier);
                this.OpenChatPanel(button.m_community, defaultStream);
            }
            else
            {
                Main.instance.AddChildToLevel2Canvas(this.m_noChannelsAvailableDialogPrefab);
            }
        }
 private void OpenChatPanel(Community community, CommunityStream stream)
 {
     this.m_communitiesChatPanel.SetActive(true);
     this.m_communitiesChatPanel.GetComponent <CommunityChatPanel>().InitializeChatContent(community, stream);
     this.m_communitiesListPanel.SetActive(false);
 }