User name instead of user ID in Contacts list
Lon - August 13, 2007 - 14:42
| Project: | Privatemsg |
| Version: | 5.x-2.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I've just installed the latest version of this module to play with it.
In /privatemsg/contacts I see that the list of contacts has numerical IDs instead of the usernames. Is this a bug or is it intended to be like this? I would prefer to have the readable usernames instead of these numbers.

#1
Forgot one thing: I would also like the Contacts list to only show users from my buddylist who have enabled private messages in their profile.
#2
So another update: I see now that on the list of contacts I get a correct username when I've sent a PM to another user outside of my buddylist. The ones from my buddylist only get uid (numerical) names in the list of contacts, even the one I've sent PM to.
#3
+1 on this
#4
Update on the first issue (uid instead of name for the users from my buddylist): I think this is a bug.
Line 1646 in privatemsg.module (the version as of August 17) has
$contacts[check_plain($buddy->uid)] = $buddy->uid;
but I think it should be
$contacts[check_plain($buddy->name)] = $buddy->uid;
At least it seems to work fine. :)
#5
An to the second issue: I think this can be solved by changing in function privatemsg_contacts_form() from:
while ($buddy = db_fetch_object($result)) {
$contacts[check_plain($buddy->uid)] = $buddy->uid;
}
to
while ($buddy = db_fetch_object($result)) {
if (privatemsg_message_allowed($user->uid)) {
$contacts[check_plain($buddy->name)] = $buddy->uid;
}
}
Seems to work for me.
#6
Uhm... Think it should be
privatemsg_message_allowed($user->uid, $buddy->uid)
insted of
privatemsg_message_allowed($user->uid)
#7
subscribe
i also would prefer to show my buddies names in the list (instead of uid), nevertheless it would be great to somehow make them look different from others (bold, italic or other colors).
#8
I agree, contacts list should show contacts name, not user id.
Also I think this contact table/list should be sortable and have more columns (information is power!):
isbuddy/isnotbuddy,
last message timestamp,
number of messages sent/received,
etc.
#9
http://drupal.org/node/169836
#10