Fixes

Signed-off-by: emanuele <emanuele45@gmail.com>
getLegacyAttachmentFilename is supposed to be a function, not a method

Signed-off-by: emanuele <emanuele45@gmail.com>
Copy&paste mess

Signed-off-by: emanuele <emanuele45@gmail.com>