#!/usr/bin/perl
#use Mooix::Thing;
#use Mooix::Root;
run sub {
	my $this=shift;
	%_=@_;

	# Make sure that this command is not spoofed, just in case.
        if ($_{avatar} != $this) {
		fail "No!"; 
	}
	
	my $lastlog = $Mooix::Root->system->lastlog;
	if (! ref $lastlog) {
		fail "Sorry, the lastlog is not available."
	}
	
	my @log = $lastlog->format(reverse => 1);
	if ($_{direct_object}) {
		# Only show this one.
		my $name = $_{direct_object}->name;
		@log = grep { /^\Q$name\E\s/ } @log;
	}
	
	if (@log) {
		$_{session}->page(@log);
	}
	else {
		$_{session}->write("(none)");
	}
}
