lm.lua
changeset 12 63f06a23c235
parent 7 5db1448eb857
child 16 09b375e9ce32
equal deleted inserted replaced
11:a8c6460d612b 12:63f06a23c235
   208 --]]
   208 --]]
   209 function lm.message.create ( a )
   209 function lm.message.create ( a )
   210 	if type ( a ) ~= "table" then
   210 	if type ( a ) ~= "table" then
   211 		error "table expected as argument"
   211 		error "table expected as argument"
   212 	end
   212 	end
   213 	if not a.mtype or not a.to then
   213 	if not a.mtype then
   214 		error "you must specify message type and destination"
   214 		error "you must specify message type"
   215 	end
   215 	end
   216 	local mtype, subtype = a.mtype:match ( "(.-)%-(.+)" )
   216 	local mtype, subtype = a.mtype:match ( "(.-)%-(.+)" )
   217 	local m
   217 	local m
   218 	if not mtype then
   218 	if not mtype then
   219 		m = lm.message.new ( a.to, a.mtype )
   219 		m = lm.message.new ( a.to, a.mtype )