Cause clicking on a person's name to start a PM with them.

This is actually a tricky one, because:
* Later, probably if we display an unread count by the person's
  name, the action on clicking them might very well be
  "Narrow to PMs with that person"
* But for now, while we don't have that, everything about
  historical precedent really does strongly suggest that
  clicking that person's name is going to get you a PM with
  that person.

So we implement that. For now anyway.

(imported from commit 4d461fd6edec122d542c4a97e23f2e400c31122e)
This commit is contained in:
Waseem Daher 2013-02-11 21:36:03 -05:00
parent ca2b48e1ee
commit 096e1b7727
1 changed files with 6 additions and 2 deletions

View File

@ -917,8 +917,12 @@ exports.remove_narrow_filter = function (name, type) {
exports.set_presence_list = function(users, presence_info) {
$('#user_presences').empty();
$.each(users, function(idx, email) {
var user = $('<li>').html($('<a>').attr('href', '#narrow/pm-with/' + email)
.text(people_dict[email].full_name));
var user = $('<li>').html($('<a>').attr('href', '#')
.text(people_dict[email].full_name))
.click(function(e) {
compose.start('private', {'private_message_recipient': email});
e.preventDefault();
});
if (presence_info[email]) {
user.prepend($('<img>').addClass('active-icon').attr('src', '/static/images/green-dot.png'));
}