Ejemplo n.º 1
0
 private void DeleteDirectories()
 {
     FileMaster.DeleterFolder(messenger.Server.BansPath);
     FileMaster.DeleterFolder(messenger.Server.NicknamesAndPasswordsPath);
     FileMaster.DeleterFolder(messenger.Server.PeopleChatsPath);
     FileMaster.DeleterFolder(messenger.Server.PublicGroupPath);
     FileMaster.DeleterFolder(messenger.Server.SecretGroupPath);
     FileMaster.DeleterFolder(messenger.Server.UsersPath);
 }
Ejemplo n.º 2
0
        public async Task Run()
        {
            var invitationName = "";
            var pathElement    = "";

            if (TypeChat == "pg" || TypeChat == "ug")
            {
                invitationName = $"public: {NameChat}";
                pathElement    = "leavedUserGroups";
            }
            else if (TypeChat == "sg")
            {
                invitationName = $"secret: {NameChat}";
                pathElement    = "leavedSecretGroups";
            }
            else if (TypeChat == "pp" || TypeChat == "ch")
            {
                pathElement = "leavedPeopleChatsBeen";
            }

            if (invitationName != "")
            {
                var invitationPaths = await FindUserPath(Path.Combine(PathChat, "invitation.json"), "invitation.json");

                if (invitationPaths != null || invitationPaths.Count() != 0)
                {
                    await DeleteExtraData(invitationPaths, invitationName);
                }
            }
            var leavedPaths = await FindUserPath(Path.Combine(PathChat, "leavedPeople.json"), $"{pathElement}.json");

            if (leavedPaths != null || leavedPaths.Count() != 0)
            {
                if (TypeChat == "pp" || TypeChat == "ch")
                {
                    await DeleteLeavedPeople(leavedPaths);
                }
                else
                {
                    await DeleteExtraData(leavedPaths, NameChat);
                }
            }
            FileMaster.DeleterFolder(PathChat);
        }