- else if (!strncasecmp(buf, "wefw=", 5)) {
- int rrtok;
- int rrlen;
- safestrncpy(wefw, &buf[5], sizeof wefw);
-
- /* Trim down excessively long lists of thread references. We eliminate the
- * second one in the list so that the thread root remains intact.
- */
- rrtok = num_tokens(wefw, '|');
- rrlen = strlen(wefw);
- if ( ((rrtok >= 3) && (rrlen > 900)) || (rrtok > 10) ) {
- remove_token(wefw, 1, '|');
- }
- }
-
- else if (!strncasecmp(buf, "msgn=", 5)) {
- safestrncpy(msgn, &buf[5], sizeof msgn);
- }
-
- else if (!strncasecmp(buf, "from=", 5)) {
- safestrncpy(from, &buf[5], sizeof from);
- for (i=0; i<strlen(from); ++i) {
- if (from[i] == ',') from[i] = ' ';
- }
- }
+ StrBuf_ServGetln(Line);
+ if (GetServerStatusMsg(Line, NULL, 0, 0) == 1)
+ while (len = StrBuf_ServGetln(Line), (len >= 0) && ((len != 3) || strcmp(ChrPtr(Line), "000"))) {
+ eMessageField which;
+ if ((StrLength(Line) > 4) && (ChrPtr(Line)[4] == '=') && GetFieldFromMnemonic(&which, ChrPtr(Line))) switch (which) {
+ case eMsgSubject: {
+ StrBuf *subj = NewStrBuf();
+ StrBuf *FlatSubject;
+
+ if (ReplyMode == eForward) {
+ if (strncasecmp(ChrPtr(Line) + 5, "Fw:", 3)) {
+ StrBufAppendBufPlain(subj, HKEY("Fw: "), 0);
+ }
+ }
+ else {
+ if (strncasecmp(ChrPtr(Line) + 5, "Re:", 3)) {
+ StrBufAppendBufPlain(subj, HKEY("Re: "), 0);
+ }
+ }
+ StrBufAppendBufPlain(subj,
+ ChrPtr(Line) + 5,
+ StrLength(Line) - 5, 0);
+ FlatSubject = NewStrBufPlain(NULL, StrLength(subj));
+ StrBuf_RFC822_to_Utf8(FlatSubject, subj, NULL, NULL);
+
+ PutBstr(HKEY("subject"), FlatSubject);
+ }
+ break;