diff --git a/interface.c b/interface.c index deefe23..7b6f2dd 100644 --- a/interface.c +++ b/interface.c @@ -1120,6 +1120,18 @@ void do_channel_kick (struct command *command, int arg_num, struct arg args[], s tgl_do_channel_kick_user (TLS, args[0].peer_id, args[1].peer_id, print_success_gw, ev); } +void do_channel_get_members (struct command *command, int arg_num, struct arg args[], struct in_ev *ev) { + assert (arg_num == 3); + if (ev) { ev->refcnt ++; } + tgl_do_channel_get_members (TLS, args[0].peer_id, args[1].num == NOT_FOUND ? 100 : args[1].num, args[2].num == NOT_FOUND ? 0 : args[2].num, 0, print_user_list_gw, ev); +} + +void do_channel_get_admins (struct command *command, int arg_num, struct arg args[], struct in_ev *ev) { + assert (arg_num == 3); + if (ev) { ev->refcnt ++; } + tgl_do_channel_get_members (TLS, args[0].peer_id, args[1].num == NOT_FOUND ? 100 : args[1].num, args[2].num == NOT_FOUND ? 0 : args[2].num, 1, print_user_list_gw, ev); +} + /* }}} */ /* {{{ WORKING WITH USERS */ @@ -1593,6 +1605,8 @@ struct command commands[MAX_COMMANDS_SIZE] = { {"add_contact", {ca_string, ca_string, ca_string, ca_none}, do_add_contact, "add_contact \tTries to add user to contact list", NULL}, {"block_user", {ca_user, ca_none}, do_block_user, "block_user \tBlocks user", NULL}, {"broadcast", {ca_user, ca_period, ca_string_end, ca_none}, do_broadcast, "broadcast + \tSends text to several users at once", NULL}, + {"channel_get_admins", {ca_channel, ca_number | ca_optional, ca_number | ca_optional, ca_none}, do_channel_get_admins, "channel_get_admins [limit=100] [offset=0]\tGets channel admins", NULL}, + {"channel_get_members", {ca_channel, ca_number | ca_optional, ca_number | ca_optional, ca_none}, do_channel_get_members, "channel_get_members [limit=100] [offset=0]\tGets channel members", NULL}, {"channel_info", {ca_channel, ca_none}, do_channel_info, "channel_info \tPrints info about channel (id, members, admin, etc.)", NULL}, {"channel_invite", {ca_channel, ca_user, ca_none}, do_channel_invite, "channel_invite \tInvites user to channel", NULL}, {"channel_join", {ca_channel, ca_none}, do_join_channel, "channel_join \tJoins to channel", NULL}, diff --git a/tgl b/tgl index 4266081..2b53517 160000 --- a/tgl +++ b/tgl @@ -1 +1 @@ -Subproject commit 42660816b2ad079c091dc6f1fa4de839df328049 +Subproject commit 2b535170c740023a45f3eb567a781edc1beecaed