Skip to content
Snippets Groups Projects
Commit 1a470cc4 authored by echicken's avatar echicken :chicken:
Browse files

Always set from_ext when posting a reply. Should resolve issue #221 (Mortifis).

parent 4aeba61c
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1363 passed
...@@ -331,7 +331,7 @@ function get_mail_headers(filter, ascending) { ...@@ -331,7 +331,7 @@ function get_mail_headers(filter, ascending) {
h.attr&MSG_READ ? ret.sent.read++ : (ret.sent.unread++); h.attr&MSG_READ ? ret.sent.read++ : (ret.sent.unread++);
if (filter == 'sent') ret.headers.push(h); if (filter == 'sent') ret.headers.push(h);
} }
if (h.to_ext == user.number) { if (h.to_ext == user.number) {
if (is_spam(h)) { if (is_spam(h)) {
h.attr&MSG_READ ? ret.spam.read++ : (ret.spam.unread++); h.attr&MSG_READ ? ret.spam.read++ : (ret.spam.unread++);
if (filter == 'spam') ret.headers.push(h); if (filter == 'spam') ret.headers.push(h);
...@@ -440,7 +440,7 @@ function getSignature() { ...@@ -440,7 +440,7 @@ function getSignature() {
function postMessage(sub, header, body) { function postMessage(sub, header, body) {
var ret = false; var ret = false;
if (user.alias === settings.guest || if (user.alias === settings.guest ||
typeof msg_area.sub[sub] === 'undefined' || msg_area.sub[sub] === undefined ||
!msg_area.sub[sub].can_post || !msg_area.sub[sub].can_post ||
typeof header.to !== 'string' || typeof header.to !== 'string' ||
header.to === '' || header.to === '' ||
...@@ -475,15 +475,10 @@ function postMessage(sub, header, body) { ...@@ -475,15 +475,10 @@ function postMessage(sub, header, body) {
// Called by postNew/postReply, not directly // Called by postNew/postReply, not directly
function postMail(header, body) { function postMail(header, body) {
// Lazy ARS checks; we could check the *type* of email being sent, I guess. // Lazy ARS checks; we could check the *type* of email being sent, I guess.
if (user.security.restrictions&UFLAG_E || if (user.security.restrictions&UFLAG_E || user.security.restrictions&UFLAG_M) {
user.security.restrictions&UFLAG_M
) {
return false; return false;
} }
if (typeof header.to !== 'string' || if (typeof header.to !== 'string' || typeof header.subject !== 'string' || typeof body !== 'string') {
typeof header.subject !== 'string' ||
typeof body !== 'string'
) {
return false; return false;
} }
var ret = false; var ret = false;
...@@ -537,12 +532,7 @@ function postNew(sub, to, subject, body) { ...@@ -537,12 +532,7 @@ function postNew(sub, to, subject, body) {
// Add a new message to 'sub' in reply to parent message 'pid' // Add a new message to 'sub' in reply to parent message 'pid'
function postReply(sub, body, pid) { function postReply(sub, body, pid) {
var ret = false; var ret = false;
if ( typeof sub !== 'string' || if (typeof sub !== 'string' || typeof body !== 'string' || typeof pid !== 'number') return ret;
typeof body !== 'string' ||
typeof pid !== 'number'
) {
return ret;
}
try { try {
var msgBase = new MsgBase(sub); var msgBase = new MsgBase(sub);
msgBase.open(); msgBase.open();
...@@ -550,15 +540,12 @@ function postReply(sub, body, pid) { ...@@ -550,15 +540,12 @@ function postReply(sub, body, pid) {
msgBase.close(); msgBase.close();
if (pHeader === null) return ret; if (pHeader === null) return ret;
var header = { var header = {
'to' : pHeader.from == user.alias ? pHeader.to : pHeader.from, to: pHeader.from == user.alias ? pHeader.to : pHeader.from,
'from' : user.alias, from: user.alias,
'subject' : pHeader.subject, from_ext: user.number,
'thread_id' : ( subject: pHeader.subject,
typeof pHeader.thread_id === 'undefined' thread_id: pHeader.thread_id === undefined ? pHeader.number : pHeader.thread_id,
? pHeader.number thread_back: pHeader.number,
: pHeader.thread_id
),
'thread_back' : pHeader.number
}; };
if (sub === 'mail') { if (sub === 'mail') {
if (typeof pHeader.from_net_addr !== 'undefined') { if (typeof pHeader.from_net_addr !== 'undefined') {
......
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