summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command/work.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx/Command/work.pm')
-rw-r--r--lib/Travelynx/Command/work.pm22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm
index b8f8e52..c43f920 100644
--- a/lib/Travelynx/Command/work.pm
+++ b/lib/Travelynx/Command/work.pm
@@ -44,8 +44,18 @@ sub run {
$db->update(
'in_transit',
- { real_departure => $train->departure },
- { user_id => $uid }
+ {
+ real_departure => $train->departure,
+ route => join( '|', $train->route ),
+ messages => join(
+ '|',
+ map {
+ ( $_->[0] ? $_->[0]->epoch : q{} ) . ':'
+ . $_->[1]
+ } $train->messages
+ )
+ },
+ { user_id => $uid }
);
}
};
@@ -78,6 +88,14 @@ sub run {
{
sched_arrival => $train->sched_arrival,
real_arrival => $train->arrival,
+ route => join( '|', $train->route ),
+ messages => join(
+ '|',
+ map {
+ ( $_->[0] ? $_->[0]->epoch : q{} ) . ':'
+ . $_->[1]
+ } $train->messages
+ )
},
{ user_id => $uid }
);