X-Git-Url: https://git.wpitchoune.net/gitweb/?p=prss.git;a=blobdiff_plain;f=src%2Fttrss_model.c;h=f08521acf3505c76f789d258e3e72774111f9e74;hp=a1cdcefc71666f07157315184d44c5ce9929a2ac;hb=7f50cedb88527a356ba2deeb15e1e959c58a3f57;hpb=48e7c0631ee3371b5cf6503417b4ec1c2b733176 diff --git a/src/ttrss_model.c b/src/ttrss_model.c index a1cdcef..f08521a 100644 --- a/src/ttrss_model.c +++ b/src/ttrss_model.c @@ -104,7 +104,7 @@ struct headline *headline_new(int id, const char *url, const char *title) h->unread = -1; h->excerpt = NULL; h->content = NULL; - + return h; } @@ -178,3 +178,22 @@ struct feed *feeds_get_feed(struct feed **feeds, int id) return NULL; } + +struct headline *feeds_get_headline(struct feed **feeds, int id) +{ + struct headline *h; + + if (!feeds) + return NULL; + + while (*feeds) { + h = feed_get_headline(*feeds, id); + + if (h) + return h; + + feeds++; + } + + return NULL; +}