Unverified Commit 3502cc6f authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

add_message: pass JSON to Message constructor

parent 18aef465
Loading
Loading
Loading
Loading
+5 −14
Original line number Diff line number Diff line
@@ -555,14 +555,10 @@ sub parse_trips {
sub add_message {
	my ( $self, $json, $is_him ) = @_;

	my $short = $json->{txtS};
	my $text = $json->{txtN};
	my $type  = $json->{type};
	my $code = $json->{code};
	my $prio  = $json->{prio};

	if ($is_him) {
		$short = $json->{head};
		$text = $json->{text};
		$code = $json->{hid};
	}
@@ -580,12 +576,7 @@ sub add_message {
	}

	my $message = Travel::Status::DE::HAFAS::Message->new(
		short     => $short,
		text      => $text,
		type      => $type,
		code      => $code,
		prio      => $prio,
		is_him    => $is_him,
		json      => $json,
		ref_count => 1,
	);
	push( @{ $self->{messages} }, $message );