Fixed lua media types

This commit is contained in:
vvaltman 2014-09-07 19:30:46 +04:00
parent 7d7a40a8b6
commit d7f9fcc614

View File

@ -237,19 +237,23 @@ void push_media (struct tgl_message_media *M) {
switch (M->type) {
case tgl_message_media_photo:
case tgl_message_media_photo_encr:
lua_pushstring (luaState, "photo");
lua_newtable (luaState);
lua_add_string_field ("type", "photo");
break;
case tgl_message_media_video:
case tgl_message_media_video_encr:
lua_pushstring (luaState, "video");
lua_newtable (luaState);
lua_add_string_field ("type", "video");
break;
case tgl_message_media_audio:
case tgl_message_media_audio_encr:
lua_pushstring (luaState, "audio");
lua_newtable (luaState);
lua_add_string_field ("type", "audio");
break;
case tgl_message_media_document:
case tgl_message_media_document_encr:
lua_pushstring (luaState, "document");
lua_newtable (luaState);
lua_add_string_field ("type", "document");
break;
case tgl_message_media_unsupported:
lua_pushstring (luaState, "unsupported");