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

@ -39,7 +39,7 @@ function friendicaRequest(login,api,rootwindow,callback) {
try{
if (xhrequest.status==200){
callback(xhrequest.responseText)
}else{
}else{print("xhrequest.status "+xhrequest.status)
callback(xhrequest.responseText)
//showMessage("Error","API:\n" +login.server+api+"\n NO RESPONSE"+xhrequest.statusText,rootwindow);
}

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)
}

View file

@ -448,7 +448,7 @@ function updateContactInDB(login,database,isFriend,contact){// for newstab and f
});
}
function processNews(api,data){
function processNews(api,data){//print("processnews "+ " api "+ api + " data "+data);
try{var newslist=JSON.parse(data)} catch(e){print("processnews "+e+ " api "+ api + " data "+data);newsBusy.running=false;};
if (api=="/api/users/show"){
var usermessages=[];
@ -624,7 +624,7 @@ function cleanUser(user){
return user
}
function updateView(viewtype){
function updateView(viewtype){//print("lastnews "+lastnews);
//messageSend.state="";
//newsBusy.running=true;
//downloadNotice.text="xhr start "+Date.now()