private async Task <string> AddGroup(string nameGroup, string typeGroup, List <string> invitedPeople) { string pathGroup; switch (typeGroup) { case "pg": pathGroup = Path.Combine(messenger.Server.PublicGroupPath, nameGroup); break; default: //(sg) pathGroup = Path.Combine(messenger.Server.SecretGroupPath, nameGroup); break; } FileMaster.CreateDirectory(pathGroup); await FileMaster.UpdateFile(Path.Combine(pathGroup, "users.json"), FileMaster.AddData(user.Nickname)); await FileMaster.UpdateFile(Path.Combine(pathGroup, "invitation.json"), FileMaster.AddSomeData(invitedPeople)); return(pathGroup); }
private async void BanOnIP(UserNicknameAndPasswordAndIPs user) { BanOnNickname(user); await FileMaster.UpdateFile(Path.Combine(messenger.Server.BansPath, "IPsBun.json"), FileMaster.AddSomeData(user.IPs)); }