mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-10-21 07:07 pm

[dw-free] Some suggestions for the edges data file

[commit: http://hg.dwscoalition.org/dw-free/rev/0073e01d76e8]

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

Some changes to the edges JSON format: use the actual username, not display
name. Also include some other information on the user we're getting edges
for.

Patch by [personal profile] foxfirefey.

Files modified:
  • htdocs/data/edges.bml
--------------------------------------------------------------------------------
diff -r 071911b94cfc -r 0073e01d76e8 htdocs/data/edges.bml
--- a/htdocs/data/edges.bml	Wed Oct 21 18:41:39 2009 +0000
+++ b/htdocs/data/edges.bml	Wed Oct 21 19:07:36 2009 +0000
@@ -64,6 +64,9 @@
     my $response = {};
 
     # all accounts have this
+    $response->{account_id} = $u->userid;
+    $response->{name} = $u->user;
+    $response->{display_name} = $u->display_name if $u->is_identity;
     $response->{account_type} = $u->journaltype;
     $response->{watched_by} = [ $u->watched_by_userids ];
 
@@ -81,7 +84,7 @@
 
     # now dump information about the users we loaded
     $response->{accounts} = {
-        map { $_ => { name => $us->{$_}->display_name, type => $us->{$_}->journaltype } } keys %$us
+        map { $_ => { name => $us->{$_}->user, type => $us->{$_}->journaltype } } keys %$us
     };
 
     # Output to BML
--------------------------------------------------------------------------------