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

@ -44,6 +44,7 @@ Item{
Layout.fillWidth:true
Layout.fillHeight: true
property int currentContact: 0
signal contactRefreshSignal()
function showFriends(username){
try {friendsModel.clear()} catch(e){};
@ -86,6 +87,19 @@ Item{
},searchText.text,-1);
}
function showBlocked(contact){
try {friendsModel.clear()} catch(e){};
Newsjs.listBlocked(login,db,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){
contactsobject[j].description=Qt.atob(contactsobject[j].description);
if(Helperjs.getCount(db,login,"contacts","screen_name",contactsobject[j].screen_name)>1){
contactsobject[j].screen_name=contactsobject[j].screen_name+"+"+contactsobject[j].cid
}
friendsModel.append({"contact":contactsobject[j]});
}
});
}
Connections{
target:xhr
function onDownloaded(type,url,filename,i){
@ -159,14 +173,18 @@ Item{
width: 6*root.fontFactor*osSettings.bigFontSize
height: 1.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
model: [qsTr("Friends"), qsTr("All")]
model: [qsTr("Friends"), qsTr("All"), qsTr("Blocked")]
onCurrentIndexChanged:{
if (currentIndex === 0) {
showFriends(root.login.username);
} else{
} else
if (currentIndex===1){
showContacts()
} else if (currentIndex===2){
showBlocked()
}
}
Component.onCompleted: {root.contactRefreshSignal.connect(onCurrentIndexChanged)}
}