Fixed join channel and group bugs

This commit is contained in:
2025-06-12 20:53:44 +03:30
parent 2b972c4b7c
commit 5afe3662d4
5 changed files with 94 additions and 14 deletions
@@ -85,15 +85,16 @@ public class ActionHandler {
}
private void joinGroupOrChannel(String type, String id) {
private void joinGroupOrChannel(String type, String uuid) {
JSONObject req = new JSONObject();
req.put("action", "join_" + type);
req.put("user_id", Session.currentUser.getString("user_id"));
req.put("id", id);
req.put("user_id", Session.currentUser.getString("internalUUID")); // ✅ internal_uuid لازم است
req.put("id", uuid); // ✅ این هم internal_uuid است
send(req);
}
private ChatEntry fetchChatInfo(String receiverId, String receiverType) {
JSONObject req = new JSONObject();
req.put("action", "get_chat_info");
@@ -312,12 +313,13 @@ public class ActionHandler {
} else {
joinGroupOrChannel(type, uuid);
ChatEntry newChat = fetchChatInfo(uuid, type);
ChatEntry newChat = fetchChatInfo(id, type);
refreshChatList();
openChat(newChat);
}
}
case "message" -> {
String receiverId = selected.getString("receiver_id");
String receiverType = selected.getString("receiver_type");