It's been a bit, but I've come back to my fileownership plugin now that the PR it was depending on has been committed.
Okay, a long time after.
This is a two step process. The first triggers off of the filter:uploadStored. This is done because part of what I want to collect and store are the mime type of the file and its size. There are also three permutations of the filename that we want to hold on to. This information is only available as part the file upload that happens when you attach the file.
The second step fires on the action:post.save - this exists for one main reason. If you delete a file from your message, nothing ( obvious anyway ) clean up after that. So this post process checks the message body at save time, compares it to the saved data from step 1 and cleans up any deleted files.
On to the curiousities. When you look at the body content on save, you''ll see
The 0 is the user id #, followed by a timestamp, then the filename. The filename and extension portion match the original file as uploaded. This is followed by the relative url to the version of the image that is posted inline in the forum. Notice that the timestamps do not match and the file has been downcased.
When you click on the image when displayed, you'll load up /assets/uploads/files/1530309721776-filename.png
So why this post? Those timestamps not matching is a little irksome. Is this on purpose? If so, why, exactly?