/*
- * Bring external RSS feeds into rooms.
+ * Bring external RSS and/or Atom feeds into rooms. This module implements a
+ * very loose parser that scrapes both kinds of feeds and is not picky about
+ * the standards compliance of the source data.
*
- * Copyright (c) 2007-2017 by the citadel.org team
+ * Copyright (c) 2007-2018 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 version 3.
}
}
- else if (!strcasecmp(el, "author")) { // author of item (rss and maybe atom)
+ else if (!strcasecmp(el, "creator")) { // <creator> can be used if <author> is not present
if ((r->msg != NULL) && (CM_IsEmpty(r->msg, eAuthor))) {
CM_SetField(r->msg, eAuthor, ChrPtr(r->CData), StrLength(r->CData));
striplt(r->msg->cm_fields[eAuthor]);
}
}
+ else if (!strcasecmp(el, "author")) { // <author> supercedes <creator> if both are present
+ if (r->msg != NULL) {
+ CM_SetField(r->msg, eAuthor, ChrPtr(r->CData), StrLength(r->CData)); // CM_SetField will free() the previous value
+ striplt(r->msg->cm_fields[eAuthor]);
+ }
+ }
+
else if (!strcasecmp(el, "pubdate")) { // date/time stamp (rss) Sat, 25 Feb 2017 14:28:01 EST
if ((r->msg)&&(r->msg->cm_fields[eTimestamp]==NULL)) {
CM_SetFieldLONG(r->msg, eTimestamp, parsedate(ChrPtr(r->CData)));