]> git.wh0rd.org - tt-rss.git/commitdiff
add missing pubsub pings to operations changing the article published status
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 1 Apr 2011 12:58:34 +0000 (16:58 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 1 Apr 2011 12:58:34 +0000 (16:58 +0400)
functions.php

index 5adf46cdf2f868379b5fef7b8c30607ce2fd5c56..46502cd1a5248654881a826cbd4d2a4720136246 100644 (file)
                                                        VALUES ('$ref_id', '$owner_uid', '$feed', $unread,
                                                                $last_read_qpart, $marked, $published, '$score', '', '')");
 
+                                               if (PUBSUBHUBBUB_HUB && $published == 'true') {
+                                                       $rss_link = get_self_url_prefix() .
+                                                               "/backend.php?op=rss&id=-2&key=" .
+                                                               get_feed_access_key($link, -2, false);
+
+                                                       $p = new Publisher(PUBSUBHUBBUB_HUB);
+
+                                                       $pubsub_result = $p->publish_update($rss_link);
+                                               }
+
                                                $result = db_query($link,
                                                        "SELECT int_id FROM ttrss_user_entries WHERE
                                                                ref_id = '$ref_id' AND owner_uid = '$owner_uid' AND
                        published = NOT published,last_read = NOW()
                        WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]);
                }
+
+               if (PUBSUBHUBBUB_HUB) {
+                       $rss_link = get_self_url_prefix() .
+                               "/backend.php?op=rss&id=-2&key=" .
+                               get_feed_access_key($link, -2, false);
+
+                       $p = new Publisher(PUBSUBHUBBUB_HUB);
+
+                       $pubsub_result = $p->publish_update($rss_link);
+               }
        }
 
        function catchupArticlesById($link, $ids, $cmode, $owner_uid = false) {