Skip to content

Commit b77c356

Browse files
committed
add send_typing and send_typing_abort to lua
1 parent 4630862 commit b77c356

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README-LUA

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Function_list (arguments are listed aside from cb_function and cb_extra, :
3131
rename_chat (chat, new_name)
3232
chat_set_photo (chat, file)
3333

34+
send_typing (peer)
35+
send_typing_abort (peer)
36+
3437
send_msg (peer, text)
3538
fwd_msg (peer, msg)
3639

lua-tg.c

+12
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ enum lua_query_type {
464464
lq_contact_list,
465465
lq_dialog_list,
466466
lq_msg,
467+
lq_send_typing,
468+
lq_send_typing_abort,
467469
lq_rename_chat,
468470
lq_send_photo,
469471
lq_chat_set_photo,
@@ -877,6 +879,14 @@ void lua_do_all (void) {
877879
free (lua_ptr[p + 2]);
878880
p += 3;
879881
break;
882+
case lq_send_typing:
883+
tgl_do_send_typing (TLS, ((tgl_peer_t *)lua_ptr[p + 1])->id, tgl_typing_typing, lua_empty_cb, lua_ptr[p]);
884+
p += 2;
885+
break;
886+
case lq_send_typing_abort:
887+
tgl_do_send_typing (TLS, ((tgl_peer_t *)lua_ptr[p + 1])->id, tgl_typing_cancel, lua_empty_cb, lua_ptr[p]);
888+
p += 2;
889+
break;
880890
case lq_rename_chat:
881891
tgl_do_rename_chat (TLS, ((tgl_peer_t *)lua_ptr[p + 1])->id, lua_ptr[p + 2], lua_msg_cb, lua_ptr[p]);
882892
free (lua_ptr[p + 2]);
@@ -1167,6 +1177,8 @@ struct lua_function functions[] = {
11671177
{"get_dialog_list", lq_dialog_list, { lfp_none }},
11681178
{"rename_chat", lq_rename_chat, { lfp_chat, lfp_string, lfp_none }},
11691179
{"send_msg", lq_msg, { lfp_peer, lfp_string, lfp_none }},
1180+
{"send_typing", lq_send_typing, { lfp_peer, lfp_none }},
1181+
{"send_typing_abort", lq_send_typing_abort, { lfp_peer, lfp_none }},
11701182
{"send_photo", lq_send_photo, { lfp_peer, lfp_string, lfp_none }},
11711183
{"send_video", lq_send_video, { lfp_peer, lfp_string, lfp_none }},
11721184
{"send_audio", lq_send_audio, { lfp_peer, lfp_string, lfp_none }},

0 commit comments

Comments
 (0)