Changes implemented in EnRoute Core and EnRoute i-net since the
EnRoute 1.4 GM


EnRoute Core 1.4a1

	// LRT - 97/03/16 2:38 PM
	Fix for bug with missing text when mailing from iobox causes loss of message text
	Bug:
		1629823 - Body of message lost when mailing received/Sent mailed items from the I/O Box


		C_RouteSlipProto function "SetFieldDefaults"
			...
			if not TargetIsCursor ( target )
			and ClassOf ( target ) = 'enRouteMailText and
			( not target.appSymbol
			or target.appSymbol = 'mail
			or target.appSymbol = 'iobox ) then
				begin
				if not target.attachment then
					begin
					fields.__textOnly := true;
					end;
				end;

			if not TargetIsCursor ( target ) then
				begin
				local copyFrom :=
					if target.body
					and ClassOf ( target.body ) = 'enRouteMailText then
						target.body;
					else if ClassOf ( target ) = 'enRouteMailText then
						target;
					else
						nil;
				if copyFrom then
					begin
					fields.title := copyFrom.title;
					fields.text := copyFrom.text;
					if copyFrom.edited then
						fields.edited := true;
					if not copyFrom.body then
						begin
						RemoveSlot ( fields, 'attachment );
						fields.body := nil;
						fields.__textOnly := true;
						end;
					end;
				end;



	C_Transport function "VerifyRoutingInfo"
			...
			if item.body
			and ClassOf ( item.body ) = 'enRouteMailText then
				begin
				item.text := item.body.text;
				if item.body.edited then
					item.edited := true;
				if not item.body.body then
					begin
					RemoveSlot ( item, 'attachment );
					item.body := nil;
					end;
				end;
			...
			...
			if ClassOf ( entry ) = 'enRouteMailText then
				begin
				item.title := entry.title;
				item.text := entry.text;
				if entry.edited then
					item.edited := true;
				if not entry.body then
					begin
					RemoveSlot ( item, 'attachment );
					item.body := nil;
					end;
				end;
			...



		C_RouteSlipProto function "GenerateText"
			...
			// WAS:
			//fields.text := "";
			// NEW:
			fields.text := target.text;
			if target.edited then fields.edited := true;
			if ClassOf ( target) = 'enRouteMailText and
			( not target.appSymbol
			or target.appSymbol = 'mail
			or target.appSymbol = 'iobox ) then
				begin
				if not target.attachment then
					begin
					RemoveSlot ( fields, 'attachment );
					fields.body := nil;
					fields.__textOnly := true;
					end;
				end;
			...
			// WAS:
			//if tScrpt then
			// NEW:
			if tScrpt and not target.edited then
				if IsSymbol(tScrpt) and apSym then
					fields.text := Perform ( apSym, tScrpt, [fields, target] );
				else if IsFunction(tScrpt) then
					fields.text := call tScrpt with (fields, target);

			// LRT - 97/03/16 2:38 PM
			// MOVED from above
			if not fields.text then
				fields.text := "";
			...


		C_RouteSlipProto function "ShrinkMessage"
			...
			if fields.__textOnly then
				begin
				RemoveSlot ( fields, 'attachment );
				fields.body := nil;
				end;
			...



EnRoute Core 1.4.1a2

	// LRT - 97/03/22 4:09 AM
	If "Add Sender To Names" can add an address to an existing
	name card rather than creating a new one, it should.
	Added code to C_Transport function "TS_NameAdd"

	TS_NameAdd:	func(doit)
			begin
			if doit then
				begin
				// LRT - 97/03/22 4:09 AM
				// NEW:
				// if we can add this address to an existing card we should
				if nameToAdd.name and StrFilled(nameToAdd.name.last) then
					begin
					local sortOn := TrimString ( nameToAdd.name.last && nameToAdd.name.first );
					local names := GetUnionSoup ( ROM_cardfilesoupname );
					local c := names:Query ( {type: 'words, words: [ sortOn ] } );
					local e := c:Entry();
					if e then
						begin
						if not e.email then
							e.email := nameToAdd.email;
						else
							begin
							if not HasSlot ( e, 'emailAddrs ) then
								e.emailAddrs := [];
							AddArraySlot ( e.emailAddrs,
								{
								email: nameToAdd.email,
								} );
							end;
						EntryChangeXmit ( e, nil );

						PlaySound ( ROM_plunk );
						return;
						end;
					end;
				// end of NEW 97/03/22 4:09 AM

				protoPeopleDataDef:NewEntry ( Clone ( nameToAdd ), nil );
				// LRT - 96/12/06 5:06 AM
				// as requested by Apple
				PlaySound ( ROM_plunk );
				end;
			end



	// LRT - 97/03/23 6:39 PM
	Stop using StrFilter on message title in:
		C_RouteSlipProto function "SetupTitle"
		C_RouteSlip function "PrepareToSend2"
		C_RouteSlip Subject picker function "PopIt"
	which blindly removed all but 7-bit US-ASCII from the message title.
	Allow transports to decide what to do with the title!



	// LRT - 97/03/22 6:20 AM
	// extended the plugin architecture for transport.rxExtns
	// to allow post-itemCompleted message manipulation.

	C_Transport.ItemCompleted:

		func ( item, state, err )
			begin
			local st := state;

			if not st then st := item.state;

			local doXtns;
			local extn;

			try
				begin
				doXtns := transport exists and transport.rxExtns
					and Length ( transport.rxExtns ) > 0;

				if doXtns then
					begin
					foreach extn in transport.rxExtns do
						begin
						local xf := {
							_parent:	self,
							_proto:		extn,
							};
							xf:?XPreItemCompleted ( item, st, err );
						end;
					end;
				end;
			onexception |evt.ex| do nil;

			inherited:ItemCompleted ( item, state, err );


			// LRT - 97/03/22 6:20 PM
			// NEW 1.4.1 + plugins can have "XPostItemCompleted" func
			//=======================================================

			if doXtns then
				begin
				try
					begin
					foreach extn in transport.rxExtns do
						begin
						local xf := {
							_parent:	self,
							_proto:		extn,
							};
							xf:?XPostItemCompleted ( item, st, err );
						end;
					end;
				onexception |evt.ex| do nil;
				end;
			end




EnRoute i-net 1.4.1a1

	// LRT - 97/03/18 2:12 AM
	Implemented fix for MacIP which should repair the NIE 1.2 bug
	- More rigourous insurance that I won't use undocumented slots
	unless they are known to be something I need so that we will
	not have a problem with values we don't expect.
	N1_Transport NIE GrabLink callback
	AS:
		...
		if newStatus.info	// NEW: check for slot before use
		and IsSymbol ( newStatus.info )	// MAKE CERTAIN WE KNOW IT
		and HasSlot ( myTitlesFrame, newStatus.info ) then
			begin
			...



EnRoute i-net 1.4.1a2

	// LRT - 97/03/20 7:24 PM
	Try to prevent the "Celso P. Maiolo" <> from address
	bug caused by having an owner card which has ONLY a
	cc:Mail or QuickMail email address
		N1_Transport function "epcon"
			...
			// OLD WAY:
			//if userMails and Length(userMails) > 0 then
			//	begin
			//	local fromRef := Clone ( userMails[0] );
			//	end;
			//enRoute._fromEmailAddr  := if fromRef and fromRef.email then
			//		:NormalizeAddress ( fromRef );
			//	else
			//		nil;
			// NEW <post-1.4>
			if userMails and Length(userMails) > 0 then
				begin
				local i;
				for i := 0 to Length(userMails) - 1 do
					begin
					local fromRef := Clone ( userMails[i] );
					enRoute._fromEmailAddr := if fromRef and fromRef.email then
						:NormalizeAddress ( fromRef );
					if StrFilled ( enRoute._fromEmailAddr ) then
						break;
					end;
				end;
			...



	// LRT - 97/03/20 7:13 PM
	Fix for owner email address incorrectly resolved to empty string
	from cc:Mail or QuickMail non-internet formats.
		N1_Transport function "epcon"
			...
			// NEW:
			if not StrFilled ( enRoute._fromEmailAddr ) then
				enRoute._fromEmailAddr  := nil;
			// NIL causes us to use owner's "POP Username"@"POP Host"
			...



	// LRT - 97/03/24 4:47 PM
	Added code to translate non-USASCII characters in subject to 7-bit
	equivalent using the same function that is used to convert the
	message body text.
		N1_Service function "SM_SMTP"
			...
			// WAS:
			//local msgSubj := StringFilter ( currentItem.title, kStd7BitASCIIChars, 'passAll );
			// NEW:
			local msgSubj;
			local convFunc := func ( str, newOff )
				begin
				msgSubj := str;
				nil;			// exit from "kWrapTxAsyncFunc"
				end;

			local bin := MakeBinary ( 512, 'binary );
			call kWrapTxAsyncFunc with ( currentItem.title, bin,
				0, 128, convFunc, NIL );

			TrimString ( msgSubj );		// remove trailing <CR>

			// Place this 7-bit US-ASCII conversion back
			// into the message item's title slot
			// (no need to EntryChange due to itemCompleted later)
			currentItem.title := msgSubj;

			if kDebugOn then			// TEST
				begin
				write ( "SUBJECT: " );
				print ( msgSubj );
				end;
			// end of NEW 97/03/24 4:47 PM
			...



	// LRT - 97/03/24 4:47 PM
	Added code to translate non-USASCII characters in file names to 7-bit
	equivalent using the same function that is used to convert the
	message body text.
		N1.funcDefs2 function "k_EncMakeHeaderFunc"
			...
			// WAS:
			//enc.fName := TrimString ( enc.fName );
			// NEW:
			local usAscii;
			local convFunc := func ( str, newOff )
				begin
				usAscii := str;
				nil;			// exit from "kWrapTxAsyncFunc"
				end;

			local bin := MakeBinary ( 512, 'binary );
			call kWrapTxAsyncFunc with ( enc.fName, bin,
				0, 128, convFunc, NIL );

			TrimString ( usAscii );		// remove trailing <CR>
			enc.fName := usAscii;
			// end of NEW 97/03/24 4:47 PM
			...

