| | 1 | | using System.Collections.Generic; |
| | 2 | |
|
| | 3 | | namespace DCL |
| | 4 | | { |
| | 5 | | public class DataStore_Channels |
| | 6 | | { |
| 16 | 7 | | public readonly BaseVariable<string> currentJoinChannelModal = new BaseVariable<string>(null); |
| 16 | 8 | | public readonly BaseVariable<ChannelJoinedSource> channelJoinedSource = new BaseVariable<ChannelJoinedSource>(Ch |
| 16 | 9 | | public readonly BaseVariable<ChannelLeaveSource> channelLeaveSource = new BaseVariable<ChannelLeaveSource>(Chann |
| 16 | 10 | | public readonly BaseVariable<bool> isCreationModalVisible = new BaseVariable<bool>(); |
| 16 | 11 | | public readonly BaseVariable<string> currentChannelLimitReached = new BaseVariable<string>(); |
| 16 | 12 | | public readonly BaseVariable<string> joinChannelError = new BaseVariable<string>(); |
| 16 | 13 | | public readonly BaseVariable<string> leaveChannelError = new BaseVariable<string>(); |
| 16 | 14 | | public readonly BaseVariable<string> channelToBeOpened = new BaseVariable<string>(); |
| 16 | 15 | | public readonly BaseVariable<bool> isPromoteToastVisible = new BaseVariable<bool>(); |
| 16 | 16 | | public readonly BaseDictionary<string, HashSet<string>> availableMembersByChannel = new (); |
| | 17 | |
|
| | 18 | | public void SetAvailableMemberInChannel(string userId, string channelId) |
| | 19 | | { |
| 4 | 20 | | if (string.IsNullOrEmpty(userId)) return; |
| | 21 | |
|
| 4 | 22 | | if (!availableMembersByChannel.ContainsKey(channelId)) |
| 2 | 23 | | availableMembersByChannel.Add(channelId, new HashSet<string>()); |
| | 24 | |
|
| 4 | 25 | | HashSet<string> availableMembers = availableMembersByChannel[channelId]; |
| | 26 | |
|
| 4 | 27 | | if (!availableMembers.Contains(userId)) |
| 3 | 28 | | availableMembers.Add(userId); |
| 4 | 29 | | } |
| | 30 | | } |
| | 31 | | } |