summaryrefslogtreecommitdiff
path: root/src/mimehooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mimehooks.c')
-rw-r--r--src/mimehooks.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mimehooks.c b/src/mimehooks.c
index b2110cfb..c9aed9bb 100644
--- a/src/mimehooks.c
+++ b/src/mimehooks.c
@@ -80,6 +80,7 @@ static iRegExp *xmlMimePattern_(void) {
80 80
81static iBlock *translateAtomXmlToGeminiFeed_(const iString *mime, const iBlock *source, 81static iBlock *translateAtomXmlToGeminiFeed_(const iString *mime, const iBlock *source,
82 const iString *requestUrl) { 82 const iString *requestUrl) {
83 iUnused(requestUrl); /* TODO: Use for what? */
83 iRegExpMatch m; 84 iRegExpMatch m;
84 init_RegExpMatch(&m); 85 init_RegExpMatch(&m);
85 if (!matchString_RegExp(xmlMimePattern_(), mime, &m)) { 86 if (!matchString_RegExp(xmlMimePattern_(), mime, &m)) {
@@ -126,12 +127,17 @@ static iBlock *translateAtomXmlToGeminiFeed_(const iString *mime, const iBlock *
126 if (isEmpty_String(title)) { 127 if (isEmpty_String(title)) {
127 continue; 128 continue;
128 } 129 }
130 const iString *published =
131 collect_String(decodedContent_XmlElement(child_XmlElement(entry, "published")));
129 const iString *updated = 132 const iString *updated =
130 collect_String(decodedContent_XmlElement(child_XmlElement(entry, "updated"))); 133 collect_String(decodedContent_XmlElement(child_XmlElement(entry, "updated")));
131 iRegExpMatch m; 134 iRegExpMatch m;
132 init_RegExpMatch(&m); 135 init_RegExpMatch(&m);
133 if (!matchString_RegExp(datePattern, updated, &m)) { 136 if (!matchString_RegExp(datePattern, updated, &m)) {
134 continue; 137 init_RegExpMatch(&m);
138 if (!matchString_RegExp(datePattern, published, &m)) {
139 continue;
140 }
135 } 141 }
136 iRangecc url = iNullRange; 142 iRangecc url = iNullRange;
137 iConstForEach(PtrArray, j, &entry->children) { 143 iConstForEach(PtrArray, j, &entry->children) {
@@ -140,7 +146,7 @@ static iBlock *translateAtomXmlToGeminiFeed_(const iString *mime, const iBlock *
140 continue; 146 continue;
141 } 147 }
142 const iRangecc href = attribute_XmlElement(link, "href"); 148 const iRangecc href = attribute_XmlElement(link, "href");
143 const iRangecc rel = attribute_XmlElement(link, "rel"); 149 const iRangecc rel = attribute_XmlElement(link, "rel");
144 const iRangecc type = attribute_XmlElement(link, "type"); 150 const iRangecc type = attribute_XmlElement(link, "type");
145 if (startsWithCase_Rangecc(href, "gemini:")) { 151 if (startsWithCase_Rangecc(href, "gemini:")) {
146 url = href; 152 url = href;