Commit cd85857a authored by V V's avatar V V

small fixes

parent 3bbd8e52
...@@ -1329,6 +1329,10 @@ void do_ ## act ## _ ## tp (struct command *command, int arg_num, struct arg arg ...@@ -1329,6 +1329,10 @@ void do_ ## act ## _ ## tp (struct command *command, int arg_num, struct arg arg
tgl_do_load_photo (TLS, M->media.photo, actf, ev);\ tgl_do_load_photo (TLS, M->media.photo, actf, ev);\
} else if (M->media.type == tgl_message_media_document) {\ } else if (M->media.type == tgl_message_media_document) {\
tgl_do_load_document (TLS, M->media.document, actf, ev);\ tgl_do_load_document (TLS, M->media.document, actf, ev);\
} else if (M->media.type == tgl_message_media_video) {\
tgl_do_load_video (TLS, M->media.document, actf, ev);\
} else if (M->media.type == tgl_message_media_audio) {\
tgl_do_load_audio (TLS, M->media.document, actf, ev);\
} else if (M->media.type == tgl_message_media_document_encr) {\ } else if (M->media.type == tgl_message_media_document_encr) {\
tgl_do_load_encr_document (TLS, M->media.encr_document, actf, ev); \ tgl_do_load_encr_document (TLS, M->media.encr_document, actf, ev); \
} else if (M->media.type == tgl_message_media_webpage) {\ } else if (M->media.type == tgl_message_media_webpage) {\
...@@ -3551,6 +3555,8 @@ void print_media (struct in_ev *ev, struct tgl_message_media *M) { ...@@ -3551,6 +3555,8 @@ void print_media (struct in_ev *ev, struct tgl_message_media *M) {
} }
return; return;
case tgl_message_media_document: case tgl_message_media_document:
case tgl_message_media_audio:
case tgl_message_media_video:
mprintf (ev, "["); mprintf (ev, "[");
assert (M->document); assert (M->document);
if (M->document->flags & TGLDF_IMAGE) { if (M->document->flags & TGLDF_IMAGE) {
......
...@@ -216,6 +216,8 @@ json_t *json_pack_media (struct tgl_message_media *M) { ...@@ -216,6 +216,8 @@ json_t *json_pack_media (struct tgl_message_media *M) {
} }
break; break;
case tgl_message_media_document: case tgl_message_media_document:
case tgl_message_media_audio:
case tgl_message_media_video:
case tgl_message_media_document_encr: case tgl_message_media_document_encr:
assert (json_object_set (res, "type", json_string ("document")) >= 0); assert (json_object_set (res, "type", json_string ("document")) >= 0);
break; break;
......
...@@ -284,6 +284,8 @@ void push_media (struct tgl_message_media *M) { ...@@ -284,6 +284,8 @@ void push_media (struct tgl_message_media *M) {
lua_add_string_field ("caption", M->caption); lua_add_string_field ("caption", M->caption);
break; break;
case tgl_message_media_document: case tgl_message_media_document:
case tgl_message_media_audio:
case tgl_message_media_video:
case tgl_message_media_document_encr: case tgl_message_media_document_encr:
lua_newtable (luaState); lua_newtable (luaState);
lua_add_string_field ("type", "document"); lua_add_string_field ("type", "document");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment