projects
/
prss.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0d88bb9
)
(no commit message)
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 24 Apr 2013 12:29:47 +0000
(12:29 +0000)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 24 Apr 2013 12:29:47 +0000
(12:29 +0000)
src/ttrss.c
patch
|
blob
|
history
diff --git
a/src/ttrss.c
b/src/ttrss.c
index
3649b07
..
f955cee
100644
(file)
--- a/
src/ttrss.c
+++ b/
src/ttrss.c
@@
-65,6
+65,11
@@
static void **list_add(void **list, void *item)
return result;
}
return result;
}
+struct headline **
+headlines_add(struct headline **list, struct headline *h)
+{
+ return (struct headline **)list_add((void **)list, (void *)h);
+}
struct headline *feed_get_headline(struct feed *feed, int id)
{
struct headline *feed_get_headline(struct feed *feed, int id)
{
@@
-285,18
+290,24
@@
int ws_update_headlines(struct feed *feed)
h->id = hid;
h->excerpt = NULL;
h->content = NULL;
h->id = hid;
h->excerpt = NULL;
h->content = NULL;
+ h->title = NULL;
+ h->url = NULL;
- tmp =
(struct headline **)list_add((void **)
feed->headlines, h);
+ tmp =
headlines_add(
feed->headlines, h);
if (feed->headlines)
free(feed->headlines);
feed->headlines = tmp;
}
if (feed->headlines)
free(feed->headlines);
feed->headlines = tmp;
}
- j = json_object_object_get(jheadline, "title");
- h->title = strdup(json_object_get_string(j));
+ if (!h->title) {
+ j = json_object_object_get(jheadline, "title");
+ h->title = strdup(json_object_get_string(j));
+ }
- j = json_object_object_get(jheadline, "link");
- h->url = strdup(json_object_get_string(j));
+ if (!h->url) {
+ j = json_object_object_get(jheadline, "link");
+ h->url = strdup(json_object_get_string(j));
+ }
j = json_object_object_get(jheadline, "unread");
h->unread = json_object_get_boolean(j);
j = json_object_object_get(jheadline, "unread");
h->unread = json_object_get_boolean(j);