I am adding attachments to PrivateMessages. When I begin to handle the attachments received, I need to create an instance of AttachmentCommon with a forum id that allows JForum to decide whether or not to allow the attachments.
In the new scenario, there is no Forum in the context, because there is no Post.
I propose to create a new AttachmentCommon constructor that establishes by default that attachments are allowed (setting canProceed to true).
Finally got around to look at this code... my suggestion would be to have a constructor like:
AttachmentCommon( request, int id, boolean isPrivateMessage)
If privateMessage is true, then there should be a check against a new global config setting that verifies that private message attachments are allowed or not. This also means that the id parameter should be handled as the PM id rather than a Forum Id.
Also, it would be nice to verify that the Quota code can limit the maximum disk space that a user can use with stored PM attachments.