Skip to content

Commit 0af5c4c

Browse files
committed
Fix subscription_fetch (broken in 770643c)
1 parent 0afadc2 commit 0af5c4c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/telegram/telegram.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ packet_handler_telegram_reviewed(int uid, int argc, char **argv, void *user)
781781
goto cleanup;
782782
}
783783

784-
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);
785785
if (!sub) goto cleanup;
786786
if (!sub->review_flag) goto cleanup;
787787
if (!sub->chat_id) {
@@ -861,7 +861,7 @@ packet_handler_telegram_replied(int uid, int argc, char **argv, void *user)
861861
goto cleanup;
862862
}
863863

864-
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);
865865
if (!sub) goto cleanup;
866866
if (!sub->reply_flag) goto cleanup;
867867
if (!sub->chat_id) {
@@ -1445,7 +1445,7 @@ handle_incoming_message(
14451445
} else if (!r) {
14461446
send_result = send_message(state, bs, mc, "Token expired. Operation failed.", NULL, NULL);
14471447
} else {
1448-
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);
14491449
if (!sub && !strcmp(tcs->command, "/unsubscribe")) {
14501450
send_result = send_message(state, bs, mc, "You have no subscriptions. Nothing to unsubscribe.", NULL, "{ \"hide_keyboard\": true}");
14511451
} else {

plugins/telegram/telegram_subscription.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ telegram_subscription_unparse_bson(const struct telegram_subscription *sub)
208208
}
209209

210210
struct telegram_subscription *
211-
telegram_subscription_fetch(struct mongo_conn *conn, const unsigned char *bot_id, int contest_id, int user_id)
211+
telegram_subscription_fetch(struct mongo_conn *conn, const unsigned char *bot_id, int user_id, int contest_id)
212212
{
213213
#if HAVE_LIBMONGOC - 0 > 0
214214
if (!conn->b.vt->open(&conn->b)) return NULL;

0 commit comments

Comments
 (0)