fix open private chats

This commit is contained in:
2025-08-01 14:10:09 +03:30
parent f604ca4f22
commit a2816972d1
8 changed files with 718 additions and 65 deletions
@@ -13,6 +13,7 @@ public class ChatEntry {
private String type;
private LocalDateTime lastMessageTime;
private boolean archived = false;
private UUID otherUser;
private boolean isOwner = false;
@@ -133,4 +134,10 @@ public class ChatEntry {
}
}
public void setOtherUserId(UUID otherId) {this.otherUser = otherId;
}
public UUID getOtherUserId(){
return otherUser;
}
}
@@ -0,0 +1,44 @@
package org.to.telegramfinalproject.Models;
import java.util.UUID;
public class ContactEntry {
private UUID contactId; // internal UUID
private String userId; // public ID
private String profileName;
private String imageUrl;
private boolean isBlocked;
public ContactEntry(UUID contactId, String userId, String profileName, String imageUrl, boolean isBlocked) {
this.contactId = contactId;
this.userId = userId;
this.profileName = profileName;
this.imageUrl = imageUrl;
this.isBlocked = isBlocked;
}
public UUID getContactId() {
return contactId;
}
public String getUserId() {
return userId;
}
public String getProfileName() {
return profileName;
}
public String getImageUrl() {
return imageUrl;
}
public boolean isBlocked() {
return isBlocked;
}
@Override
public String toString() {
return profileName + " (" + userId + ")" + (isBlocked ? " [Blocked]" : "");
}
}
@@ -9,7 +9,7 @@ public class PrivateChat {
private UUID user2_id;
private LocalDateTime created_at;
public PrivateChat(UUID chat_id, UUID user1_id, UUID user2_id, LocalDateTime created_at){
public PrivateChat(UUID chat_id, UUID user1_id, UUID user2_id){
this.chat_id = chat_id;
this.user1_id =user1_id;
this.user2_id =user2_id;