(no commit message)
authorJean-Philippe Orsini <jeanfi@gmail.com>
Mon, 29 Apr 2013 21:53:51 +0000 (21:53 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Mon, 29 Apr 2013 21:53:51 +0000 (21:53 +0000)
src/main.c
src/ttrss_ws.c

index 39ad7c3..132aec1 100644 (file)
@@ -130,14 +130,13 @@ void update()
                                   COL_FEED_ID, (*feeds)->id,
                                   -1);
                free(title);
                                   COL_FEED_ID, (*feeds)->id,
                                   -1);
                free(title);
+
+               ttrs_download_headline_content(feeds);
+
                feeds++;
        }
        model_state = 0;
 
                feeds++;
        }
        model_state = 0;
 
-       feeds = ttrss_get_feeds();
-       if (feeds)
-               ttrs_download_headline_content(feeds);
-
        log_debug("update() done");
 }
 
        log_debug("update() done");
 }
 
index 4b9c040..0aed58d 100644 (file)
@@ -245,7 +245,6 @@ int ws_open_session()
                        session_id = NULL;
                        result = 0;
                }
                        session_id = NULL;
                        result = 0;
                }
-               result = 1;
        } else {
                result =  0;
        }
        } else {
                result =  0;
        }
@@ -331,6 +330,12 @@ int ws_update_headlines(struct feed *feed)
                        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);
                }
+
+               if (!feed->headlines) {
+                       feed->headlines = malloc(sizeof(struct headline *));
+                       *(feed->headlines) = NULL;
+               }
+
                json_object_put(rp);
                return 1;
        } else {
                json_object_put(rp);
                return 1;
        } else {