now honoring updates

This commit is contained in:
Jeena 2013-10-10 10:25:26 +02:00
parent 40307c8619
commit 3e4f24c927

View file

@ -75,17 +75,16 @@ function(Core, APICalls, HostApp, URI) {
if(!append) { if(!append) {
this.since_id = status.id; this.since_id = status.id;
this.since_id_entity = status.entity; this.since_id_entity = status.entity;
this.since_time = status.received_at; //this.since_time = status.received_at;
this.since_time = status.version.received_at;
} }
// if(status.id == "vBf0UALAJ97LnvJN4f6sBw") debug(status);
if (status.type.startsWith("https://tent.io/types/status/v0#")) { if (status.type.startsWith("https://tent.io/types/status/v0#")) {
var new_node = this.getStatusDOMElement(status, _statuses.refs); var new_node = this.getStatusDOMElement(status, _statuses.refs);
var old_node = document.getElementById(new_node.id);
if (!document.getElementById(new_node.id)) {
if (!old_node) {
if(!append && this.body.childNodes.length > 0) { if(!append && this.body.childNodes.length > 0) {
if(this.body.childNodes.length > this.max_length) { if(this.body.childNodes.length > this.max_length) {
@ -99,6 +98,9 @@ function(Core, APICalls, HostApp, URI) {
this.body.appendChild(new_node); this.body.appendChild(new_node);
} }
} else {
debug(new_node.id);
old_node.parentNode.replaceChild(new_node, old_node);
} }
} else if (status.type == "https://tent.io/types/delete/v0#") { } else if (status.type == "https://tent.io/types/delete/v0#") {
@ -138,6 +140,7 @@ function(Core, APICalls, HostApp, URI) {
uri.addSearch("limit", this.posts_limit); uri.addSearch("limit", this.posts_limit);
uri.addSearch("max_refs", 20); uri.addSearch("max_refs", 20);
uri.addSearch("profiles", "entity"); uri.addSearch("profiles", "entity");
uri.addSearch("sort_by", "version.received_at");
if(this.since_time) { if(this.since_time) {
uri.addSearch("since", this.since_time); uri.addSearch("since", this.since_time);