status function to lua
This commit is contained in:
parent
30656e49be
commit
4e35360aff
2 changed files with 16 additions and 1 deletions
|
@ -71,5 +71,8 @@ Function_list (arguments are listed aside from cb_function and cb_extra, :
|
|||
delete_msg (msg)
|
||||
restore_msg (number)
|
||||
|
||||
status_online ()
|
||||
status_offline ()
|
||||
|
||||
Also, you have function
|
||||
postpone (cb_function, cb_extra, timeout). It will call your cb_function in specified number of seconds (number of seconds may be double).
|
||||
|
|
14
lua-tg.c
14
lua-tg.c
|
@ -488,7 +488,9 @@ enum lua_query_type {
|
|||
lq_delete_msg,
|
||||
lq_restore_msg,
|
||||
lq_accept_secret_chat,
|
||||
lq_send_contact
|
||||
lq_send_contact,
|
||||
lq_status_online,
|
||||
lq_status_offline
|
||||
};
|
||||
|
||||
struct lua_query_extra {
|
||||
|
@ -1030,6 +1032,14 @@ void lua_do_all (void) {
|
|||
free (s3);
|
||||
p += 5;
|
||||
break;
|
||||
case lq_status_online:
|
||||
tgl_do_update_status (1, lua_empty_cb, lua_ptr[p]);
|
||||
p ++;
|
||||
break;
|
||||
case lq_status_offline:
|
||||
tgl_do_update_status (0, lua_empty_cb, lua_ptr[p]);
|
||||
p ++;
|
||||
break;
|
||||
/*
|
||||
lq_delete_msg,
|
||||
lq_restore_msg,
|
||||
|
@ -1109,6 +1119,8 @@ struct lua_function functions[] = {
|
|||
{"restore_msg", lq_restore_msg, { lfp_positive_number, lfp_none }},
|
||||
{"accept_secret_chat", lq_accept_secret_chat, { lfp_secret_chat, lfp_none }},
|
||||
{"send_contact", lq_send_contact, { lfp_peer, lfp_string, lfp_string, lfp_string, lfp_none }},
|
||||
{"status_online", lq_status_online, { lfp_none }},
|
||||
{"status_offline", lq_status_offline, { lfp_none }},
|
||||
{ 0, 0, { lfp_none}}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue