Skip to content
Snippets Groups Projects
Commit c71fd62a authored by rswindell's avatar rswindell
Browse files

Re-read the user property file for each telegram sent to get the recipient list

(which is updated by sbbsimsg_lib.send_msg() now).
parent ef405493
No related branches found
No related tags found
No related merge requests found
...@@ -35,13 +35,8 @@ if(!options) ...@@ -35,13 +35,8 @@ if(!options)
if(!options.from_user_prop) if(!options.from_user_prop)
options.from_user_prop = "alias"; options.from_user_prop = "alias";
var userprops = load({}, "userprops.js"); var userprops = load({}, "userprops.js");
var ini_section = "imsg sent";
var addr_list = userprops.get(ini_section, "address", []);
var last_send = userprops.get(ini_section, "localtime");
var lib = load({}, "sbbsimsg_lib.js"); var lib = load({}, "sbbsimsg_lib.js");
const RcptAddressHistoryLength = 10;
var last_user=0; var last_user=0;
lib.read_sys_list(); lib.read_sys_list();
...@@ -154,9 +149,9 @@ function imsg_user_list() ...@@ -154,9 +149,9 @@ function imsg_user_list()
return imsg_user; return imsg_user;
} }
function get_default_dest() function get_default_dest(addr_list, last_send)
{ {
var rx = userprops.get("imsg received"); var rx = userprops.get(lib.props_recv);
if(rx && rx.localtime && (!last_send || new Date(rx.localtime) > new Date(last_send))) { if(rx && rx.localtime && (!last_send || new Date(rx.localtime) > new Date(last_send))) {
var sys = lib.sys_list[rx.ip_address]; var sys = lib.sys_list[rx.ip_address];
...@@ -225,8 +220,10 @@ while(bbs.online) { ...@@ -225,8 +220,10 @@ while(bbs.online) {
break; break;
case 'T': case 'T':
printf("\1h\1cTelegram\r\n\r\n"); printf("\1h\1cTelegram\r\n\r\n");
var addr_list = userprops.get(lib.props_sent, "address", []);
var last_send = userprops.get(lib.props_sent, "localtime");
printf("\1n\1h\1y(user@hostname): \1w"); printf("\1n\1h\1y(user@hostname): \1w");
dest=console.getstr(get_default_dest(),64,K_EDIT|K_AUTODEL, addr_list); dest=console.getstr(get_default_dest(addr_list, last_send),64,K_EDIT|K_AUTODEL, addr_list);
if(dest==null || dest=='' || console.aborted) if(dest==null || dest=='' || console.aborted)
break; break;
if((msg=getmsg())=='') if((msg=getmsg())=='')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment