added search in contact list.

This commit is contained in:
Asal Lotfi
2025-08-10 20:27:58 +03:30
parent 9d65dde069
commit 19e04c903a
4 changed files with 240 additions and 4 deletions
@@ -1,5 +1,6 @@
package org.to.telegramfinalproject.Models;
import java.time.LocalDateTime;
import java.util.UUID;
public class ContactEntry {
@@ -8,6 +9,9 @@ public class ContactEntry {
private String profileName;
private String imageUrl;
private boolean isBlocked;
private LocalDateTime lastSeenTime;
private String contact_displayId;
public ContactEntry(UUID contactId, String userId, String profileName, String imageUrl, boolean isBlocked) {
this.contactId = contactId;
@@ -17,6 +21,16 @@ public class ContactEntry {
this.isBlocked = isBlocked;
}
public ContactEntry(UUID contactId, String userId,String contact_displayId , String profileName, String imageUrl, boolean isBlocked, LocalDateTime lastSeenTime){
this.contactId = contactId;
this.userId = userId;
this.contact_displayId = contact_displayId;
this.profileName = profileName;
this.imageUrl = imageUrl;
this.isBlocked = isBlocked;
this.lastSeenTime = lastSeenTime;
}
public UUID getContactId() {
return contactId;
}
@@ -37,8 +51,24 @@ public class ContactEntry {
return isBlocked;
}
public LocalDateTime getLastSeenTime() {
return lastSeenTime;
}
public void setLastSeenTime(LocalDateTime lastSeenTime) {
this.lastSeenTime = lastSeenTime;
}
public String getContact_displayId() {
return contact_displayId;
}
public void setContact_displayId(String contact_displayId) {
this.contact_displayId = contact_displayId;
}
@Override
public String toString() {
return profileName + " (" + userId + ")" + (isBlocked ? " [Blocked]" : "");
return profileName + " (@" + contact_displayId + ")" + (isBlocked ? " [Blocked]" : "") + " Last Seen:" + (lastSeenTime != null ? " " + lastSeenTime.toString() : "");
}
}