basically an assosiation needs to be created between the user who uploaded the image and the user who is to browse said image. However its not made in newattachment.php.
Thats why you get the error, if you send the message to yourself you'll see that it works fine.
One solution would be to alter the database AFTER the image has been uploaded so that when you submit the the PM it alters the database to change ownership of the attachment to the user it is being submitted to..
that would be a dirty fix but would also mean that the sender could no longer see said attachment in their attachment list or in the sent messages so should you want to get the message attachment back you couldn't.
Now if theres a way to have multiple owners of an attachment in this case then we've got the solution as all we need to do is add the destination user as the attachment owner and we'll have fixed this problem.
If I get any spare time I'll try my best to look at this but Its doubtful with my work load tbh.
|