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
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

Lon - August 13, 2007 - 21:39

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

Lon - August 15, 2007 - 20:13

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

Joe Malik - August 16, 2007 - 12:22

+1 on this

#4

Lon - August 18, 2007 - 17:34

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

Lon - August 18, 2007 - 18:08

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

Lon - August 18, 2007 - 18:12

Uhm... Think it should be

privatemsg_message_allowed($user->uid, $buddy->uid)

insted of

privatemsg_message_allowed($user->uid)

#7

yngens - August 21, 2007 - 05:00

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

EnekoAlonso - August 21, 2007 - 18:32

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

salvis - August 27, 2007 - 23:33
Status:active» fixed

http://drupal.org/node/169836

#10

Anonymous - September 11, 2007 - 00:21
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.