Closed (outdated)
Project:
Privatemsg
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2011 at 22:24 UTC
Updated:
25 Jul 2022 at 07:58 UTC
Jump to comment: Most recent
Comments
Comment #1
nagiek commentedIt's also necessary for views integration. A base table for pm_thread would also be desirable, even if all it keeps is an index.
Comment #2
berdirAs you've figured out, threads are currently more or less a "virtual" thing, they don't have a base table, messages just happen to be in the same thread if they have the same thread_id.
I've been working on this for quite some time, have a look at #744374: Introduce a pm_thread table. The patch there adds two new tables, one for the thread and one for basically a "thread summary" for each recipient. The patch is currently only available for 6.x-2.x. So, what's necessary is:
- Get the patch there commited, requires testing (especially the upgrade path for big data sets), I'd also love an actual review.
- Port the patch to 7.x-2.x (7.x-1.x is out of the question, as that is stable).
- Then make threads an entity (not fieldable just at that point)
- Then think about how to make it fieldable (for example, the new message form would be some kind of double-entity, as it will become both a message and a thread and would need both fields, something that probably hasn't been done yet).
- At that point, it should also become possible to add proper views integration and declare the privatemsg_views project for deprecated. But before that can happen, there's a lot of work to do.
Any help is welcome...
Comment #3
nagiek commentedCan't disagree with you on the work... definitely a lot to do.
I took a brief glance at the pm_thread patch, looks like it's been sitting there for a while... I'll place my comments in that issue.
In terms of the final form, Private Threads and Messages are pretty analogous to Nodes and Comments. And as for a template, the Drupal project comment form seems to work. (the answer is staring us in the face!)
Either way, I'm glad you're motivated to work on this!
Comment #4
berdirNo, node/comment is not the same thing.
There, you first create a node, and then you create comments later on.
With private messages, when you send a new message to someone, you create a thread *and* a message at the same time.
So both fields of the thread and fields of the message would be visible. And you'd need to make sure that they don't override each other...
Comment #5
nagiek commentedAgreed, I meant node/comment for the admin section, not the form. I would imagine the form as two objects with two calls to field_attach_form. Definitely simultaneous.
Comment #6
ivnish