Upstream
This commit is contained in:
commit
4dafc76499
@ -28,9 +28,9 @@ function id:user_print_name(user) -- Yes, copied from stats plugin
|
|||||||
|
|
||||||
local text = ''
|
local text = ''
|
||||||
if user.first_name then
|
if user.first_name then
|
||||||
text = user.last_name..' '
|
text = user.first_name..' '
|
||||||
end
|
end
|
||||||
if user.lastname then
|
if user.last_name then
|
||||||
text = text..user.last_name
|
text = text..user.last_name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ function post_photo:pre_process(msg, config)
|
|||||||
local file_size = msg.document.file_size
|
local file_size = msg.document.file_size
|
||||||
if file_size > 19922944 then
|
if file_size > 19922944 then
|
||||||
print('File is over 20 MB - can\'t download :(')
|
print('File is over 20 MB - can\'t download :(')
|
||||||
return
|
return msg
|
||||||
end
|
end
|
||||||
|
|
||||||
utilities.send_typing(msg.chat.id, 'upload_photo')
|
utilities.send_typing(msg.chat.id, 'upload_photo')
|
||||||
|
@ -948,22 +948,28 @@ function get_cached_file(url, file_name, receiver, chat_action)
|
|||||||
local header, code = get_http_header(url)
|
local header, code = get_http_header(url)
|
||||||
|
|
||||||
-- file size limit is 50 MB
|
-- file size limit is 50 MB
|
||||||
if header["Content-Length"] then
|
if header then
|
||||||
if tonumber(header["Content-Length"]) > 52420000 then
|
|
||||||
print('file is too large, won\'t send!')
|
if header["Content-Length"] then
|
||||||
return nil
|
if tonumber(header["Content-Length"]) > 52420000 then
|
||||||
|
print('file is too large, won\'t send!')
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
elseif header["content-length"] then
|
||||||
|
if tonumber(header["content-length"]) > 52420000 then
|
||||||
|
print('file is too large, won\'t send!')
|
||||||
|
return nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
elseif header["content-length"] then
|
|
||||||
if tonumber(header["content-length"]) > 52420000 then
|
|
||||||
print('file is too large, won\'t send!')
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if header["last-modified"] then
|
if header["last-modified"] then
|
||||||
last_modified = header["last-modified"]
|
last_modified = header["last-modified"]
|
||||||
elseif header["Last-Modified"] then
|
elseif header["Last-Modified"] then
|
||||||
last_modified = header["Last-Modified"]
|
last_modified = header["Last-Modified"]
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
last_modified = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
if not last_modified then
|
if not last_modified then
|
||||||
|
Reference in New Issue
Block a user