From e7d7bc5776b5368142e4a4c85182e16862b202d5 Mon Sep 17 00:00:00 2001 From: V V Date: Tue, 5 Jan 2016 23:27:19 +0300 Subject: [PATCH] fixed reply_id in json and lua --- json-tg.c | 5 ++++- lua-tg.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/json-tg.c b/json-tg.c index cdd42dd..cefb379 100644 --- a/json-tg.c +++ b/json-tg.c @@ -431,7 +431,10 @@ json_t *json_pack_message (struct tgl_message *M) { } if (M->reply_id) { - assert (json_object_set (res, "reply_id", json_integer (M->reply_id)) >= 0); + tgl_message_id_t msg_id = M->permanent_id; + msg_id.id = M->reply_id; + + assert (json_object_set (res, "reply_id", json_string (print_permanent_msg_id (msg_id))) >= 0); } if (M->flags & TGLMF_MENTION) { diff --git a/lua-tg.c b/lua-tg.c index 5f430a4..454a0a6 100644 --- a/lua-tg.c +++ b/lua-tg.c @@ -482,7 +482,10 @@ void push_message (struct tgl_message *M) { } if (M->reply_id) { - lua_add_num_field ("reply_id", M->reply_id); + tgl_message_id_t msg_id = M->permanent_id; + msg_id.id = M->reply_id; + + lua_add_string_field ("reply_id", print_permanent_msg_id (msg_id)); } if (M->flags & TGLMF_MENTION) {