#!/usr/bin/perl
#use Mooix::Thing;
run sub {
	my $this=shift;
	$this->super(@_) || die "super failed";

	unless ($this->defines("contents")) {
		# Don't inherit mass, but do inherit basemass, which is
		# used to start off the mass.
		$this->mass($this->_basemass);
		# Make sure that the field is part of the object;
		# inheriting a later change to this field could mess up the
		# whole mass tracking system.
		$this->_mass($this->_basemass);
		
		# New containers start off with new (and empty) contents lists.
		$this->create(id => "contents",
		              parent => $this->parent->contents,
		              owner => $this);
	}

	unless ($this->defines("messagefilters")) {
		# Containers have a messagefilters list.
		$this->create(id => "messagefilters",
		              parent => $this->parent->messagefilters,
			      owner => $this);
	}
	
	unless ($this->defines("closed")) {
		# Copy the parent's open/closed state.
		$this->closed($this->parent->closed);
	}
	
	return $this;
}
