lib/mapi/msg.rb
# Parse properties from the +Dirent+ obj
Parse properties from the +Dirent+ obj
Parse properties from the + Dirent + obj
def load obj
				if nameid_obj = obj.children.find { |child| child.name =~ NAMEID_RX }
					@nameid = PropertyStore.parse_nameid nameid_obj
					class << obj.ole
						attr_accessor :msg_nameid
					end
					obj.ole.msg_nameid = @nameid
				elsif obj.ole
					@nameid = obj.ole.msg_nameid rescue nil
				end
				obj.children.each do |child|
					next unless child.file?
					case child.name
					when PROPERTIES_RX
						parse_properties child
					when SUBSTG_RX
						parse_substg(*($~[1..-1].map { |num| num.hex rescue nil } + [child]))
					end
				end
			end
def load obj if nameid_obj = obj . children . find { | child | child . name =~ NAMEID_RX } @nameid = PropertyStore . parse_nameid nameid_obj class << obj . ole attr_accessor :msg_nameid end obj . ole . msg_nameid = @nameid elsif obj . ole @nameid = obj . ole . msg_nameid rescue nil end obj . children . each do | child | next unless child . file? case child . name when PROPERTIES_RX parse_properties child when SUBSTG_RX parse_substg ( * ( $~ [ 1 .. - 1 ] . map { | num | num . hex rescue nil } + [ child ] ) ) end end end
Parse properties from the +Dirent+ obj
Parse properties from the + Dirent + obj
# we need to do the nameid first, as it provides the map for later user defined properties # hack to make it available to all msg files from the same ole storage object # FIXME - come up with a neater way # now parse the actual properties. i think dirs that match the substg should be decoded # as properties to. 0x000d is just another encoding, the dir encoding. it should match # whether the object is file / dir. currently only example is embedded msgs anyway
obj