version v0.6.7 with moderation

This commit is contained in:
LubuWest 2023-02-09 21:39:43 +01:00
commit 48a70b8395
46 changed files with 2106 additions and 1026 deletions

View file

@ -408,7 +408,7 @@ function cleanContacts(login,database,callback){
db.transaction( function(tx) {
var oldestnewsrs= tx.executeSql('SELECT created_at FROM news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY created_at ASC LIMIT 1');
if (oldestnewsrs.rows.length>0){ var oldestnewsTime=oldestnewsrs.rows.item(0).created_at- 604800000;} else{var oldestnewsTime=0} //contacts can be 7 days old
var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge<'+oldestnewsTime); // check for friends
var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend=0 AND statusnet_blocking<>1 AND imageAge<'+oldestnewsTime); // check for friends
for (var i=0;i<result.rows.length;i++){
filesystem.rmFile(result.rows.item(i).profile_image);
var deleters = tx.executeSql('DELETE from contacts WHERE username="'+login.username+'" AND url="'+result.rows.item(i).url+'"');
@ -455,7 +455,7 @@ function processNews(api,data){//print("processnews "+ " api "+ api + " data "+d
usermessages.push(newslist.status);
newslist=usermessages;
}
if (data=="" || api=="/api/v1/statuses"){print("data "+data); newsBusy.running=false}
if (data=="" || api=="/api/v1/statuses"){newsBusy.running=false}
else if (typeof(newslist)=='undefined'){
Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
}
@ -518,6 +518,10 @@ function processNews(api,data){//print("processnews "+ " api "+ api + " data "+d
if (api=="/api/statuses/replies"){newslist[n].messagetype=3}else{newslist[n].messagetype=0;}
newslist[n].friendica_author=cleanUser(newslist[n].friendica_author);
newslist[n].user=cleanUser(newslist[n].user);
try{
let localContact=Newsjs.objFromArray(allcontacts,"id",newslist[n].user.id);
newslist[n].user.statusnet_blocking=localContact.statusnet_blocking
}catch(e){}
//if (newslist[n].friendica_title!="") {newslist[n].statusnet_html="<b>"+newslist[n].friendica_title +"</b><br><br>"+newslist[n].friendica_html;}
//else{ //friendica_title also included in html
newslist[n].statusnet_html=newslist[n].friendica_html