Work on send message Real time in UI(update chat list)

This commit is contained in:
2025-08-30 23:04:59 +03:30
parent edc61ccb96
commit 46216d3368
3 changed files with 44 additions and 32 deletions
@@ -765,14 +765,12 @@ public class ChatPageController {
boolean edited,
org.json.JSONArray reactions
) {
// meta (فرستنده + زمان [+ edited])
String metaText = (displayName == null ? "" : displayName) + "" + formatWhen(sentAt);
if (edited) metaText += " (edited)";
Label meta = new Label(metaText);
meta.setStyle("-fx-font-size: 11; -fx-text-fill: #7e8a97;");
meta.setWrapText(true);
// نرمال‌سازی نوع پیام و متن
String t = type == null ? "" : type.trim().toUpperCase();
boolean isText = t.isEmpty() ? (content != null && !content.isBlank()) : "TEXT".equals(t);
String bodyText = isText ? (content == null ? "" : content) : bracketLabel(t);
@@ -824,6 +822,7 @@ public class ChatPageController {
row.setPadding(new javafx.geometry.Insets(2, 6, 2, 6));
messageContainer.getChildren().add(row);
}