#!/usr/bin/perl
#use Mooix::Thing;
#use Mooix::Root;
run sub {
	my $this=shift;
	%_=@_;
	my $oldversion=$_{oldversion} || $this->croak("missing oldversion");
	
	if (58 > $oldversion) {
		# Three filters moved from various places to filters/
		# If this object's parent is one of the old filter objects,
		# change it.
		my @olddirs=($Mooix::Root->id."/abstract/messagefilter",
			     $Mooix::Root->id."/abstract/unconsciousness",
			     $Mooix::Root->id."/concrete/dark");
		foreach my $olddir (@olddirs) {
			if ($this->parent->id =~ /^\Q$olddir\E/) {
				my ($base)=$olddir=~/.*\/([^\/]+)$/;
				if (ref $Mooix::Root->filter->$base) {
					$this->parent($Mooix::Root->filter->$base);
				}
			}
		}
	}
	
	return $this->super(@_);
}
