From acfcb18f2916bdaf4b085d4927a6c68c17b41e09 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Wed, 1 Dec 2021 11:41:28 -0500 Subject: [PATCH] Allow overwriting of previously-delted profiles --- .../org/whispersystems/textsecuregcm/storage/Profiles.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/Profiles.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/Profiles.java index 025f4519e..3551efcd9 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/Profiles.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/Profiles.java @@ -64,7 +64,9 @@ public class Profiles implements ProfilesStore { + AVATAR + " = EXCLUDED." + AVATAR + ", " + ABOUT + " = EXCLUDED." + ABOUT + ", " + ABOUT_EMOJI + " = EXCLUDED." + ABOUT_EMOJI + ", " - + PAYMENT_ADDRESS + " = EXCLUDED." + PAYMENT_ADDRESS) + + PAYMENT_ADDRESS + " = EXCLUDED." + PAYMENT_ADDRESS + ", " + + DELETED + " = FALSE, " + + COMMITMENT + " = CASE WHEN profiles." + DELETED + " = TRUE THEN EXCLUDED." + COMMITMENT + " ELSE profiles." + COMMITMENT + " END") .bind("uuid", uuid) .bind("version", profile.getVersion()) .bind("name", profile.getName())