get all attachments in a thread?

I'm looking through the attachment models and the xf_attachment* databases, and I'm a little confused.

Do I have to go through each post in a thread to call getAttachmentsByContentId to collect all attachments?

I'm trying to gather all attachments in a thread and show them in a little area above a thread.


Well-known member
I think probably you should get all the posts in a thread and then search the attachments table with these post ids