Skip to content
Snippets Groups Projects
Commit e7c72051 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Trim white-space from email/netmail addresses

parent 84259b35
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -15,7 +15,7 @@ const ini_section = "netmail sent"; ...@@ -15,7 +15,7 @@ const ini_section = "netmail sent";
const NetmailAddressHistoryLength = 10; const NetmailAddressHistoryLength = 10;
while(bbs.online && !console.aborted) { while(bbs.online) {
if(!(user.settings & USER_EXPERT)) if(!(user.settings & USER_EXPERT))
bbs.menu("e-mail"); bbs.menu("e-mail");
bbs.nodesync(); bbs.nodesync();
...@@ -42,7 +42,7 @@ while(bbs.online && !console.aborted) { ...@@ -42,7 +42,7 @@ while(bbs.online && !console.aborted) {
wm_mode = WM_FILE; wm_mode = WM_FILE;
case 'S': // Send Mail case 'S': // Send Mail
console.putmsg(bbs.text(text.Email)); console.putmsg(bbs.text(text.Email));
var name = console.getstr(40); var name = console.getstr(40, K_TRIM);
if(!name) if(!name)
break; break;
if(name.indexOf('@') > 0) { if(name.indexOf('@') > 0) {
...@@ -50,6 +50,8 @@ while(bbs.online && !console.aborted) { ...@@ -50,6 +50,8 @@ while(bbs.online && !console.aborted) {
break; break;
} }
var number = bbs.finduser(name); var number = bbs.finduser(name);
if(console.aborted)
break;
if(!number) if(!number)
number = system.matchuser(name); number = system.matchuser(name);
if(!number && (msg_area.settings&MM_REALNAME)) if(!number && (msg_area.settings&MM_REALNAME))
...@@ -68,7 +70,7 @@ while(bbs.online && !console.aborted) { ...@@ -68,7 +70,7 @@ while(bbs.online && !console.aborted) {
break; break;
console.putmsg(bbs.text(text.EnterNetMailAddress)); console.putmsg(bbs.text(text.EnterNetMailAddress));
var addr_list = userprops.get(ini_section, "address", []) || []; var addr_list = userprops.get(ini_section, "address", []) || [];
var addr = console.getstr(256, K_LINE, addr_list); var addr = console.getstr(256, K_LINE | K_TRIM, addr_list);
if(!addr || console.aborted) if(!addr || console.aborted)
break; break;
if(bbs.netmail(addr.split(','), wm_mode)) { if(bbs.netmail(addr.split(','), wm_mode)) {
...@@ -82,8 +84,7 @@ while(bbs.online && !console.aborted) { ...@@ -82,8 +84,7 @@ while(bbs.online && !console.aborted) {
userprops.set(ini_section, "localtime", new Date().toString()); userprops.set(ini_section, "localtime", new Date().toString());
} }
break; break;
case 'Q': // Quit default:
case '\r':
exit(0); exit(0);
case '?': // Display menu case '?': // Display menu
if(user.settings & USER_EXPERT) if(user.settings & USER_EXPERT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment