(no commit message)
[prss.git] / src / ttrss.c
index a9fb0f8..64a0375 100644 (file)
@@ -38,11 +38,7 @@ const char *ttrss_get_headline_content(struct headline *h)
 
 struct feed **ttrss_get_feeds()
 {
-       struct feed **tmp;
-
-       tmp = ws_update_feeds(data);
-       feeds_free(data);
-       data = tmp;
+       data = ws_update_feeds(data);
 
        return data;
 }
@@ -56,7 +52,7 @@ struct headline **ttrss_feed_get_headlines(struct feed *f)
 }
 
 void ttrss_set_article_unread(int id, int unread)
-{
+{      
        struct json_object *rp, *rq;
 
        printf("ttrss_set_article_unread %d %d\n", id, unread);
@@ -78,3 +74,8 @@ void ttrss_set_config(const char *url, const char *user, const char *pwd)
        data = NULL;
        ws_init(url, user, pwd);
 }
+
+struct feed *ttrss_get_feed(int id)
+{
+       return feeds_get_feed(data, id);
+}