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

@ -29,7 +29,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.11
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/js/news.js" as Newsjs
@ -51,9 +51,9 @@ Rectangle{
id: newsBusy
anchors.horizontalCenter: parent.horizontalCenter
anchors.top:parent.top
anchors.topMargin: 2*mm
width:10*mm
height: 10*mm
anchors.topMargin: mm
width: 2*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
z:2
running: false
}
@ -67,7 +67,8 @@ Rectangle{
try{ Newsjs.newsfromdb(root.db,root.login,0, function(dbnews,lastid){
lastnewsid=lastid;
showNews(dbnews)
})}catch(e){Helperjs.showMessage("Error",e,root)};
})}catch(e){//Helperjs.showMessage("Error",e,root)
};
break;
case "conversation":
newsStack.updateMethodNews="conversation";
@ -219,13 +220,30 @@ Rectangle{
Connections{
target:xhr
function onError(data,url,api,code){
if (data !="contactlist"){Helperjs.showMessage(qsTr("Network Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);}
//if (data !="contactlist"){Helperjs.showMessage(qsTr("Network Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);}
newsBusy.running=false;
}
function onSuccess(data,api){
// downloadNotice.text=downloadNotice.text+ "\n xhr finished "+Date.now();
Service.processNews(api,data)
replySignal("")
const newsApiArray=["/api/statuses/friends_timeline",
"/api/direct_messages/all",
"/api/direct_messages/conversation",
"/api/direct_messages/new",
"/api/friendica/notification",
"/api/statuses/user_timeline",
"/api/conversation/show",
"/api/search",
"/api/statuses/public_timeline",
"/api/favorites",
"/api/statuses/replies",
"/api/lists/statuses",
"/api/statuses/update",
"/api/direct_messages/new"
];
if(newsApiArray.includes(api)){
Service.processNews(api,data)
replySignal("")
}
}
}
@ -301,9 +319,7 @@ Rectangle{
anchors.margins: 0.5*mm
clip: true
spacing: 0
header:
MessageSend{id:messagesend;onHeightChanged: newsView.positionViewAtBeginning()}
header:MessageSend{id:messagesend;onHeightChanged: {if(state=="active"){newsView.positionViewAtBeginning()}}}
footer: footerComponent
model: newsModel
delegate: Newsitem{}
@ -349,6 +365,7 @@ Rectangle{
if (newsSwipeview.stacktype=="Home"){
Newsjs.getLastNews(root.login,root.db,function(currentlastnews){
//print("currentlastnews "+currentlastnews+ " lastnewsid "+lastnewsid)
if (currentlastnews>lastnewsid){
if(currentnewstabstatus=="Timeline"){
try{ Newsjs.newsfromdb(root.db,root.login,0, function(dbnews,lastid){
@ -361,7 +378,7 @@ Rectangle{
lastnewsid=lastid;
showNews(news)});
}
} else {
} else {
Service.updateView(currentnewstabstatus)
}
});