From dd1fef6f98f48a513d225dc28d5e855038bea090 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 2 Jan 2024 22:41:50 +1100 Subject: [PATCH] Frames received via FTN packets, tags are not set, so we'll use the 'to' user --- load/page.js | 7 ++++--- tools/frame_load.js | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/load/page.js b/load/page.js index 9a030b3..6c6b2df 100644 --- a/load/page.js +++ b/load/page.js @@ -971,11 +971,12 @@ function Page(debug) { } var msg; - // Find existing message with the page number and delete it if defined + // Find existing message with the page number for(var x in headers) { - if ((headers[x].tags === page.toString()) && (!(headers[x].attr&MSG_DELETE)) && (headers[x].from === SESSION_EXT)) { + if ((!(headers[x].attr&MSG_DELETE)) && (headers[x].to === page.toString()) && (headers[x].from === SESSION_EXT)) { msg = headers[x]; - break; + //break; @todo We'll take the last one that matches, if there are more than one. + // @todo In the case of frames coming via FTN packets, we are not currently deleting old entries } } diff --git a/tools/frame_load.js b/tools/frame_load.js index 4a7a688..3b3e510 100644 --- a/tools/frame_load.js +++ b/tools/frame_load.js @@ -32,6 +32,10 @@ switch (ext) { } var page = new Page(); -page.get(new PageObject(frame,index)); -page.import(file,ext); -page.save(); +if (page.get(new PageObject(frame,index))) { + page.import(file,ext); + page.save(); + +} else { + throw new Error('Page '+frame+index+' doesnt exist?'); +}