1
0
Fork 0

Bug fix: Keep message ID constant even when message crosses multiple interfaces (mm1, mm7, etc)

This commit is contained in:
bagyenda 2005-09-27 16:34:40 +00:00
parent 593cf0436b
commit 88d7ff9a84
1 changed files with 12 additions and 5 deletions

View File

@ -628,7 +628,7 @@ Octstr *mms_queue_add(Octstr *from, List *to,
MmsEnvelope *e;
Octstr *msgid, *s = NULL, *r = NULL;
Octstr *ms, *res = NULL, *xfrom = NULL;
int mtype;
fd = mkqf(qf, subdir, directory);
if (fd < 0) {
@ -636,14 +636,20 @@ Octstr *mms_queue_add(Octstr *from, List *to,
return NULL;
}
res = xmake_qf(qf, subdir);
res = xmake_qf(qf, subdir);
mtype = mms_messagetype(m);
/* Get MsgID, Fixup if not there and needed. */
if ((msgid = mms_get_header_value(m, octstr_imm("Message-ID"))) == NULL) {
msgid = mms_maketransid(octstr_get_cstr(res), mmscname);
if (mtype == MMS_MSGTYPE_SEND_REQ)
mms_replace_header_value(m, "Message-ID", octstr_get_cstr(msgid));
}
ms = mms_tobinary(m); /* Convert message to string. */
msgid = mms_maketransid(octstr_get_cstr(res), mmscname);
xfrom = copy_and_clean_address(from);
e = gw_malloc(sizeof *e); /* Make envelope, clear it. */
memset(e, 0, sizeof *e);
@ -653,7 +659,7 @@ Octstr *mms_queue_add(Octstr *from, List *to,
e->qf.fd = fd;
e->msgtype = mms_messagetype(m);
e->msgtype = mtype;
e->from = xfrom;
e->created = time(NULL);
e->sendt = senddate;
@ -730,6 +736,7 @@ Octstr *mms_queue_add(Octstr *from, List *to,
if (xfrom)
octstr_destroy(xfrom);
return res;
}