fetch reply contexts only after saving the original set of entries
This commit is contained in:
parent
db006d58d6
commit
17da903db7
3 changed files with 9 additions and 7 deletions
|
@ -72,8 +72,10 @@ $(function(){
|
||||||
function webSocketSubscribe(topic) {
|
function webSocketSubscribe(topic) {
|
||||||
if ('WebSocket' in window) {
|
if ('WebSocket' in window) {
|
||||||
var ws = new WebSocket(window.location.origin
|
var ws = new WebSocket(window.location.origin
|
||||||
.replace(/https?:\/\//, 'ws://')
|
.replace(/http:\/\//, 'ws://')
|
||||||
.replace(/(:\d+)?$/, ':8077'));
|
.replace(/https:\/\//, 'wss://')
|
||||||
|
+ '/_updates');
|
||||||
|
|
||||||
ws.onopen = function(event) {
|
ws.onopen = function(event) {
|
||||||
// send the topic
|
// send the topic
|
||||||
console.log('subscribing to topic: ' + topic);
|
console.log('subscribing to topic: ' + topic);
|
||||||
|
|
|
@ -109,14 +109,14 @@ def process_feed(session, feed):
|
||||||
|
|
||||||
feed.entries.append(entry)
|
feed.entries.append(entry)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
for in_reply_to in entry.get_property('in-reply-to', []):
|
|
||||||
fetch_reply_context(entry.id, in_reply_to)
|
|
||||||
|
|
||||||
new_entries.append(entry)
|
new_entries.append(entry)
|
||||||
else:
|
else:
|
||||||
logger.info('skipping previously seen post %s', old.permalink)
|
logger.info('skipping previously seen post %s', old.permalink)
|
||||||
|
|
||||||
|
for entry in new_entries:
|
||||||
|
for in_reply_to in entry.get_property('in-reply-to', []):
|
||||||
|
fetch_reply_context(entry.id, in_reply_to)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
feed.last_checked = now
|
feed.last_checked = now
|
||||||
if new_entries:
|
if new_entries:
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{% if ws_topic %}
|
{% if ws_topic %}
|
||||||
<script>var WS_TOPIC = "{{ ws_topic }}";</script>
|
<script>var WS_TOPIC = "{{ ws_topic }}";</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<script src="{{url_for('static', filename='feed.js', version='2015-02-24')}}"></script>
|
<script src="{{url_for('static', filename='feed.js', version='2015-03-16')}}"></script>
|
||||||
|
|
||||||
{% if current_user and current_user.settings
|
{% if current_user and current_user.settings
|
||||||
and current_user.settings.get('reply-method') == 'indie-config' %}
|
and current_user.settings.get('reply-method') == 'indie-config' %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue