[Bps-public-commit] r16187 - sd/trunk/lib/App/SD/Replica/rt

ruz at bestpractical.com ruz at bestpractical.com
Wed Oct 1 20:33:08 EDT 2008


Author: ruz
Date: Wed Oct  1 20:33:08 2008
New Revision: 16187

Modified:
   sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm

Log:
* set creator of a changeset when pulling from RT
* tiny api change

Modified: sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm	Wed Oct  1 20:33:08 2008
@@ -145,6 +145,7 @@
             my $changeset = Prophet::ChangeSet->new(
                 {   original_source_uuid => $self->sync_source->uuid,
                     original_sequence_no => $txn->{'id'},
+                    creator => $self->resolve_user_id_to( email_address => $txn->{'Creator'} ),
                 }
             );
 
@@ -185,7 +186,7 @@
     );
     $change->add_prop_change( name => 'content_type', old  => undef, new  => $args{'attachment'}->{'ContentType'});
     $change->add_prop_change( name => 'created', old  => undef, new  => $self->date_to_iso($args{'txn'}->{'Created'}));
-    $change->add_prop_change( name => 'creator', old  => undef, new  => $self->resolve_user_id_to( email => $args{'attachment'}->{'Creator'}));
+    $change->add_prop_change( name => 'creator', old  => undef, new  => $self->resolve_user_id_to( email_address => $args{'attachment'}->{'Creator'}));
     $change->add_prop_change( name => 'content', old  => undef, new  => $args{'attachment'}->{'Content'});
     $change->add_prop_change( name => 'name', old  => undef, new  => $args{'attachment'}->{'Filename'});
     $change->add_prop_change( name => 'ticket', old  => undef, new  => $self->sync_source->uuid_for_remote_id( $args{'ticket'}->{ $self->sync_source->uuid . '-id'} ));
@@ -331,7 +332,7 @@
     $change->add_prop_change( name => 'created', old  => undef, new  => $self->date_to_iso($args{'txn'}->{'Created'}));
 
     $change->add_prop_change( name => 'type', old  => undef, new  => $args{'txn'}->{'Type'});
-    $change->add_prop_change( name => 'creator', old  => undef, new  => $self->resolve_user_id_to( email => $args{'txn'}->{'Creator'}));
+    $change->add_prop_change( name => 'creator', old  => undef, new  => $self->resolve_user_id_to( email_address => $args{'txn'}->{'Creator'}));
     $change->add_prop_change( name => 'content', old  => undef, new  => $args{'txn'}->{'Content'});
     $change->add_prop_change( name => 'ticket', old  => undef, new  => $self->sync_source->uuid_for_remote_id( $args{'ticket'}->{ $self->sync_source->uuid . '-id'} ));
     $args{'changeset'}->add_change( { change => $change } );
@@ -349,8 +350,8 @@
     $args{'ticket'}->{ $args{'txn'}->{'Field'} } = $self->warp_list_to_old_value(
         $args{'ticket'}->{ $args{'txn'}->{'Field'} },
 
-        $self->resolve_user_id_to( email => $args{'txn'}->{'NewValue'} ),
-        $self->resolve_user_id_to( email => $args{'txn'}->{'OldValue'} )
+        $self->resolve_user_id_to( email_address => $args{'txn'}->{'NewValue'} ),
+        $self->resolve_user_id_to( email_address => $args{'txn'}->{'OldValue'} )
 
     );
 
@@ -425,7 +426,7 @@
             warn $err;
            return $attr eq 'name' ? 'Unknown user' : 'nobody at localhost';
         }
-    return $attr eq 'name' ? $user->name : $user->email_address;
+    return $user->$attr();
 
 }
 



More information about the Bps-public-commit mailing list