aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/main.c b/main.c
index dc066af..a4f695d 100644
--- a/main.c
+++ b/main.c
@@ -114,7 +114,15 @@ run:
if(entity.offset == 0 &&
!strcmp(entity.type, "bot_command"))
{
- char is_admin = tgmsg->from->id == env->tg_admin;
+ char is_admin = 0;
+ for(int i = 0; i < env->tg_admins_size; i ++)
+ {
+ if(tgmsg->from->id == env->tg_admins[i])
+ {
+ is_admin = 1;
+ break;
+ }
+ }
if((is_admin && (
!strncmp(tgmsg->text, "/whitelist ", strlen("/whitelist ")) ||
!strncmp(tgmsg->text, "/debug ", strlen("/debug ")) ||
@@ -359,6 +367,7 @@ read:
goto cleanup;
cleanup:
+ environ_free(&environ);
if(curl != NULL) curl_easy_cleanup(curl);
curl_global_cleanup();
if(sd != 0) net_close(sd);