RealTime and openChat

This commit is contained in:
2025-06-30 22:22:08 +03:30
parent 5afe3662d4
commit ee037532a1
20 changed files with 2222 additions and 275 deletions
@@ -0,0 +1,22 @@
package org.to.telegramfinalproject.Server;
import org.to.telegramfinalproject.Database.ContactDatabase;
import org.to.telegramfinalproject.Models.ResponseModel;
import java.util.UUID;
public class PrivateChatService {
public static ResponseModel deletePrivateChat(UUID currentUserId, UUID targetUserId, boolean both) {
boolean success = both ?
ContactDatabase.deleteChatBoth(currentUserId, targetUserId) :
ContactDatabase.deleteChatOneSide(currentUserId, targetUserId);
if (success) {
return new ResponseModel("success", "Chat deleted successfully");
} else {
return new ResponseModel("error", "Chat not found or failed to delete");
}
}
}