@@ -150,7 +150,7 @@ pub fn main() !void {
150150 }
151151
152152 std .log .info ("Requesting chats from Telegram..." , .{});
153- try telegram_queue .postRequest (.{ .load_chats = .{ .count = 20 } });
153+ try telegram_queue .post (.{ .load_chats = .{ .count = 20 } });
154154
155155 var selected_chat_idx : usize = 0 ;
156156
@@ -296,7 +296,7 @@ fn handle_event(alloc: std.mem.Allocator, event: Event, state: *AppState) !i32 {
296296
297297 if (state .chats .items .len > 0 ) {
298298 const first_chat = state .chats .items [0 ];
299- try state .telegram_queue .postRequest (.{
299+ try state .telegram_queue .post (.{
300300 .load_chat_history = .{
301301 .chat_id = first_chat .id ,
302302 .limit = 10 ,
@@ -486,7 +486,7 @@ fn applyAiUpdateResult(alloc: std.mem.Allocator, state: *AppState, result: ai.Ai
486486 },
487487 .send_telegram = > | msg | {
488488 const text_copy = try alloc .dupe (u8 , msg .text );
489- try state .telegram_queue .postRequest (.{
489+ try state .telegram_queue .post (.{
490490 .send_message = .{ .chat_id = msg .chat_id , .text = text_copy },
491491 });
492492 },
@@ -495,7 +495,7 @@ fn applyAiUpdateResult(alloc: std.mem.Allocator, state: *AppState, result: ai.Ai
495495 try std .fmt .allocPrint (alloc , "Message sent successfully to chat '{s}'" , .{res .message })
496496 else
497497 try std .fmt .allocPrint (alloc , "Chat '{s}' not found in your conversations" , .{res .message });
498- try state .ai_queue .postRequest (.{ .tool_result = .{ .success = res .success , .message = message } });
498+ try state .ai_queue .post (.{ .tool_result = .{ .success = res .success , .message = message } });
499499 },
500500 }
501501}
@@ -542,7 +542,7 @@ fn handle_select_action(alloc: std.mem.Allocator, state: *AppState) !void {
542542 if (! state .chat_messages_cache .contains (selected_chat .id )) {
543543 std .log .info ("Requesting messages for chat: {s}" , .{selected_chat .title });
544544 state .loading_messages .* = true ;
545- try state .telegram_queue .postRequest (.{
545+ try state .telegram_queue .post (.{
546546 .load_chat_history = .{ .chat_id = selected_chat .id , .limit = 10 },
547547 });
548548 }
@@ -554,7 +554,7 @@ fn handle_select_action(alloc: std.mem.Allocator, state: *AppState) !void {
554554 const selected_chat = state .chats .items [state .selected_chat_idx .* ];
555555 const message_text = try state .chat_input .toOwnedSlice ();
556556 std .log .info ("Sending message to chat {d}" , .{selected_chat .id });
557- try state .telegram_queue .postRequest (.{
557+ try state .telegram_queue .post (.{
558558 .send_message = .{ .chat_id = selected_chat .id , .text = message_text },
559559 });
560560 },
@@ -634,7 +634,7 @@ fn handle_select_action(alloc: std.mem.Allocator, state: *AppState) !void {
634634 const enhanced_prompt = try chat_list .toOwnedSlice (alloc );
635635
636636 state .llm_loading .* = true ;
637- try state .ai_queue .postRequest (.{ .send_message = .{ .prompt = enhanced_prompt } });
637+ try state .ai_queue .post (.{ .send_message = .{ .prompt = enhanced_prompt } });
638638 },
639639 }
640640}
@@ -718,8 +718,8 @@ fn handle_key_action(alloc: std.mem.Allocator, state: *AppState, action: keybind
718718 switch (action ) {
719719 .quit = > {
720720 std .log .info ("Quit requested, shutting down threads" , .{});
721- state .telegram_queue .postRequest (.{ .shutdown = {} }) catch {};
722- state .ai_queue .postRequest (.{ .shutdown = {} }) catch {};
721+ state .telegram_queue .post (.{ .shutdown = {} }) catch {};
722+ state .ai_queue .post (.{ .shutdown = {} }) catch {};
723723 return 0 ;
724724 },
725725 .switch_mode = > state .active_mode .* = switch (state .active_mode .* ) {
0 commit comments