v0.6.2 Follow and Unfollow contacts, Systray on Linux
This commit is contained in:
parent
1d62a8ddc1
commit
baccd64303
37 changed files with 724 additions and 636 deletions
|
@ -180,6 +180,19 @@ var where = " AND "+ filter +" = '" + filtervalue+"'";
|
|||
});
|
||||
}
|
||||
|
||||
function updateData(database,table, username, key, value, callback,filter,filtervalue) { // reads and applies data from DB
|
||||
if (filter){
|
||||
var where = " AND "+ filter +" = '" + filtervalue+"'";
|
||||
} else { var where="";}
|
||||
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
|
||||
if(!db) { return; }
|
||||
db.transaction( function(tx) {
|
||||
var rsArray=[];
|
||||
var rs = tx.executeSql('UPDATE '+table+' SET '+key+' = '+value+' WHERE username="'+username+'"'+where);
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
function showMessage(header,message,rootwindow){//print(message);
|
||||
var cleanmessage=message.replace(/"/g,"-");
|
||||
if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
|
||||
|
|
|
@ -34,6 +34,7 @@ function showFriends(db) {
|
|||
Service.requestFriends(login.url,login.user,login.password,displayFriends);
|
||||
});
|
||||
}
|
||||
|
||||
function displayFriends(obj){
|
||||
for (var i=0; i<obj.length; i++){
|
||||
//print(obj[i]);
|
||||
|
|
|
@ -334,7 +334,7 @@ function favorite(login,favorited,newsid,rootwindow){
|
|||
}
|
||||
|
||||
function likerequest(login,database,verb,newsid,rootwindow){
|
||||
Helperjs.friendicaPostRequest(login,"/api/friendica/activity/"+verb+"?id="+newsid, "","POST",rootwindow,function (obj){print("like "+ obj);
|
||||
Helperjs.friendicaPostRequest(login,"/api/friendica/activity/"+verb+"?id="+newsid, "","POST",rootwindow,function (obj){
|
||||
if (obj=='"ok"'){
|
||||
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
|
||||
db.transaction( function(tx) {
|
||||
|
|
|
@ -394,7 +394,7 @@ function cleanNews(database,callback){
|
|||
if (i!=0){var maxnewsa=maxnews/5}else{maxnewsa=maxnews}
|
||||
var newscountrs = tx.executeSql('SELECT COUNT(*) from news WHERE messagetype='+i);
|
||||
var newscount = 0;
|
||||
if (newscountrs.rows.length>0){newscount=newscountrs.rows.item(0)["COUNT(*)"]};//print(i+"newscount "+newscount)
|
||||
if (newscountrs.rows.length>0){newscount=newscountrs.rows.item(0)["COUNT(*)"]};//print(i+" "+maxnewsa+" newscount "+newscount)
|
||||
if (newscount>maxnewsa){
|
||||
var lastvalidtimers= tx.executeSql('SELECT DISTINCT created_at FROM news WHERE messagetype='+i+' ORDER BY created_at ASC LIMIT ' +(newscount-maxnewsa));
|
||||
var lastvalidtime=lastvalidtimers.rows.item(newscount-maxnewsa-1).created_at;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue