Friendiqa v0.3.1

This commit is contained in:
LubuWest 2018-07-20 21:15:54 +02:00
commit 2afa7cbe6b
29 changed files with 490 additions and 465 deletions

View file

@ -82,15 +82,27 @@ else{
if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
}}} catch(e){print("Activities "+e+ " "+JSON.stringify(newsitemobject.friendica_activities))}
var friendica_activities={likeText:likeText,dislikeText:dislikeText,attendyesText:attendyesText,attendnoText:attendnoText,attendmaybeText:attendmaybeText,self:self}
var attachmentList=[];try{if(newsitemobject.attachments){
var attachmentList=[];
try{if(newsitemobject.attachments){
var attachArray=newsitemobject.attachments;
for (var image in attachArray){if(attachArray[image].mimetype=="image/gif"){
attachmentList.push(attachArray[image])
for (var image in attachArray){
var attachhelper={mimetype:attachArray[image].mimetype}
var attachhelperstring=Qt.btoa(attachArray[image].url)
var helperstringposition=newsitemobject.text.indexOf(attachhelperstring);
if (helperstringposition>-1){attachhelper.url=newsitemobject.text.substring(newsitemobject.text.lastIndexOf("http",helperstringposition),helperstringposition+attachhelperstring.length);
if (attachArray[image].mimetype=="image/jpeg"){attachhelper.url=attachhelper.url+".jpg"}
else if (attachArray[image].mimetype=="image/gif"){attachhelper.url=attachhelper.url+".gif"}
else if (attachArray[image].mimetype=="image/png"){attachhelper.url=attachhelper.url+".png"}
}
else {attachhelper.url=attachArray[image].url}
attachmentList.push(attachhelper)
newsitemobject.text=newsitemobject.text.replace(attachhelper.url,"")
newsitemobject.text=newsitemobject.text.replace(attachhelper.url.substring(0,attachhelper.url.length-4)+".jpeg","")
newsitemobject.text=newsitemobject.text.replace(attachhelper.url.substring(0,attachhelper.url.length-4),"")
}
}}catch(e){print("attachment "+e)}
}}catch(e){print("attachment "+e)}
newsitemobject.attachmentList=attachmentList;
var seconds=(msg.currentTime-newsitemobject.created_at)/1000;
var timestring="";
if (seconds<60) {timestring=seconds+" "+qsTr("seconds") +" "+qsTr("ago");}