small fixes

This commit is contained in:
V V 2015-10-01 20:39:29 +03:00
parent 3bbd8e5255
commit cd85857a1f
3 changed files with 10 additions and 0 deletions

View File

@ -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);\
} else if (M->media.type == tgl_message_media_document) {\
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) {\
tgl_do_load_encr_document (TLS, M->media.encr_document, actf, ev); \
} 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) {
}
return;
case tgl_message_media_document:
case tgl_message_media_audio:
case tgl_message_media_video:
mprintf (ev, "[");
assert (M->document);
if (M->document->flags & TGLDF_IMAGE) {

View File

@ -216,6 +216,8 @@ json_t *json_pack_media (struct tgl_message_media *M) {
}
break;
case tgl_message_media_document:
case tgl_message_media_audio:
case tgl_message_media_video:
case tgl_message_media_document_encr:
assert (json_object_set (res, "type", json_string ("document")) >= 0);
break;

View File

@ -284,6 +284,8 @@ void push_media (struct tgl_message_media *M) {
lua_add_string_field ("caption", M->caption);
break;
case tgl_message_media_document:
case tgl_message_media_audio:
case tgl_message_media_video:
case tgl_message_media_document_encr:
lua_newtable (luaState);
lua_add_string_field ("type", "document");