Some attachment approval fixes

Approving an attachment from the link in the message was borked, this updates it to use the new validate function and also adds a new function so it knows where to return (again).

Minor formatting of the subs since it was open, you know how it goes.