/*
* RSS feed generator (could be adapted in the future to feed both RSS and Atom)
*
- * Copyright (c) 2010 by the citadel.org team
+ * Copyright (c) 2010-2011 by the citadel.org team
*
* This program is open source software. You can redistribute it and/or
* modify it under the terms of the GNU General Public License as
int in_body = 0;
int found_title = 0;
char pubdate[128];
+ StrBuf *messagetext = NULL;
/* FIXME if this is a blog room we only want to include top-level messages */
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
if (in_body) {
- cdataout(buf);
- wc_printf("\r\n");
+ StrBufAppendBufPlain(messagetext, buf, -1, 0);
+ StrBufAppendBufPlain(messagetext, HKEY("\r\n"), 0);
}
else if (!strncasecmp(buf, "subj=", 5)) {
wc_printf("<title>");
}
wc_printf("<description>");
in_body = 1;
+ messagetext = NewStrBuf();
}
}
if (in_body) {
+ cdataout((char*)ChrPtr(messagetext));
+ FreeStrBuf(&messagetext);
wc_printf("</description>");
}