Remove conversation visibilities with standard person associations
This commit is contained in:
parent
f4902421ea
commit
f704f30572
2 changed files with 2 additions and 16 deletions
|
|
@ -26,7 +26,6 @@ class AccountDeleter
|
||||||
def perform!
|
def perform!
|
||||||
# close person
|
# close person
|
||||||
delete_standard_person_associations
|
delete_standard_person_associations
|
||||||
remove_conversation_visibilities
|
|
||||||
delete_contacts_of_me
|
delete_contacts_of_me
|
||||||
tombstone_person_and_profile
|
tombstone_person_and_profile
|
||||||
|
|
||||||
|
|
@ -84,10 +83,6 @@ class AccountDeleter
|
||||||
ShareVisibility.for_a_user(user).find_each(batch_size: 20, &:destroy)
|
ShareVisibility.for_a_user(user).find_each(batch_size: 20, &:destroy)
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_conversation_visibilities
|
|
||||||
ConversationVisibility.where(:person_id => person.id).destroy_all
|
|
||||||
end
|
|
||||||
|
|
||||||
def tombstone_person_and_profile
|
def tombstone_person_and_profile
|
||||||
person.lock_access!
|
person.lock_access!
|
||||||
person.clear_profile!
|
person.clear_profile!
|
||||||
|
|
@ -102,12 +97,12 @@ class AccountDeleter
|
||||||
end
|
end
|
||||||
|
|
||||||
def normal_ar_person_associates_to_delete
|
def normal_ar_person_associates_to_delete
|
||||||
%i[posts photos mentions participations roles blocks]
|
%i[posts photos mentions participations roles blocks conversation_visibilities]
|
||||||
end
|
end
|
||||||
|
|
||||||
def ignored_or_special_ar_person_associations
|
def ignored_or_special_ar_person_associations
|
||||||
%i[comments likes poll_participations contacts notification_actors notifications owner profile
|
%i[comments likes poll_participations contacts notification_actors notifications owner profile
|
||||||
conversation_visibilities pod conversations messages]
|
pod conversations messages]
|
||||||
end
|
end
|
||||||
|
|
||||||
def mark_account_deletion_complete
|
def mark_account_deletion_complete
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ describe AccountDeleter do
|
||||||
delete_contacts_of_me
|
delete_contacts_of_me
|
||||||
delete_standard_person_associations
|
delete_standard_person_associations
|
||||||
tombstone_person_and_profile
|
tombstone_person_and_profile
|
||||||
remove_conversation_visibilities
|
|
||||||
]
|
]
|
||||||
|
|
||||||
context "user deletion" do
|
context "user deletion" do
|
||||||
|
|
@ -157,14 +156,6 @@ describe AccountDeleter do
|
||||||
@account_deletion.tombstone_person_and_profile
|
@account_deletion.tombstone_person_and_profile
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
describe "#remove_conversation_visibilities" do
|
|
||||||
it "removes the conversation visibility for the deleted user" do
|
|
||||||
vis = double
|
|
||||||
expect(ConversationVisibility).to receive(:where).with(hash_including(:person_id => bob.person.id)).and_return(vis)
|
|
||||||
expect(vis).to receive(:destroy_all)
|
|
||||||
@account_deletion.remove_conversation_visibilities
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#remove_share_visibilities_by_contacts_of_user" do
|
describe "#remove_share_visibilities_by_contacts_of_user" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue