diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2024-03-07 22:03:49 +0000 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2024-03-07 22:03:49 +0000 |
| commit | bd655ed5aaca74f5bbf4b04a07dc1221a8154940 (patch) | |
| tree | 0d85a65015e8b90e6f6374480f5290c9553306d5 /src | |
| parent | 96ca4dc77f783c11b12111fbd0a54219f7448113 (diff) | |
Single spaces
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -19,7 +19,7 @@ app.post('/sms', (req, res) => { console.debug(` Received a text from ${senderCountry} on number ${senderPhoneNumber}. Message content: ${body}. End of message - `); + `.replace(/ +/g, ' ')); if (isSubscribed(senderPhoneNumber)) { const senderSubscription = getSubscriptionFromNumber(senderPhoneNumber); @@ -33,7 +33,7 @@ app.post('/sms', (req, res) => { const confirmationMessage = ` Your message was forwarded to ${otherSubscriptions.length()} recipients: "${abbreviatedBody}". Only you can see this message. - `; + `.replace(/ +/g, ' '); sendTextMessage([senderSubscription], confirmationMessage); } else { if (body.toLocaleLowerCase().startsWith('my name is ') || body.toLocaleLowerCase().startsWith('my name is: ')) { @@ -51,14 +51,14 @@ app.post('/sms', (req, res) => { Well done, ${senderName}! You have successfully subscribed to the Glen Coe meet texting group. You will now be able to send and receive messages to and from the group. - `; + `.replace(/ +/g, ' '); sendTextMessage([subscription], welcomeMessage); } else { const twiml = new MessagingResponse(); twiml.message(` You are not subscribed to this texting group. To subscribe, send a text to this number with this syntax: my name is <your name> - `); + `.replace(/ +/g, ' ')); res.type('text/xml').send(twiml.toString()); return; } |
