create and delete events

This commit is contained in:
LubuWest 2022-11-15 22:02:09 +01:00
commit 400241ec6a
34 changed files with 1346 additions and 614 deletions

View file

@ -134,17 +134,30 @@ WorkerScript.onMessage = function(msg) {
if (msg.method=="conversation"){
if (j==0){newsitemobject.indent=0}else{
var count=0;
var firstReply=0;
for (var k=msg.model.count-1;k>-1;k--){
//print("newsitemobject.in_reply_to_status_id "+newsitemobject.in_reply_to_status_id+" msg.model.get(k).newsitemobject.in_reply_to_status_id "+msg.model.get(k).newsitemobject.in_reply_to_status_id)
if (newsitemobject.in_reply_to_status_id==msg.model.get(k).newsitemobject.id){
newsitemobject.indent=(msg.model.get(k).newsitemobject.indent||0)+1;
if (newsitemobject.indent>6){newsitemobject.indent=6};
firstReply=k;
//break;
}
if (newsitemobject.in_reply_to_status_id==msg.model.get(k).newsitemobject.in_reply_to_status_id){
count+=1
}
}
}}
}}
data=({"newsitemobject": newsitemobject})
}
if(msg.method=="append") {
msg.model.insert(j, data)}
msg.model.insert(j, data)
} else if (msg.method=="conversation" && firstReply>0){
//print("j "+j +" firstReply "+firstReply+" count "+count)
msg.model.insert(firstReply+count+1, data)
}
else{
msg.model.append(data)
}