private void FetchUserGroups(IFizzFetchUserGroupsQuery groupFetchQuery, List <IFizzUserGroup> userGroups) { if (groupFetchQuery.HasNext) { groupFetchQuery.Next((groupList, ex) => { if (ex == null) { foreach (IFizzUserGroup group in groupList) { if (group.State == FizzGroupMemberState.Pending) { GroupInvites.Add(group.GroupId, group); } userGroups.Add(group); } FetchUserGroups(groupFetchQuery, userGroups); } }); } else { FetchGroups(userGroups); } }
private void SubscribeNotificationsAndFetchGroups() { if (Client.State == FizzClientState.Closed) { FizzLogger.W("FizzClient should be opened before subscribing user."); return; } Client.Chat.UserNotifications.Subscribe(ex => { if (ex == null) { if (ex == null) { IFizzFetchUserGroupsQuery groupFetchQuery = Client.Chat.Users.BuildFetchUserGroupsQuery(UserId); FetchUserGroups(groupFetchQuery, new List <IFizzUserGroup>()); } } }); }