|
40 | 40 | #include <curl/curl.h> |
41 | 41 | #endif |
42 | 42 |
|
43 | | -#include <pthread.h> |
44 | | -#include <string.h> |
45 | 43 | #include <ctype.h> |
46 | 44 | #include <signal.h> |
| 45 | +#include <stdio.h> |
| 46 | +#include <string.h> |
| 47 | +#include <pthread.h> |
47 | 48 |
|
48 | 49 | static struct common_plugin_data * |
49 | 50 | init_func(void); |
@@ -780,7 +781,7 @@ packet_handler_telegram_reviewed(int uid, int argc, char **argv, void *user) |
780 | 781 | goto cleanup; |
781 | 782 | } |
782 | 783 |
|
783 | | - sub = state->conn->vt->subscription_fetch(state->conn, argv[1], contest_id, user_id); |
| 784 | + sub = state->conn->vt->subscription_fetch(state->conn, argv[1], user_id, contest_id); |
784 | 785 | if (!sub) goto cleanup; |
785 | 786 | if (!sub->review_flag) goto cleanup; |
786 | 787 | if (!sub->chat_id) { |
@@ -860,7 +861,7 @@ packet_handler_telegram_replied(int uid, int argc, char **argv, void *user) |
860 | 861 | goto cleanup; |
861 | 862 | } |
862 | 863 |
|
863 | | - sub = state->conn->vt->subscription_fetch(state->conn, argv[1], contest_id, user_id); |
| 864 | + sub = state->conn->vt->subscription_fetch(state->conn, argv[1], user_id, contest_id); |
864 | 865 | if (!sub) goto cleanup; |
865 | 866 | if (!sub->reply_flag) goto cleanup; |
866 | 867 | if (!sub->chat_id) { |
@@ -1444,11 +1445,11 @@ handle_incoming_message( |
1444 | 1445 | } else if (!r) { |
1445 | 1446 | send_result = send_message(state, bs, mc, "Token expired. Operation failed.", NULL, NULL); |
1446 | 1447 | } else { |
1447 | | - sub = state->conn->vt->subscription_fetch(state->conn, bs->bot_id, token->contest_id, token->user_id); |
| 1448 | + sub = state->conn->vt->subscription_fetch(state->conn, bs->bot_id, token->user_id, token->contest_id); |
1448 | 1449 | if (!sub && !strcmp(tcs->command, "/unsubscribe")) { |
1449 | 1450 | send_result = send_message(state, bs, mc, "You have no subscriptions. Nothing to unsubscribe.", NULL, "{ \"hide_keyboard\": true}"); |
1450 | 1451 | } else { |
1451 | | - if (!sub) sub = telegram_subscription_create(bs->bot_id, token->contest_id, token->user_id); |
| 1452 | + if (!sub) sub = telegram_subscription_create(bs->bot_id, token->user_id, token->contest_id); |
1452 | 1453 | if (!strcmp(tcs->command, "/subscribe")) { |
1453 | 1454 | if (tcs->review_flag) sub->review_flag = 1; |
1454 | 1455 | if (tcs->reply_flag) sub->reply_flag = 1; |
|
0 commit comments