Loading lib/Travelynx/Controller/Traewelling.pm +9 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,9 @@ sub settings { $self->traewelling->set_sync( uid => $uid, push_sync => $self->param('sync_source') eq 'travelynx' ? 1 : 0, pull_sync => $self->param('sync_source') eq 'traewelling' ? 1 : 0 pull_sync => $self->param('sync_source') eq 'traewelling' ? 1 : 0, toot => $self->param('toot') ? 1 : 0, tweet => $self->param('tweet') ? 1 : 0, ); $self->flash( success => 'traewelling' ); $self->redirect_to('account'); Loading @@ -94,6 +96,12 @@ sub settings { else { $self->param( sync_source => 'none' ); } if ( $traewelling->{data}{toot} ) { $self->param( toot => 1 ); } if ( $traewelling->{data}{tweet} ) { $self->param( tweet => 1 ); } $self->render( 'traewelling', Loading lib/Travelynx/Helper/Traewelling.pm +3 −1 Original line number Diff line number Diff line Loading @@ -286,6 +286,8 @@ sub checkin { tripID => $opt{trip_id}, start => q{} . $opt{dep_eva}, destination => q{} . $opt{arr_eva}, toot => $opt{data}{toot} ? \1 : \0, tweet => $opt{data}{tweet} ? \1 : \0, }; my $trip_req = sprintf( "tripID=%s&lineName=%s%%20%s&start=%s", Loading Loading @@ -321,7 +323,7 @@ sub checkin { ); return; } $self->{log}->debug("... success!"); $self->{log}->debug( "... success! " . $tx->res->body ); # As of 2020-10-04, traewelling.de checkins do not yet return # "statusId". The patch is present on the develop branch and waiting Loading lib/Travelynx/Model/Traewelling.pm +12 −6 Original line number Diff line number Diff line Loading @@ -183,14 +183,20 @@ sub set_sync { my ( $self, %opt ) = @_; my $uid = $opt{uid}; my $push_sync = $opt{push_sync}; my $pull_sync = $opt{pull_sync}; my $db = $opt{db} // $self->{pg}->db; $self->{pg}->db->update( my $res_h = $db->select( 'traewelling', 'data', { user_id => $uid } )->expand->hash; $res_h->{data}{toot} = $opt{toot}; $res_h->{data}{tweet} = $opt{tweet}; $db->update( 'traewelling', { push_sync => $push_sync, pull_sync => $pull_sync push_sync => $opt{push_sync}, pull_sync => $opt{pull_sync}, data => JSON->new->encode( $res_h->{data} ), }, { user_id => $uid } ); Loading Loading
lib/Travelynx/Controller/Traewelling.pm +9 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,9 @@ sub settings { $self->traewelling->set_sync( uid => $uid, push_sync => $self->param('sync_source') eq 'travelynx' ? 1 : 0, pull_sync => $self->param('sync_source') eq 'traewelling' ? 1 : 0 pull_sync => $self->param('sync_source') eq 'traewelling' ? 1 : 0, toot => $self->param('toot') ? 1 : 0, tweet => $self->param('tweet') ? 1 : 0, ); $self->flash( success => 'traewelling' ); $self->redirect_to('account'); Loading @@ -94,6 +96,12 @@ sub settings { else { $self->param( sync_source => 'none' ); } if ( $traewelling->{data}{toot} ) { $self->param( toot => 1 ); } if ( $traewelling->{data}{tweet} ) { $self->param( tweet => 1 ); } $self->render( 'traewelling', Loading
lib/Travelynx/Helper/Traewelling.pm +3 −1 Original line number Diff line number Diff line Loading @@ -286,6 +286,8 @@ sub checkin { tripID => $opt{trip_id}, start => q{} . $opt{dep_eva}, destination => q{} . $opt{arr_eva}, toot => $opt{data}{toot} ? \1 : \0, tweet => $opt{data}{tweet} ? \1 : \0, }; my $trip_req = sprintf( "tripID=%s&lineName=%s%%20%s&start=%s", Loading Loading @@ -321,7 +323,7 @@ sub checkin { ); return; } $self->{log}->debug("... success!"); $self->{log}->debug( "... success! " . $tx->res->body ); # As of 2020-10-04, traewelling.de checkins do not yet return # "statusId". The patch is present on the develop branch and waiting Loading
lib/Travelynx/Model/Traewelling.pm +12 −6 Original line number Diff line number Diff line Loading @@ -183,14 +183,20 @@ sub set_sync { my ( $self, %opt ) = @_; my $uid = $opt{uid}; my $push_sync = $opt{push_sync}; my $pull_sync = $opt{pull_sync}; my $db = $opt{db} // $self->{pg}->db; $self->{pg}->db->update( my $res_h = $db->select( 'traewelling', 'data', { user_id => $uid } )->expand->hash; $res_h->{data}{toot} = $opt{toot}; $res_h->{data}{tweet} = $opt{tweet}; $db->update( 'traewelling', { push_sync => $push_sync, pull_sync => $pull_sync push_sync => $opt{push_sync}, pull_sync => $opt{pull_sync}, data => JSON->new->encode( $res_h->{data} ), }, { user_id => $uid } ); Loading