Work on send message Real time in UI

This commit is contained in:
2025-08-30 19:43:58 +03:30
parent 60338fec52
commit edc61ccb96
7 changed files with 481 additions and 60 deletions
@@ -42,10 +42,21 @@ public class ActionHandler {
// private void handleRealTime(JSONObject json) throws IOException {
// IncomingMessageListener listener = new IncomingMessageListener(this.in);
// listener.handleRealTimeEvent (json);
// }
// ActionHandler.java
private void handleRealTime(JSONObject json) throws IOException {
IncomingMessageListener listener = new IncomingMessageListener(this.in);
listener.handleRealTimeEvent (json);
IncomingMessageListener listener = TelegramClient.getInstance().getListener();
if (listener != null) {
listener.handleRealTimeEvent(json);
} else {
System.err.println("[RT] Listener not ready; dropping RT event: " + json);
}
}
public ActionHandler(PrintWriter out, BufferedReader in, Scanner scanner) {
this.out = out;
this.in = in;