I noticed today that FileFix does not set a REPLY kludge to responses
but AreaFix does. Is there a way I can enable this?
I ended up asking Codex to take a look at the problem. I filed a Github issue regarding this as well.
https://github.com/huskyproject/htick/issues/18
Just in case this helps someone else:
Summary
=======
This change fixes reply-linkage handling in `htick/src/scan.c`,
specifically in `convertMsgText()`.
Old behavior:
- Read the control buffer into `ctrlBuff`
- Convert `ctrlBuff` into printable kludge lines with `CvtCtrlToKludge()`
- Prepend those kludge lines to `msg->text`
- Free the original control buffer
New behavior:
- Read the control buffer into `ctrlBuff`
- Keep the raw control buffer by assigning it to `msg->ctl`
- Store the control buffer length in `msg->ctlLength`
- Build `msg->text` from the message body plus the generated Via line only
- Explicitly terminate `msg->text` and update `msg->textLength`
Why this matters:
- Reply metadata such as MSGID and REPLY stays available in the control data
- Later code can inspect the real control buffer instead of reparsing text
- The message body no longer gets synthetic kludge text prepended to it
Minimal patch
=============
Apply this patch from the repository root with:
patch -p1 < filefix-reply-fix.diff
Patch contents:
--- a/htick/src/scan.c
+++ b/htick/src/scan.c
@@ -74,15 +74,16 @@
void convertMsgText(HMSG SQmsg, s_message * msg, hs_addr ourAka)
{
- char * kludgeLines, viaLine[100];
+ char viaLine[100];
UCHAR * ctrlBuff;
UINT32 ctrlLen;
time_t tm;
struct tm * dt;
- /* get kludge lines */
+ /* preserve raw control data so RetMsg() can recover MSGID/REPLY linkage */
ctrlLen = MsgGetCtrlLen(SQmsg);
ctrlBuff = (unsigned char *)smalloc(ctrlLen + 1);
MsgReadMsg(SQmsg, NULL, 0, 0, NULL, ctrlLen, ctrlBuff);
- kludgeLines = (char *)CvtCtrlToKludge(ctrlBuff);
- nfree(ctrlBuff);
+ ctrlBuff[ctrlLen] = '\0';
+ msg->ctl = (char *)ctrlBuff;
+ msg->ctlLength = (hINT32)ctrlLen;
/* make text */
msg->textLength = MsgGetTextLen(SQmsg);
@@ -105,21 +106,18 @@
- msg->text = (char *)scalloc(1, msg->textLength + strlen(kludgeLines)
- + strlen(viaLine) + 1);
- strcpy(msg->text, kludgeLines);
-/*