Ok, as proposed, these are some changes that were required to implemented the mentioned sub-modules.

If really necessary, I can split it up, but most changes aren't that big.

Changes introduced in this patch:
- a delete permission (we might need to add an info when upgrading that the permissions need to be updated)
- the username is properly themed in the reply form and view message list
- when replying a message, the recipient list is not re-parsed but instead read from the database.
- completely reworked _privatemsg_parse_userstring(). A hook is now executed that allows other modules to lookup a string. Note that the hook is only executed until a module does return a user object. If no hooks are available or if no user object is returned from any available hook, it falls back to the existing username lookup.
- a query_args key for select is added
- autocomplete usernames aren't validated before checked (necessary to get realname autocomplete working, as these might not be valid usernames)

If you have any questions, feel free to ask. This still needs some work (hook documentation, for example) but I wanted to upload it to get some reviews.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

litwol’s picture

Status: Needs review » Fixed
litwol’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Fixed » Patch (to be ported)
Berdir’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
FileSize
10.46 KB

Re-roll for D7.

Thanks to DBTNG, the assemble_query() changes aren't necessary and the function _privatemsg_load_thread_participants() consists only of two lines, but I left it because I think it's easier to port patches back/forward then.

Berdir’s picture

Status: Reviewed & tested by the community » Needs work

something is not yet right...

Berdir’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
13.44 KB

Got it.

Two bugs in the existing code...

- the sql definition for participants used addExpression() for the uid because it was a DISTINCT first (I changed that to a distinct() call) and Expressions are added after fields, so fetchCol() passed the username to user_load_multiple(). That doesn't work :)

- After discussing this with moshe, I found out that the new #theme feature only works as I expected it for theme functions and not template files. So I reverted two theme() calls to call theme() directly.

litwol’s picture

Status: Reviewed & tested by the community » Fixed

Reopen if you find more bugs.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rickydrupal’s picture

Status: Closed (fixed) » Active

How can i apply the fix in d6?
I tried UnxUtils & TortoiseSVN but failed

Berdir’s picture

Status: Active » Fixed

Same here, this has already been fixed.

The issue is *not* about realname integration, it's just a preparation for that.

Berdir’s picture

Status: Fixed » Closed (fixed)