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

@ -217,11 +217,11 @@ Page {
height: 6*mm
text:qsTr("Approve")
onClicked:{
Helperjs.friendicaPostRequest(login,"/api/v1/follow_requests/" + contact.id + "/authorize",'',"POST",root,function(returnvalue){
Helperjs.deleteData(db,"friendshiprequests",login.username,function(){},"id", contact.id)
})
root.friendsSignal();
Helperjs.deleteData(root.db,"friendshiprequests",root.login.username,function(){},"id", contact.id)
//if (rootstack.currentIndex==1){root.friendsSignal(login.username)}
rootstackView.pop()
}
}
@ -232,9 +232,10 @@ Page {
text:qsTr("Reject")
onClicked:{
Helperjs.friendicaPostRequest(login,"/api/v1/follow_requests/" + contact.id + "/reject",'',"POST",root,function(returnvalue){
Helperjs.deleteData(db,"friendshiprequests",login.username,function(){},"id", contact.id)
})
root.friendsSignal();
Helperjs.deleteData(root.db,"friendshiprequests",root.login.username,function(){},"id", contact.id)
//if (rootstack.currentIndex==1){root.friendsSignal(login.username)}
rootstackView.pop()
}
}
@ -245,9 +246,10 @@ Page {
text:qsTr("Ignore")
onClicked:{
Helperjs.friendicaPostRequest(login,"/api/v1/follow_requests/" + contact.id + "/ignore",'',"POST",root,function(returnvalue){
Helperjs.deleteData(db,"friendshiprequests",login.username,function(){},"id", contact.id)
});
root.friendsSignal();
Helperjs.deleteData(root.db,"friendshiprequests",root.login.username,function(){},"id", contact.id)
//if (rootstack.currentIndex==1){root.friendsSignal(login.username)}
rootstackView.pop()
}
}
@ -259,13 +261,11 @@ Page {
onClicked:{
contactBusy.running=true;
Helperjs.friendicaPostRequest(login,"/api/v1/accounts/" + contact.id + "/follow",'',"POST",root,function(returnvalue){
Helperjs.updateData(db,"contacts",login.username,"isFriend",1,function(){},"id",contact.id)
root.friendsSignal(login.username);
rootstackView.pop()
// var username=login.username
//
});
});
Helperjs.updateData(root.db,"contacts",root.login.username,"isFriend",1,function(){},"id",contact.id)
//if (rootstack.currentIndex==1){root.friendsSignal(login.username)}
rootstackView.pop()
}
}
@ -275,12 +275,13 @@ Page {
height: 6*mm
text:qsTr("Unfollow")
onClicked:{
contactBusy.running=true;
Helperjs.friendicaPostRequest(login,"/api/v1/accounts/" + contact.id + "/unfollow",'',"POST",root,function(returnvalue){
contactBusy.running=true;
Helperjs.updateData(db,"contacts",login.username,"isFriend",0,function(){},"id",contact.id)
root.friendsSignal(login.username);
rootstackView.pop()
});
Helperjs.updateData(root.db,"contacts",root.login.username,"isFriend",0,function(){},"id",contact.id)
//if (rootstack.currentIndex==1){root.friendsSignal(login.username)}
rootstackView.pop()
}
}
@ -313,7 +314,9 @@ Page {
color: Material.primaryTextColor
text:"<b>"+qsTr("Description")+": </b> "+(Qt.atob(contact.description)!=""?contact.description:"")+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
"<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+
"<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
"<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())+"<br>"+
"<b>"+qsTr("Followers")+":</b> "+contact.followers_count+"<br>"+
"<b>"+qsTr("Following")+":</b> "+contact.friends_count+"<br>"
onLinkActivated: {
Qt.openUrlExternally(link)}
}