Skip to content

Commit

Permalink
fix(ModuleManager): check file extension instead of mime type (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
rojvv committed Jul 22, 2022
1 parent e54dfdc commit 9a5aade
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion module_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export function managerModule(manager: ModuleManager): Module {
if (
!(media instanceof Api.MessageMediaDocument) ||
!(media.document instanceof Api.Document) ||
media.document.mimeType != "text/vnd.trolltech.linguist" ||
!(media.document.attributes[0] instanceof
Api.DocumentAttributeFilename) ||
!media.document.attributes[0].fileName.endsWith(".ts") ||
media.document.size.gt(5000)
) {
return;
Expand Down

0 comments on commit 9a5aade

Please sign in to comment.