public void RemoveChannel(GroupChannel channel) { if (channel != null) { channel.Leave((e) => {}); } }
public void UnFriend() { GroupChannel group_Channel = null; foreach (GroupChannel groupChannel in friendsGroupChannel) { foreach (User user in groupChannel.Members) { if (!user.Nickname.Equals(userName) && user.Nickname.Equals(selectedUser.Nickname)) { group_Channel = groupChannel; break; } } } var index = friendsUserList.FindIndex(i => i.Nickname == selectedUser.Nickname); if (index >= 0) { friendsUserList.RemoveAt(index); } friendsGroupChannel.Remove(group_Channel); group_Channel.Leave((SendBirdException e) => { if (e != null) { // Error. return; } Debug.Log("UserLeft"); PeopleNearYou(); GetListOfFriends(); }); }