Commit fc795a61 authored by vysheng's avatar vysheng

Merge pull request #877 from yagop/test

channel_kick_user, channel_get_admins and channel_get_users in Lua
parents 6af53f16 1b54524b
......@@ -712,7 +712,10 @@ enum lua_query_type {
lq_extf,
lq_import_chat_link,
lq_export_chat_link,
lq_channel_invite_user
lq_channel_invite_user,
lq_channel_kick_user,
lq_channel_get_admins,
lq_channel_get_users
};
struct lua_query_extra {
......@@ -1345,6 +1348,18 @@ void lua_do_all (void) {
tgl_do_channel_invite_user (TLS, lua_ptr[p + 1].peer_id, lua_ptr[p + 2].peer_id, lua_empty_cb, lua_ptr[p].ptr);
p += 3;
break;
case lq_channel_kick_user:
tgl_do_channel_kick_user (TLS, lua_ptr[p + 1].peer_id, lua_ptr[p + 2].peer_id, lua_empty_cb, lua_ptr[p].ptr);
p += 3;
break;
case lq_channel_get_admins:
tgl_do_channel_get_members (TLS, lua_ptr[p + 1].peer_id, 100, 0, 1, lua_contact_list_cb, lua_ptr[p].ptr);
p += 2;
break;
case lq_channel_get_users:
tgl_do_channel_get_members (TLS, lua_ptr[p + 1].peer_id, 100, 0, 0, lua_contact_list_cb, lua_ptr[p].ptr);
p += 2;
break;
/*
lq_delete_msg,
lq_restore_msg,
......@@ -1447,6 +1462,9 @@ struct lua_function functions[] = {
{"import_chat_link", lq_import_chat_link, { lfp_string, lfp_none }},
{"export_chat_link", lq_export_chat_link, { lfp_chat, lfp_none }},
{"channel_invite_user", lq_channel_invite_user, { lfp_channel, lfp_user, lfp_none }},
{"channel_kick_user", lq_channel_kick_user, { lfp_channel, lfp_user, lfp_none }},
{"channel_get_admins", lq_channel_get_admins, { lfp_channel, lfp_none }},
{"channel_get_users", lq_channel_get_users, { lfp_channel, lfp_none }},
{ 0, 0, { lfp_none}}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment