afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-12-14 04:52 pm

[dw-free] Enable sending PMs to OpenID display names

[commit: http://hg.dwscoalition.org/dw-free/rev/4e95cae969d9]

http://bugs.dwscoalition.org/show_bug.cgi?id=2158

Recognize exampleusername.openid.com/exampleusername.livejournal.com, etc,
when sending and replying to a private message.

Patch by [personal profile] afuna.

Files modified:
  • htdocs/inbox/compose.bml
--------------------------------------------------------------------------------
diff -r 14cba18de12e -r 4e95cae969d9 htdocs/inbox/compose.bml
--- a/htdocs/inbox/compose.bml	Mon Dec 14 16:45:03 2009 +0000
+++ b/htdocs/inbox/compose.bml	Mon Dec 14 16:51:31 2009 +0000
@@ -84,7 +84,7 @@ body<=
             # Check each user being sent a message
             foreach my $to (@to_list) {
                 # Check the To field
-                my $tou = LJ::load_user($to);
+                my $tou = LJ::load_user_or_identity( $to );
                 unless ($tou) {
                     push @errors, BML::ml( '.error.invalid.username',
                                     { to => $to } );
@@ -242,7 +242,7 @@ body<=
     if ( LJ::isu( $remote ) ) {
         my %trusted_and_watched_userids = map { $_ => 1 } ( $remote->trusted_userids, $remote->watched_userids );
         my $us = LJ::load_userids( keys %trusted_and_watched_userids );
-        @flist = map { $us->{$_}->user } grep { $us->{$_}->is_personal || $us->{$_}->is_identity } keys %trusted_and_watched_userids;
+        @flist = map { $us->{$_}->display_name } grep { $us->{$_}->is_personal || $us->{$_}->is_identity } keys %trusted_and_watched_userids;
     }
     $body .= LJ::JSUtil::autocomplete(field => 'msg_to', list => \@flist);
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org