bugfixes reply in Friendica 3/2022 and image download

This commit is contained in:
LubuWest 2022-03-13 21:22:08 +01:00
commit 48a904b8c0
15 changed files with 909 additions and 855 deletions

View file

@ -1,3 +1,8 @@
## v0.6.5
* Fix reply in Friendica 3/2022 version due to API bug
* Image downloads work again
* Some additional emojis
## v0.6.4 ## v0.6.4
@ -5,7 +10,6 @@
* Filter contacts * Filter contacts
* many new emojis * many new emojis
* Replaced Favorite button with Reply button due to buggy Favourite API * Replaced Favorite button with Reply button due to buggy Favourite API
* View newsitem on website (works only in coversation view)
* Rebuild contacts handling due to buggy Contacts API * Rebuild contacts handling due to buggy Contacts API
* Removed permissions for new messages due to buggy Contacts API * Removed permissions for new messages due to buggy Contacts API
* Sync all accounts in background (not only active) * Sync all accounts in background (not only active)

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.6.4" android:versionCode="30" android:installLocation="auto"> <manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.6.5" android:versionCode="31" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30"/> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.

View file

@ -224,7 +224,7 @@ void XHR::getlist()
XHR::setUrl(m_filelist.at(dlindex));} XHR::setUrl(m_filelist.at(dlindex));}
else { else {
XHR::setUrl(m_filelist.at(dlindex));} XHR::setUrl(m_filelist.at(dlindex));}
//qDebug() << "start download" << m_url; qDebug() << "start download" << m_url;
XHR::download(); XHR::download();
} else {dlindex=0;m_downloadtype="";m_contactlist.clear();m_filelist.clear();} } else {dlindex=0;m_downloadtype="";m_contactlist.clear();m_filelist.clear();}
} }
@ -293,6 +293,7 @@ void XHR::onReplySuccess()
void XHR::onRequestFinished() void XHR::onRequestFinished()
{ {
// Save the file here // Save the file here
//qDebug() << "buffer " << buffer;
if (buffer.isNull()){qDebug() << "File empty"<<m_url; buffer.clear(); emit this->error(m_downloadtype,m_url,m_api,1);} if (buffer.isNull()){qDebug() << "File empty"<<m_url; buffer.clear(); emit this->error(m_downloadtype,m_url,m_api,1);}
else if (m_downloadtype=="picturelist") { else if (m_downloadtype=="picturelist") {
QJsonDocument jsonResponse = QJsonDocument::fromJson(buffer); QJsonDocument jsonResponse = QJsonDocument::fromJson(buffer);

View file

@ -59,7 +59,7 @@ function friendicaPostRequest(login,api,data,method,rootwindow,callback) {
//print(api+JSON.stringify(login)+Qt.atob(login.password)); //print(api+JSON.stringify(login)+Qt.atob(login.password));
if (xhrequest.readyState === XMLHttpRequest.HEADERS_RECEIVED) { if (xhrequest.readyState === XMLHttpRequest.HEADERS_RECEIVED) {
} else if(xhrequest.readyState === XMLHttpRequest.DONE) { } else if(xhrequest.readyState === XMLHttpRequest.DONE) {
try{ if (xhrequest.responseText!=""){ try{ if (xhrequest.responseText!=""){print (xhrequest.responseText)
callback(xhrequest.responseText) callback(xhrequest.responseText)
}else{//print("API:\n" +api+" NO RESPONSE"); }else{//print("API:\n" +api+" NO RESPONSE");
//showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow) //showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow)

View file

@ -54,7 +54,8 @@ function dataRequest(login,photo,database,xhr,rootwindow) {
// check if image exist and call download function // check if image exist and call download function
Helperjs.friendicaRequest(login,"/api/friendica/photo?photo_id="+photo.id, rootwindow, function (image){ Helperjs.friendicaRequest(login,"/api/friendica/photo?photo_id="+photo.id, rootwindow, function (image){
if(image==""){currentimageno=currentimageno+1}else{ if(image=="" || typeof(image)=="undefined"){currentimageno=currentimageno+1}else{
try{ try{
var obj = JSON.parse(image); var obj = JSON.parse(image);
if (obj.hasOwnProperty('status')){ if (obj.hasOwnProperty('status')){
@ -109,6 +110,30 @@ function dataRequest(login,photo,database,xhr,rootwindow) {
} }
}) })
}} catch (e){ }} catch (e){
var helpfilename=photo.filename.substring(0,photo.filename.lastIndexOf("."));
var filesuffix="";
if (photo.type=="image/jpeg"){filesuffix=".jpg"}
else if (photo.type=="image/png"){filesuffix=".png"}
else {filesuffix=""}
if (helpfilename==""){// check if file has any filename
photo.filename=photo["id"]+filesuffix;
}
else{photo.filename=helpfilename+filesuffix}
var link="";
xhr.setUrl(Qt.resolvedUrl(photo.thumb));
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setFilename(login.imagestore+'albums/'+photo.album+"/"+photo["filename"]);
xhr.setDownloadtype("picture");
xhr.download();
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from imageData where id = "'+photo["id"]+'"');
if(result.rows.length === 1) {// use update
result = tx.executeSql('UPDATE imageData SET username ="' +login.username+ '",id="'+photo.id+'", created="'+photo.created+'", edited="'+photo.edited+'", profile="0", link="'+photo["thumb"]+'", filename="'+photo.filename+'",title="", desc="'+photo.desc+'", type="'+photo.type+'", width="0", height="0", album="'+photo.album+'", location="file://'+login.imagestore+'albums/'+photo.album+'/" where id="'+photo["id"]+'"');
} else {// use insert print('... does not exists, create it')
result = tx.executeSql('INSERT INTO imageData VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,photo.id,photo.created,photo.edited,'', photo.desc, photo.album, photo.filename, photo.type, '', '',0,photo["thumb"],'file://'+login.imagestore+'albums/'+photo.album+"/"]);
}
})
print("Data retrieval failure! "+ e+obj); print("Data retrieval failure! "+ e+obj);
} }
}}) }})

View file

@ -344,19 +344,19 @@ function deleteNews(login,database,newsid,messagetype,rootwindow,callback){
})} })}
function retweetNews(login,database,newsid,rootwindow,callback){ function retweetNews(login,database,newsid,rootwindow,callback){
Helperjs.friendicaPostRequest(login,"/api/statuses/retweet?id="+newsid,"","POST", rootwindow,function (obj){ Helperjs.friendicaPostRequest(login,"/api/v1/statuses/"+newsid+"/reblog","","POST", rootwindow,function (obj){
var answer=JSON.parse(obj); var answer=JSON.parse(obj);
if(answer.hasOwnProperty('status'))//('error' in answer.status) if(answer.hasOwnProperty('status'))//('error' in answer.status)
{Helperjs.showMessage("Repost",answer.status.code,rootwindow);} {Helperjs.showMessage("Repost",answer.status.code,rootwindow);}
else{Helperjs.showMessage("Repost",answer.text,rootwindow)} else{Helperjs.showMessage("Repost",answer.content,rootwindow)}
}) })
} }
function favorite(login,favorited,newsid,rootwindow){ function favorite(login,favorited,newsid,rootwindow){
// toggle favorites // toggle favorites
if(favorited){ Helperjs.friendicaPostRequest(login,"/api/favorites/create?id="+newsid,"","POST", rootwindow,function (obj){ if(favorited){ Helperjs.friendicaPostRequest(login,"/api/v1/statuses/"+newsid+"/bookmark","","POST", rootwindow,function (obj){
})} })}
else {Helperjs.friendicaPostRequest(login,"/api/favorites/destroy?id="+newsid,"","POST",rootwindow,function (obj){ else {Helperjs.friendicaPostRequest(login,"/api/v1/statuses/"+newsid+"/unbookmark","","POST",rootwindow,function (obj){
})} })}
} }

View file

@ -455,7 +455,7 @@ function processNews(api,data){
usermessages.push(newslist.status); usermessages.push(newslist.status);
newslist=usermessages; newslist=usermessages;
} }
if (data==""){newsBusy.running=false} if (data=="" || api=="/api/v1/statuses"){print("data "+data); newsBusy.running=false}
else if (typeof(newslist)=='undefined'){ else if (typeof(newslist)=='undefined'){
Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root) Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
} }

View file

@ -31,651 +31,657 @@
var html=[//Smileys var html=[//Smileys
'\u263A', '\u263A',
'\ud83d\ude00', '\ud83d\ude00',
'\ud83d\ude02', '\ud83d\ude02',
'\ud83d\ude06', '\ud83d\ude06',
'\ud83d\ude07', '\ud83d\ude07',
'\ud83d\ude08', '\ud83d\ude08',
'\ud83d\ude09', '\ud83d\ude09',
'\ud83d\ude0B', '\ud83d\ude0B',
'\ud83d\ude0D', '\ud83d\ude0D',
'\ud83d\ude0E', '\ud83d\ude0E',
'\ud83d\ude0F', '\ud83d\ude0F',
'\ud83d\ude10', '\ud83d\ude10',
'\ud83d\ude15', '\ud83d\ude15',
'\ud83d\ude18', '\ud83d\ude18',
'\ud83d\ude1B', '\ud83d\ude1B',
'\ud83d\ude1C', '\ud83d\ude1C',
'\ud83d\ude1D', '\ud83d\ude1D',
'\ud83d\ude1E', '\ud83d\ude1E',
'\ud83d\ude1F', '\ud83d\ude1F',
'\ud83d\ude20', '\ud83d\ude20',
'\ud83d\ude21', '\ud83d\ude21',
'\ud83d\ude22', '\ud83d\ude22',
'\ud83d\ude23', '\ud83d\ude23',
'\ud83d\ude24', '\ud83d\ude24',
'\ud83d\ude26', '\ud83d\ude26',
'\ud83d\ude27', '\ud83d\ude27',
'\ud83d\ude2C', '\ud83d\ude2C',
'\ud83d\ude2D', '\ud83d\ude2D',
'\ud83d\ude2E', '\ud83d\ude2E',
'\ud83d\ude2F', '\ud83d\ude2F',
'\ud83d\ude31', '\ud83d\ude31',
'\ud83d\ude32', '\ud83d\ude32',
'\ud83d\ude33', '\ud83d\ude33',
'\ud83d\ude31', '\ud83d\ude31',
'\ud83d\ude32', '\ud83d\ude32',
'\ud83d\ude33', '\ud83d\ude33',
'\ud83d\ude34', '\ud83d\ude34',
'\ud83d\ude37', '\ud83d\ude37',
'\ud83d\ude41', '\ud83d\ude41',
'\ud83d\ude42', '\ud83d\ude42',
'\ud83d\ude43', '\ud83d\ude43',
'\ud83d\ude44', '\ud83d\ude44',
'\ud83d\ude45', '\ud83d\ude45',
'\ud83d\ude46', '\ud83d\ude46',
'\ud83d\ude47', '\ud83d\ude47',
'\ud83d\ude4B', '\ud83d\ude4B',
'\ud83d\ude4C', '\ud83d\ude4C',
'\ud83d\ude4D', '\ud83d\ude4D',
'\ud83d\ude4E', '\ud83d\ude4E',
'\ud83d\ude4F', '\ud83d\ude4F',
'\ud83e\udd2F', '\ud83e\udd2F',
'\u2639', '\uD83D\uDC4D',
'\u263B', '\u2764\uFE0F',
//Weather '\uD83D\uDCA9',
'\u2600', '\uD83D\uDC2D',
'\u2601', '\uD83D\uDC2E',
'\u263C', '\uD83D\uDC31',
'\u2614', '\u2639',
'\u2602', '\u263B',
'\u2603', //Weather
'\u2604', '\u2600',
'\u26C4', '\u2601',
'\u26C5', '\u263C',
'\u26C8', '\u2614',
//Leisure '\u2602',
'\u2615', '\u2603',
'\u26BD', '\u2604',
'\u26BE', '\u26C4',
'\u26F1', '\u26C5',
'\u26F2', '\u26C8',
'\u26F3', //Leisure
'\u26F4', '\u2615',
'\u26F5', '\u26BD',
'\u26F7', '\u26BE',
'\u26F8', '\u26F1',
'\u26F9', '\u26F2',
'\u26FA', '\u26F3',
'\u26FD', '\u26F4',
//Hand '\u26F5',
'\u261C', '\u26F7',
'\u261D', '\u26F8',
'\u261E', '\u26F9',
'\u261F', '\u26FA',
'\u2620', '\u26FD',
'\u2622', //Hand
'\u2623', '\u261C',
//Religion '\u261D',
'\u2626', '\u261E',
'\u262A', '\u261F',
'\u262C', '\u2620',
'\u262E', '\u2622',
'\u262F', '\u2623',
'\u26EA', //Religion
'\u26E9' '\u2626',
] '\u262A',
'\u262C',
'\u262E',
'\u262F',
'\u26EA',
'\u26E9'
]
var core=[ var core=[
{name:'&lt;3',url: {name:'&lt;3',url:
'qrc:///images/smileys/core/smiley-heart.gif'}, 'qrc:///images/smileys/core/smiley-heart.gif'},
{name:'&lt;/3',url: {name:'&lt;/3',url:
'qrc:///images/smileys/core/smiley-brokenheart.gif'}, 'qrc:///images/smileys/core/smiley-brokenheart.gif'},
{name:':-)',url: {name:':-)',url:
'qrc:///images/smileys/core/smiley-smile.gif'}, 'qrc:///images/smileys/core/smiley-smile.gif'},
{name:';-)',url: {name:';-)',url:
'qrc:///images/smileys/core/smiley-wink.gif'}, 'qrc:///images/smileys/core/smiley-wink.gif'},
{name:':-(',url: {name:':-(',url:
'qrc:///images/smileys/core/smiley-frown.gif'}, 'qrc:///images/smileys/core/smiley-frown.gif'},
{name:':-P',url: {name:':-P',url:
'qrc:///images/smileys/core/smiley-tongue-out.gif'}, 'qrc:///images/smileys/core/smiley-tongue-out.gif'},
{name:':-X',url: {name:':-X',url:
'qrc:///images/smileys/core/smiley-kiss.gif'}, 'qrc:///images/smileys/core/smiley-kiss.gif'},
{name:':-D',url: {name:':-D',url:
'qrc:///images/smileys/core/smiley-laughing.gif'}, 'qrc:///images/smileys/core/smiley-laughing.gif'},
{name:':-O',url: {name:':-O',url:
'qrc:///images/smileys/core/smiley-surprised.gif'}, 'qrc:///images/smileys/core/smiley-surprised.gif'},
{name:'\\o/',url: {name:'\\o/',url:
'qrc:///images/smileys/core/smiley-thumbsup.gif'}, 'qrc:///images/smileys/core/smiley-thumbsup.gif'},
{name:'o.O',url: {name:'o.O',url:
'qrc:///images/smileys/core/smiley-Oo.gif'}, 'qrc:///images/smileys/core/smiley-Oo.gif'},
{name:":'(",url: {name:":'(",url:
'qrc:///images/smileys/core/smiley-cry.gif'}, 'qrc:///images/smileys/core/smiley-cry.gif'},
{name:":-!",url: {name:":-!",url:
'qrc:///images/smileys/core/smiley-foot-in-mouth.gif'}, 'qrc:///images/smileys/core/smiley-foot-in-mouth.gif'},
{name:":-/",url: {name:":-/",url:
'qrc:///images/smileys/core/smiley-undecided.gif'}, 'qrc:///images/smileys/core/smiley-undecided.gif'},
{name:":-[",url: {name:":-[",url:
'qrc:///images/smileys/core/smiley-embarassed.gif'}, 'qrc:///images/smileys/core/smiley-embarassed.gif'},
{name:"8-)",url: {name:"8-)",url:
'qrc:///images/smileys/core/smiley-cool.gif'}, 'qrc:///images/smileys/core/smiley-cool.gif'},
{name:':beer',url: {name:':beer',url:
'qrc:///images/smileys/core/beer_mug.gif'}, 'qrc:///images/smileys/core/beer_mug.gif'},
{name:':coffee',url: {name:':coffee',url:
'qrc:///images/smileys/core/coffee.gif'}, 'qrc:///images/smileys/core/coffee.gif'},
{name:':facepalm',url: {name:':facepalm',url:
'qrc:///images/smileys/core/smiley-facepalm.gif'}, 'qrc:///images/smileys/core/smiley-facepalm.gif'},
{name:':like',url: {name:':like',url:
'qrc:///images/smileys/core/like.gif'}, 'qrc:///images/smileys/core/like.gif'},
{name:':dislike',url: {name:':dislike',url:
'qrc:///images/smileys/core/dislike.gif'}, 'qrc:///images/smileys/core/dislike.gif'},
{name:'~friendica',url: {name:'~friendica',url:
'qrc:///images/smileys/core/friendica-16.png'}, 'qrc:///images/smileys/core/friendica-16.png'},
{name:'red#',url: {name:'red#',url:
'qrc:///images/smileys/core/rm-16.png'} 'qrc:///images/smileys/core/rm-16.png'}
] ]
var addon=[ var addon=[
{name:':bunnyflowers',url: {name:':bunnyflowers',url:
'qrc:///images/smileys/animals/bunnyflowers.gif'}, 'qrc:///images/smileys/animals/bunnyflowers.gif'},
{name:':chick',url: {name:':chick',url:
'qrc:///images/smileys/animals/chick.gif'}, 'qrc:///images/smileys/animals/chick.gif'},
{name:':bumblebee',url: {name:':bumblebee',url:
'qrc:///images/smileys/animals/bee.gif'}, 'qrc:///images/smileys/animals/bee.gif'},
{name:':ladybird',url: {name:':ladybird',url:
'qrc:///images/smileys/animals/ladybird.gif'}, 'qrc:///images/smileys/animals/ladybird.gif'},
{name:':bigspider',url: {name:':bigspider',url:
'qrc:///images/smileys/animals/bigspider.gif' }, 'qrc:///images/smileys/animals/bigspider.gif' },
{name:':cat',url: {name:':cat',url:
'qrc:///images/smileys/animals/cat.gif'}, 'qrc:///images/smileys/animals/cat.gif'},
{name:':bunny',url: {name:':bunny',url:
'qrc:///images/smileys/animals/bunny.gif' }, 'qrc:///images/smileys/animals/bunny.gif' },
{name:':cow',url: {name:':cow',url:
'qrc:///images/smileys/animals/cow.gif' }, 'qrc:///images/smileys/animals/cow.gif' },
{name:':crab',url: {name:':crab',url:
'qrc:///images/smileys/animals/crab.gif' }, 'qrc:///images/smileys/animals/crab.gif' },
{name:':dolphin',url: {name:':dolphin',url:
'qrc:///images/smileys/animals/dolphin.gif' }, 'qrc:///images/smileys/animals/dolphin.gif' },
{name:':dragonfly',url: {name:':dragonfly',url:
'qrc:///images/smileys/animals/dragonfly.gif' }, 'qrc:///images/smileys/animals/dragonfly.gif' },
{name:':frog',url: {name:':frog',url:
'qrc:///images/smileys/animals/frog.gif'}, 'qrc:///images/smileys/animals/frog.gif'},
{name:':hamster',url: {name:':hamster',url:
'qrc:///images/smileys/animals/hamster.gif' }, 'qrc:///images/smileys/animals/hamster.gif' },
{name:':monkey',url: {name:':monkey',url:
'qrc:///images/smileys/animals/monkey.gif' }, 'qrc:///images/smileys/animals/monkey.gif' },
{name:':horse',url: {name:':horse',url:
'qrc:///images/smileys/animals/horse.gif' }, 'qrc:///images/smileys/animals/horse.gif' },
{name:':parrot',url: {name:':parrot',url:
'qrc:///images/smileys/animals/parrot.gif' }, 'qrc:///images/smileys/animals/parrot.gif' },
{name:':tux',url: {name:':tux',url:
'qrc:///images/smileys/animals/tux.gif' }, 'qrc:///images/smileys/animals/tux.gif' },
{name:':snail',url: {name:':snail',url:
'qrc:///images/smileys/animals/snail.gif' }, 'qrc:///images/smileys/animals/snail.gif' },
{name:':sheep',url: {name:':sheep',url:
'qrc:///images/smileys/animals/sheep.gif' }, 'qrc:///images/smileys/animals/sheep.gif' },
{name:':dog',url: {name:':dog',url:
'qrc:///images/smileys/animals/dog.gif'}, 'qrc:///images/smileys/animals/dog.gif'},
{name:':elephant',url: {name:':elephant',url:
'qrc:///images/smileys/animals/elephant.gif' }, 'qrc:///images/smileys/animals/elephant.gif' },
{name:':fish',url: {name:':fish',url:
'qrc:///images/smileys/animals/fish.gif' }, 'qrc:///images/smileys/animals/fish.gif' },
{name:':giraffe',url: {name:':giraffe',url:
'qrc:///images/smileys/animals/giraffe.gif' }, 'qrc:///images/smileys/animals/giraffe.gif' },
{name:':pig',url: {name:':pig',url:
'qrc:///images/smileys/animals/pig.gif'}, 'qrc:///images/smileys/animals/pig.gif'},
//Baby //Baby
{name:':baby',url: {name:':baby',url:
'qrc:///images/smileys/babies/baby.gif' }, 'qrc:///images/smileys/babies/baby.gif' },
{name:':babycot',url: {name:':babycot',url:
'qrc:///images/smileys/babies/babycot.gif' }, 'qrc:///images/smileys/babies/babycot.gif' },
{name:':pregnant',url: {name:':pregnant',url:
'qrc:///images/smileys/babies/pregnant.gif' }, 'qrc:///images/smileys/babies/pregnant.gif' },
{name:':stork',url: {name:':stork',url:
'qrc:///images/smileys/babies/stork.gif' }, 'qrc:///images/smileys/babies/stork.gif' },
//Confused //Confused
{name:':confused',url: {name:':confused',url:
'qrc:///images/smileys/confused/confused.gif' }, 'qrc:///images/smileys/confused/confused.gif' },
{name:':shrug',url: {name:':shrug',url:
'qrc:///images/smileys/confused/shrug.gif' }, 'qrc:///images/smileys/confused/shrug.gif' },
{name:':stupid',url: {name:':stupid',url:
'qrc:///images/smileys/confused/stupid.gif' }, 'qrc:///images/smileys/confused/stupid.gif' },
{name:':dazed',url: {name:':dazed',url:
'qrc:///images/smileys/confused/dazed.gif' }, 'qrc:///images/smileys/confused/dazed.gif' },
//Cool 'qrc:///images/smileys //Cool 'qrc:///images/smileys
{name:':affro',url: {name:':affro',url:
'qrc:///images/smileys/cool/affro.gif'}, 'qrc:///images/smileys/cool/affro.gif'},
//Devil/Angel //Devil/Angel
{name:':angel',url: {name:':angel',url:
'qrc:///images/smileys/devilangel/angel.gif'}, 'qrc:///images/smileys/devilangel/angel.gif'},
{name:':cherub',url: {name:':cherub',url:
'qrc:///images/smileys/devilangel/cherub.gif'}, 'qrc:///images/smileys/devilangel/cherub.gif'},
{name:':devilangel',url: {name:':devilangel',url:
'qrc:///images/smileys/devilangel/blondedevil.gif' }, 'qrc:///images/smileys/devilangel/blondedevil.gif' },
{name:':catdevil',url: {name:':catdevil',url:
'qrc:///images/smileys/devilangel/catdevil.gif'}, 'qrc:///images/smileys/devilangel/catdevil.gif'},
{name:':devillish',url: {name:':devillish',url:
'qrc:///images/smileys/devilangel/devil.gif'}, 'qrc:///images/smileys/devilangel/devil.gif'},
{name:':daseesaw',url: {name:':daseesaw',url:
'qrc:///images/smileys/devilangel/daseesaw.gif'}, 'qrc:///images/smileys/devilangel/daseesaw.gif'},
{name:':turnevil',url: {name:':turnevil',url:
'qrc:///images/smileys/devilangel/turnevil.gif' }, 'qrc:///images/smileys/devilangel/turnevil.gif' },
{name:':saint',url: {name:':saint',url:
'qrc:///images/smileys/devilangel/saint.gif'}, 'qrc:///images/smileys/devilangel/saint.gif'},
{name:':graveside',url: {name:':graveside',url:
'qrc:///images/smileys/devilangel/graveside.gif'}, 'qrc:///images/smileys/devilangel/graveside.gif'},
//Unpleasent //Unpleasent
{name:':toilet',url: {name:':toilet',url:
'qrc:///images/smileys/disgust/toilet.gif'}, 'qrc:///images/smileys/disgust/toilet.gif'},
{name:':fartinbed',url: {name:':fartinbed',url:
'qrc:///images/smileys/disgust/fartinbed.gif' }, 'qrc:///images/smileys/disgust/fartinbed.gif' },
{name:':fartblush',url: {name:':fartblush',url:
'qrc:///images/smileys/disgust/fartblush.gif' }, 'qrc:///images/smileys/disgust/fartblush.gif' },
//Drinks //Drinks
{name:':tea',url: {name:':tea',url:
'qrc:///images/smileys/drink/tea.gif' }, 'qrc:///images/smileys/drink/tea.gif' },
{name:':drool',url: {name:':drool',url:
'qrc:///images/smileys/drool/drool.gif'}, 'qrc:///images/smileys/drool/drool.gif'},
//Sad //Sad
{name:':crying',url: {name:':crying',url:
'qrc:///images/smileys/sad/crying.png'}, 'qrc:///images/smileys/sad/crying.png'},
{name:':prisoner',url: {name:':prisoner',url:
'qrc:///images/smileys/sad/prisoner.gif' }, 'qrc:///images/smileys/sad/prisoner.gif' },
{name:':sigh',url: {name:':sigh',url:
'qrc:///images/smileys/sad/sigh.gif'}, 'qrc:///images/smileys/sad/sigh.gif'},
//Smoking - only one smiley in here, maybe it needs moving elsewhere? //Smoking - only one smiley in here, maybe it needs moving elsewhere?
{name:':smoking',url: {name:':smoking',url:
'qrc:///images/smileys/smoking/smoking.gif'}, 'qrc:///images/smileys/smoking/smoking.gif'},
//Sport //Sport
{name:':basketball',url: {name:':basketball',url:
'qrc:///images/smileys/sport/basketball.gif'}, 'qrc:///images/smileys/sport/basketball.gif'},
{name:':bowling',url: {name:':bowling',url:
'qrc:///images/smileys/sport/bowling.gif'}, 'qrc:///images/smileys/sport/bowling.gif'},
{name:':cycling',url: {name:':cycling',url:
'qrc:///images/smileys/sport/cycling.gif'}, 'qrc:///images/smileys/sport/cycling.gif'},
{name:':darts',url: {name:':darts',url:
'qrc:///images/smileys/sport/darts.gif'}, 'qrc:///images/smileys/sport/darts.gif'},
{name:':fencing',url: {name:':fencing',url:
'qrc:///images/smileys/sport/fencing.gif' }, 'qrc:///images/smileys/sport/fencing.gif' },
{name:':juggling',url: {name:':juggling',url:
'qrc:///images/smileys/sport/juggling.gif'}, 'qrc:///images/smileys/sport/juggling.gif'},
{name:':skipping',url: {name:':skipping',url:
'qrc:///images/smileys/sport/skipping.gif'}, 'qrc:///images/smileys/sport/skipping.gif'},
{name:':archery',url: {name:':archery',url:
'qrc:///images/smileys/sport/archery.gif'}, 'qrc:///images/smileys/sport/archery.gif'},
{name:':surfing',url: {name:':surfing',url:
'qrc:///images/smileys/sport/surfing.gif' }, 'qrc:///images/smileys/sport/surfing.gif' },
{name:':snooker',url: {name:':snooker',url:
'qrc:///images/smileys/sport/snooker.gif' }, 'qrc:///images/smileys/sport/snooker.gif' },
{name:':horseriding',url: {name:':horseriding',url:
'qrc:///images/smileys/sport/horseriding.gif'}, 'qrc:///images/smileys/sport/horseriding.gif'},
//Love //Love
{name:':iloveyou',url: {name:':iloveyou',url:
'qrc:///images/smileys/love/iloveyou.gif'}, 'qrc:///images/smileys/love/iloveyou.gif'},
{name:':inlove',url: {name:':inlove',url:
'qrc:///images/smileys/love/inlove.gif'}, 'qrc:///images/smileys/love/inlove.gif'},
{name:':~love',url: {name:':~love',url:
'qrc:///images/smileys/love/love.gif' }, 'qrc:///images/smileys/love/love.gif' },
{name:':lovebear',url: {name:':lovebear',url:
'qrc:///images/smileys/love/lovebear.gif'}, 'qrc:///images/smileys/love/lovebear.gif'},
{name:':lovebed',url: {name:':lovebed',url:
'qrc:///images/smileys/love/lovebed.gif' }, 'qrc:///images/smileys/love/lovebed.gif' },
{name:':loveheart',url: {name:':loveheart',url:
'qrc:///images/smileys/love/loveheart.gif' }, 'qrc:///images/smileys/love/loveheart.gif' },
//Tired/Sleep //Tired/Sleep
{name:':countsheep',url: {name:':countsheep',url:
'qrc:///images/smileys/tired/countsheep.gif' }, 'qrc:///images/smileys/tired/countsheep.gif' },
{name:':hammock',url: {name:':hammock',url:
'qrc:///images/smileys/tired/hammock.gif'}, 'qrc:///images/smileys/tired/hammock.gif'},
{name:':pillow',url: {name:':pillow',url:
'qrc:///images/smileys/tired/pillow.gif' }, 'qrc:///images/smileys/tired/pillow.gif' },
{name:':yawn',url: {name:':yawn',url:
'qrc:///images/smileys/tired/yawn.gif'}, 'qrc:///images/smileys/tired/yawn.gif'},
//Fight/Flame/Violent //Fight/Flame/Violent
{name:':2guns',url: {name:':2guns',url:
'qrc:///images/smileys/fight/2guns.gif' }, 'qrc:///images/smileys/fight/2guns.gif' },
{name:':alienfight',url: {name:':alienfight',url:
'qrc:///images/smileys/fight/alienfight.gif' }, 'qrc:///images/smileys/fight/alienfight.gif' },
{name:':army',url: {name:':army',url:
'qrc:///images/smileys/fight/army.gif'}, 'qrc:///images/smileys/fight/army.gif'},
{name:':arrowhead',url: {name:':arrowhead',url:
'qrc:///images/smileys/fight/arrowhead.gif'}, 'qrc:///images/smileys/fight/arrowhead.gif'},
{name:':bfg',url: {name:':bfg',url:
'qrc:///images/smileys/fight/bfg.gif' }, 'qrc:///images/smileys/fight/bfg.gif' },
{name:':bowman',url: {name:':bowman',url:
'qrc:///images/smileys/fight/bowman.gif' }, 'qrc:///images/smileys/fight/bowman.gif' },
{name:':chainsaw',url: {name:':chainsaw',url:
'qrc:///images/smileys/fight/chainsaw.gif'}, 'qrc:///images/smileys/fight/chainsaw.gif'},
{name:':crossbow',url: {name:':crossbow',url:
'qrc:///images/smileys/fight/crossbow.gif'}, 'qrc:///images/smileys/fight/crossbow.gif'},
{name:':crusader',url: {name:':crusader',url:
'qrc:///images/smileys/fight/crusader.gif' }, 'qrc:///images/smileys/fight/crusader.gif' },
{name:':dead',url: {name:':dead',url:
'qrc:///images/smileys/fight/dead.gif' }, 'qrc:///images/smileys/fight/dead.gif' },
{name:':hammersplat',url: {name:':hammersplat',url:
'qrc:///images/smileys/fight/hammersplat.gif' }, 'qrc:///images/smileys/fight/hammersplat.gif' },
{name:':lasergun',url: {name:':lasergun',url:
'qrc:///images/smileys/fight/lasergun.gif' }, 'qrc:///images/smileys/fight/lasergun.gif' },
{name:':machinegun',url: {name:':machinegun',url:
'qrc:///images/smileys/fight/machinegun.gif' }, 'qrc:///images/smileys/fight/machinegun.gif' },
{name:':acid',url: {name:':acid',url:
'qrc:///images/smileys/fight/acid.gif' }, 'qrc:///images/smileys/fight/acid.gif' },
//Fantasy - monsters and dragons fantasy. The other type of fantasy belongs in adult //Fantasy - monsters and dragons fantasy. The other type of fantasy belongs in adult
{name:':alienmonster',url: {name:':alienmonster',url:
'qrc:///images/smileys/fantasy/alienmonster.gif' }, 'qrc:///images/smileys/fantasy/alienmonster.gif' },
{name:':barbarian',url: {name:':barbarian',url:
'qrc:///images/smileys/fantasy/barbarian.gif' }, 'qrc:///images/smileys/fantasy/barbarian.gif' },
{name:':dinosaur',url: {name:':dinosaur',url:
'qrc:///images/smileys/fantasy/dinosaur.gif'}, 'qrc:///images/smileys/fantasy/dinosaur.gif'},
{name:':dragon',url: {name:':dragon',url:
'qrc:///images/smileys/fantasy/dragon.gif'}, 'qrc:///images/smileys/fantasy/dragon.gif'},
{name:':draco',url: {name:':draco',url:
'qrc:///images/smileys/fantasy/dragonwhelp.gif'}, 'qrc:///images/smileys/fantasy/dragonwhelp.gif'},
{name:':ghost',url: {name:':ghost',url:
'qrc:///images/smileys/fantasy/ghost.gif'}, 'qrc:///images/smileys/fantasy/ghost.gif'},
{name:':mummy',url: {name:':mummy',url:
'qrc:///images/smileys/fantasy/mummy.gif'}, 'qrc:///images/smileys/fantasy/mummy.gif'},
//Food //Food
{name:':apple',url: {name:':apple',url:
'qrc:///images/smileys/food/apple.gif' }, 'qrc:///images/smileys/food/apple.gif' },
{name:':broccoli',url: {name:':broccoli',url:
'qrc:///images/smileys/food/broccoli.gif' }, 'qrc:///images/smileys/food/broccoli.gif' },
{name:':cake',url: {name:':cake',url:
'qrc:///images/smileys/food/cake.gif'}, 'qrc:///images/smileys/food/cake.gif'},
{name:':carrot',url: {name:':carrot',url:
'qrc:///images/smileys/food/carrot.gif' }, 'qrc:///images/smileys/food/carrot.gif' },
{name:':popcorn',url: {name:':popcorn',url:
'qrc:///images/smileys/food/popcorn.gif'}, 'qrc:///images/smileys/food/popcorn.gif'},
{name:':tomato',url: {name:':tomato',url:
'qrc:///images/smileys/food/tomato.gif'}, 'qrc:///images/smileys/food/tomato.gif'},
{name:':banana',url: {name:':banana',url:
'qrc:///images/smileys/food/banana.gif'}, 'qrc:///images/smileys/food/banana.gif'},
{name:':cooking',url: {name:':cooking',url:
'qrc:///images/smileys/food/cooking.gif'}, 'qrc:///images/smileys/food/cooking.gif'},
{name:':fryegg',url: {name:':fryegg',url:
'qrc:///images/smileys/food/fryegg.gif'}, 'qrc:///images/smileys/food/fryegg.gif'},
{name:':birthdaycake',url: {name:':birthdaycake',url:
'qrc:///images/smileys/food/birthdaycake.gif'}, 'qrc:///images/smileys/food/birthdaycake.gif'},
//Happy //Happy
{name:':cloud9',url: {name:':cloud9',url:
'qrc:///images/smileys/happy/cloud9.gif'}, 'qrc:///images/smileys/happy/cloud9.gif'},
{name:':tearsofjoy',url: {name:':tearsofjoy',url:
'qrc:///images/smileys/happy/tearsofjoy.gif' }, 'qrc:///images/smileys/happy/tearsofjoy.gif' },
//Repsect //Repsect
{name:':bow',url: {name:':bow',url:
'qrc:///images/smileys/respect/bow.gif'}, 'qrc:///images/smileys/respect/bow.gif'},
{name:':bravo',url: {name:':bravo',url:
'qrc:///images/smileys/respect/bravo.gif'}, 'qrc:///images/smileys/respect/bravo.gif'},
{name:':hailking',url: {name:':hailking',url:
'qrc:///images/smileys/respect/hailking.gif'}, 'qrc:///images/smileys/respect/hailking.gif'},
{name:':number1',url: {name:':number1',url:
'qrc:///images/smileys/respect/number1.gif' }, 'qrc:///images/smileys/respect/number1.gif' },
//Laugh //Laugh
{name:':hahaha',url: {name:':hahaha',url:
'qrc:///images/smileys/laugh/hahaha.gif'}, 'qrc:///images/smileys/laugh/hahaha.gif'},
{name:':loltv',url: {name:':loltv',url:
'qrc:///images/smileys/laugh/loltv.gif' }, 'qrc:///images/smileys/laugh/loltv.gif' },
{name:':rofl',url: {name:':rofl',url:
'qrc:///images/smileys/laugh/rofl.gif'}, 'qrc:///images/smileys/laugh/rofl.gif'},
//Music //Music
{name:':drums',url: {name:':drums',url:
'qrc:///images/smileys/music/drums.gif'}, 'qrc:///images/smileys/music/drums.gif'},
{name:':guitar',url: {name:':guitar',url:
'qrc:///images/smileys/music/guitar.gif'}, 'qrc:///images/smileys/music/guitar.gif'},
{name:':trumpet',url: {name:':trumpet',url:
'qrc:///images/smileys/music/trumpet.gif' }, 'qrc:///images/smileys/music/trumpet.gif' },
//smileys that used to be in core //smileys that used to be in core
{name:':headbang',url: {name:':headbang',url:
'qrc:///images/smileys/oldcore/headbang.gif'}, 'qrc:///images/smileys/oldcore/headbang.gif'},
{name:':beard',url: {name:':beard',url:
'qrc:///images/smileys/oldcore/beard.png'}, 'qrc:///images/smileys/oldcore/beard.png'},
{name:':whitebeard',url: {name:':whitebeard',url:
'qrc:///images/smileys/oldcore/whitebeard.png'}, 'qrc:///images/smileys/oldcore/whitebeard.png'},
{name:':shaka',url: {name:':shaka',url:
'qrc:///images/smileys/oldcore/shaka.gif'}, 'qrc:///images/smileys/oldcore/shaka.gif'},
{name:':\\.../',url: {name:':\\.../',url:
'qrc:///images/smileys/oldcore/shaka.gif'}, 'qrc:///images/smileys/oldcore/shaka.gif'},
{name:':\\ooo/',url: {name:':\\ooo/',url:
'qrc:///images/smileys/oldcore/shaka.gif' }, 'qrc:///images/smileys/oldcore/shaka.gif' },
{name:':headdesk',url: {name:':headdesk',url:
'qrc:///images/smileys/oldcore/headbang.gif' }, 'qrc:///images/smileys/oldcore/headbang.gif' },
//These two are still in core, so oldcore isn't strictly right, but we don't want too many directories //These two are still in core, so oldcore isn't strictly right, but we don't want too many directories
{name:':-d',url: {name:':-d',url:
'qrc:///images/smileys/oldcore/laughing.gif'}, 'qrc:///images/smileys/oldcore/laughing.gif'},
{name:':-o',url: {name:':-o',url:
'qrc:///images/smileys/oldcore/surprised.gif' }, 'qrc:///images/smileys/oldcore/surprised.gif' },
// Regex killers - stick these at the bottom so they appear at the end of the English and // Regex killers - stick these at the bottom so they appear at the end of the English and
// at the start of $OtherLanguage. // at the start of $OtherLanguage.
{name:':cool',url: {name:':cool',url:
'qrc:///images/smileys/cool/cool.gif' }, 'qrc:///images/smileys/cool/cool.gif' },
{name:':vomit',url: {name:':vomit',url:
'qrc:///images/smileys/disgust/vomit.gif' }, 'qrc:///images/smileys/disgust/vomit.gif' },
{name:':golf',url: {name:':golf',url:
'qrc:///images/smileys/sport/golf.gif' }, 'qrc:///images/smileys/sport/golf.gif' },
{name:':football',url: {name:':football',url:
'qrc:///images/smileys/sport/football.gif'}, 'qrc:///images/smileys/sport/football.gif'},
{name:':tennis',url: {name:':tennis',url:
'qrc:///images/smileys/sport/tennis.gif' }, 'qrc:///images/smileys/sport/tennis.gif' },
{name:':alpha',url: {name:':alpha',url:
'qrc:///images/smileys/fight/alpha.png' }, 'qrc:///images/smileys/fight/alpha.png' },
{name:':marine',url: {name:':marine',url:
'qrc:///images/smileys/fight/marine.gif' }, 'qrc:///images/smileys/fight/marine.gif' },
{name:':sabre',url: {name:':sabre',url:
'qrc:///images/smileys/fight/sabre.gif' }, 'qrc:///images/smileys/fight/sabre.gif' },
{name:':tank',url: {name:':tank',url:
'qrc:///images/smileys/fight/tank.gif' }, 'qrc:///images/smileys/fight/tank.gif' },
{name:':viking',url: {name:':viking',url:
'qrc:///images/smileys/fight/viking.gif' }, 'qrc:///images/smileys/fight/viking.gif' },
{name:':gangs',url: {name:':gangs',url:
'qrc:///images/smileys/fight/gangs.gif' }, 'qrc:///images/smileys/fight/gangs.gif' },
{name:':dj',url: {name:':dj',url:
'qrc:///images/smileys/music/dj.gif'}, 'qrc:///images/smileys/music/dj.gif'},
{name:':elvis',url: {name:':elvis',url:
'qrc:///images/smileys/music/elvis.gif'}, 'qrc:///images/smileys/music/elvis.gif'},
{name:':violin',url: {name:':violin',url:
'qrc:///images/smileys/music/violin.gif'}, 'qrc:///images/smileys/music/violin.gif'},
] ]
var adult=[ var adult=[
{ {
name:'(o)(o) ',url: name:'(o)(o) ',url:
'qrc:///images/smileys/adult/tits.gif'}, 'qrc:///images/smileys/adult/tits.gif'},
{name:'(.)(.) ',url: {name:'(.)(.) ',url:
'qrc:///images/smileys/adult/tits.gif'}, 'qrc:///images/smileys/adult/tits.gif'},
{name:':bong',url: {name:':bong',url:
'qrc:///images/smileys/adult/bong.gif'}, 'qrc:///images/smileys/adult/bong.gif'},
{name:':sperm',url: {name:':sperm',url:
'qrc:///images/smileys/adult/sperm.gif'}, 'qrc:///images/smileys/adult/sperm.gif'},
{name:':drunk',url: {name:':drunk',url:
'qrc:///images/smileys/adult/drunk.gif'}, 'qrc:///images/smileys/adult/drunk.gif'},
{name:':finger',url: {name:':finger',url:
'qrc:///images/smileys/adult/finger.gif'} 'qrc:///images/smileys/adult/finger.gif'}
] ]

View file

@ -43,7 +43,7 @@ Page{
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
color:Material.primaryTextColor color:Material.primaryTextColor
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: "<b>Friendiqa v0.6.4 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+ text: "<b>Friendiqa v0.6.5 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
"Website <a href='https://friendiqa.ma-nic.de'>https://friendiqa.ma-nic.de</a><br>"+ "Website <a href='https://friendiqa.ma-nic.de'>https://friendiqa.ma-nic.de</a><br>"+
"Sourcecode: <a href='https://git.friendi.ca/LubuWest/Friendiqa'>https://git.friendi.ca/LubuWest/Friendiqa</a><br>"+ "Sourcecode: <a href='https://git.friendi.ca/LubuWest/Friendiqa'>https://git.friendi.ca/LubuWest/Friendiqa</a><br>"+
"Privacy Policy: <a href='https://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md'>http://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md</a><br>"+ "Privacy Policy: <a href='https://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md'>http://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md</a><br>"+

View file

@ -95,7 +95,7 @@ Page {
//x:3*mm //x:3*mm
//y:8*mm //y:8*mm
width: conversationList.width//-4*mm width: conversationList.width//-4*mm
height:conversationList.height//-20*mm height:conversationList.height-root.fontFactor*osSettings.bigFontSize//-20*mm
clip: true clip: true
spacing: 0 spacing: 0
footer: MessageSend{conversation:true} footer: MessageSend{conversation:true}

View file

@ -89,27 +89,37 @@ Rectangle{
function statusUpdate(title,status,in_reply_to_status_id,attachImageURL) { function statusUpdate(title,status,in_reply_to_status_id,attachImageURL) {
//xhr.url= login.server + "/api/statuses/update.json"; //xhr.url= login.server + "/api/statuses/update.json";
try{newsBusy.running=true;}catch(e){conversationBusy.running=true} try{newsBusy.running=true;conversationBusy.running=true}catch(e){}
xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server); xhr.setUrl(login.server);
xhr.setApi("/api/statuses/update"); if (in_reply_to_status_id==""){
xhr.clearParams(); xhr.setApi("/api/statuses/update");
xhr.setParam("source", "Friendiqa"); xhr.clearParams();
xhr.setParam("htmlstatus", status); xhr.setParam("source", "Friendiqa");
if (parentId!="") {xhr.setParam("in_reply_to_status_id", parentId)}; xhr.setParam("htmlstatus", status);
if (title!=="") {xhr.setParam("title", title)}; if (parentId!="") {xhr.setParam("in_reply_to_status_id", parentId)};
if (group_allow.length>0) {xhr.setParam("group_allow", Helperjs.cleanArray(group_allow))}; if (title!=="") {xhr.setParam("title", title)};
if (group_deny.length>0) {xhr.setParam("group_deny", Helperjs.cleanArray(group_deny))}; if (group_allow.length>0) {xhr.setParam("group_allow", Helperjs.cleanArray(group_allow))};
if (contact_allow.length>0) {xhr.setParam("contact_allow", Helperjs.cleanArray(contact_allow))}; if (group_deny.length>0) {xhr.setParam("group_deny", Helperjs.cleanArray(group_deny))};
if (contact_deny.length>0) {xhr.setParam("contact_deny", Helperjs.cleanArray(contact_deny))}; if (contact_allow.length>0) {xhr.setParam("contact_allow", Helperjs.cleanArray(contact_allow))};
if (attachImageURL.length>0) { if (contact_deny.length>0) {xhr.setParam("contact_deny", Helperjs.cleanArray(contact_deny))};
for (var image in attachImageURL){ if (attachImageURL.length>0) {
xhr.setImageFileParam("media", attachImageURL[image]); for (var image in attachImageURL){
xhr.setImageFileParam("angle", rotator.angle.toString()); xhr.setImageFileParam("media", attachImageURL[image]);
xhr.setImageFileParam("angle", rotator.angle.toString());
}
} }
}; xhr.post();
xhr.post(); Newsjs.storeHashtags(login,db,status,root)
Newsjs.storeHashtags(login,db,status,root) }else {
xhr.setApi("/api/v1/statuses");
xhr.clearParams();
xhr.setParam("status", status);
xhr.setParam("in_reply_to_id", in_reply_to_status_id);
xhr.post();
Newsjs.storeHashtags(login,db,status,root)
messageSend.destroy()
}
} }
function dmUpdate(title,text,replyto,screen_name,attachImageURL) { function dmUpdate(title,text,replyto,screen_name,attachImageURL) {
@ -124,7 +134,7 @@ Rectangle{
if (parentId!="") {xhr.setParam("replyto", replyto)}; if (parentId!="") {xhr.setParam("replyto", replyto)};
//if (title!=="") {xhr.setParam("title", title)}; //if (title!=="") {xhr.setParam("title", title)};
xhr.post(); xhr.post();
} }
function setParent(newsitemobject){ function setParent(newsitemobject){
if (newsitemobject!=""){ if (newsitemobject!=""){
@ -151,22 +161,22 @@ Rectangle{
contactModel.append({"contact":contacts[i]}) contactModel.append({"contact":contacts[i]})
} }
contactSelector.visible=true contactSelector.visible=true
},letter); },letter);
} }
function hashtagmenu(){ function hashtagmenu(){
Newsjs.listHashtags(login,db,function(tags){ Newsjs.listHashtags(login,db,function(tags){
tagModel.clear(); tagModel.clear();
for (var i=0;i<tags.length;i++){ for (var i=0;i<tags.length;i++){
tagModel.append({"tag":tags[i]}) tagModel.append({"tag":tags[i]})
} }
tagSelector.visible=true tagSelector.visible=true
}); });
} }
// Flickable{ // Flickable{
// anchors.fill: parent // anchors.fill: parent
// contentHeight: messageColumn.height // contentHeight: messageColumn.height
// boundsBehavior: Flickable.StopAtBounds // boundsBehavior: Flickable.StopAtBounds
DropArea{ DropArea{
anchors.fill: parent anchors.fill: parent
onDropped: { onDropped: {
@ -182,342 +192,349 @@ Rectangle{
} }
} }
} }
Column { Column {
y:0.5*mm y:0.5*mm
id:messageColumn id:messageColumn
spacing: 0.5*mm spacing: 0.5*mm
width: parent.width
height: 2.6*root.fontFactor*osSettings.bigFontSize+stackTypeDescription.height
Label{id:stackTypeDescription
width: parent.width width: parent.width
height: 2.6*root.fontFactor*osSettings.bigFontSize+stackTypeDescription.height horizontalAlignment:Text.AlignHCenter
Label{id:stackTypeDescription text: !conversation &&newsSwipeview.stacktype?qsTr(newsSwipeview.stacktype):""
width: parent.width font.pointSize: osSettings.bigFontSize
horizontalAlignment:Text.AlignHCenter }
text: !conversation &&newsSwipeview.stacktype?qsTr(newsSwipeview.stacktype):"" TextArea{
font.pointSize: osSettings.bigFontSize id:receiverLabel
} width: messageColumn.width
TextArea{ font.pointSize: osSettings.bigFontSize
id:receiverLabel placeholderText:qsTr("to:")
width: messageColumn.width text: ""
font.pointSize: osSettings.bigFontSize visible:false
placeholderText:qsTr("to:") onTextChanged: {
text: "" if (text!=""){contactmenu(text)} else {var receiver=getText(0,cursorPosition);contactmenu(receiver+preeditText)}}
visible:false }
onTextChanged: {
if (text!=""){contactmenu(text)} else {var receiver=getText(0,cursorPosition);contactmenu(receiver+preeditText)}}
}
TextField { TextField {
id: titleField id: titleField
x: 0.5*mm x: 0.5*mm
width: parent.width-mm width: parent.width-mm
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
placeholderText: qsTr("Title (optional)") placeholderText: qsTr("Title (optional)")
visible: false//(parentId === "") && (bodyField.length>1) visible: false//(parentId === "") && (bodyField.length>1)
onVisibleChanged: if ((visible==true)&&(conversation==true)){ onVisibleChanged: if ((visible==true)&&(conversation==true)){
conversationView.contentY=conversationView.contentY+titleField.height conversationView.contentY=conversationView.contentY+titleField.height
} }
} }
Rectangle{ Rectangle{
color: Material.backgroundColor color: Material.backgroundColor
radius: 0.5*mm radius: 0.5*mm
visible:(conversation || (newsSwipeview.stacktype!="Notifications")) visible:(conversation || (newsSwipeview.stacktype!="Notifications"))
x:mm x:mm
width: parent.width-2*mm width: parent.width-2*mm
height:Math.max(bodyField.contentHeight+4*mm,2.5*root.fontFactor*osSettings.bigFontSize) height:Math.max(bodyField.contentHeight+4*mm,2.5*root.fontFactor*osSettings.bigFontSize)
TextArea { TextArea {
id: bodyField id: bodyField
property string contactprefix:"" property string contactprefix:""
property string placeholder: osSettings.osType=="Linux"? qsTr(" Drop your Content here."):"" property string placeholder: osSettings.osType=="Linux"? qsTr(" Drop your Content here."):""
anchors.fill: parent anchors.fill: parent
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
font.family: "Noto Sans" font.family: "Noto Sans"
wrapMode: Text.Wrap wrapMode: Text.Wrap
selectByMouse: true selectByMouse: true
placeholderText: conversation?"": (qsTr("What's on your mind?")+placeholder) placeholderText: conversation?"": (qsTr("What's on your mind?")+placeholder)
textFormat: TextEdit.RichText textFormat: TextEdit.RichText
onLineCountChanged: { onLineCountChanged: {
if (messageSend.ListView.view==null){
if (newsitem.ListView.view==null){}
else {newsitem.ListView.view.contentY=newsitem.ListView.view.contentY+root.fontFactor*osSettings.systemFontSize}
}
if(conversation==true){
conversationView.contentY=conversationView.contentY+root.fontFactor*osSettings.systemFontSize
}
else{
messageSend.ListView.view.contentY=messageSend.ListView.view.contentY+root.fontFactor*osSettings.systemFontSize
}
}
onLinkActivated:{Qt.openUrlExternally(link)}
onActiveFocusChanged:{
if (activeFocus==true){
if (messageSend.ListView.view==null){ if (messageSend.ListView.view==null){
if (newsitem.ListView.view==null){} if (newsitem.ListView.view==null){}
else {newsitem.ListView.view.contentY=newsitem.ListView.view.contentY+root.fontFactor*osSettings.systemFontSize} else {newsitem.ListView.view.contentY=newsitem.ListView.view.contentY+newsitem.height/2}
} }
if(conversation==true){ else if (conversation==true){
conversationView.contentY=conversationView.contentY+root.fontFactor*osSettings.systemFontSize if(parentId==""){setParent(conversationModel.get(0).newsitemobject);}
messageSend.state="conversation";
try{conversationView.contentY=conversationView.contentY+20*mm}catch(e){}
} else if (textfocus==false){
messageSend.state="active";
newsView.positionViewAtBeginning();
} }
else{ else{
messageSend.ListView.view.contentY=messageSend.ListView.view.contentY+root.fontFactor*osSettings.systemFontSize messageSend.ListView.view.contentY=messageSend.ListView.view.contentY+8*mm
} };
} }
onLinkActivated:{Qt.openUrlExternally(link)} }
onActiveFocusChanged:{ onTextChanged:{
if (activeFocus==true){ if (text!=""){
if (messageSend.ListView.view==null){ var plaintext=getText(0,cursorPosition)
if (newsitem.ListView.view==null){} var regex1 = /@[a-z]+/;var regex2 = /\![a-z]+/;var regex3 = /\s/;
else {newsitem.ListView.view.contentY=newsitem.ListView.view.contentY+newsitem.height/2} if (regex1.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText) && !regex3.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText)){
} var letter=(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)).match(/[a-z]+/);
else if (conversation==true){ contactprefix="@";
if(parentId==""){setParent(conversationModel.get(0).newsitemobject);} contactmenu(letter.toString())
messageSend.state="conversation"; } else if( regex2.test(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)+preeditText) && !regex3.test(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)+preeditText) ){
try{conversationView.contentY=conversationView.contentY+20*mm}catch(e){} var letter=(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)).match(/[a-z]+/);
} else if (textfocus==false){ contactprefix="!";
messageSend.state="active"; contactmenu(letter.toString())
newsView.positionViewAtBeginning(); }else {contactSelector.visible=false}
} }else{contactSelector.visible=false}
else{ }
messageSend.ListView.view.contentY=messageSend.ListView.view.contentY+8*mm
};
}
}
onTextChanged:{
if (text!=""){
var plaintext=getText(0,cursorPosition)
var regex1 = /@[a-z]+/;var regex2 = /\![a-z]+/;var regex3 = /\s/;
if (regex1.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText) && !regex3.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText)){
var letter=(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)).match(/[a-z]+/);
contactprefix="@";
contactmenu(letter.toString())
} else if( regex2.test(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)+preeditText) && !regex3.test(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)+preeditText) ){
var letter=(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)).match(/[a-z]+/);
contactprefix="!";
contactmenu(letter.toString())
}else {contactSelector.visible=false}
}else{contactSelector.visible=false}
}
}
} }
}
ListView{ ListView{
id:contactSelector id:contactSelector
visible: false visible: false
z:3 z:3
x:2*root.fontFactor*osSettings.bigFontSize//8*mm x:2*root.fontFactor*osSettings.bigFontSize//8*mm
width: parent.width-2.2*root.fontFactor*osSettings.bigFontSize//9*mm width: parent.width-2.2*root.fontFactor*osSettings.bigFontSize//9*mm
height: messageSend.height/2 height: messageSend.height/2
model:contactModel model:contactModel
function processContactSelection(contact){ function processContactSelection(contact){
if(Helperjs.getCount(db,login,"contacts","screen_name",contact.screen_name)>1){ if(Helperjs.getCount(db,login,"contacts","screen_name",contact.screen_name)>1){
contact.screen_name=contact.screen_name+"+"+contacts.cid contact.screen_name=contact.screen_name+"+"+contacts.cid
} }
if (newsSwipeview.stacktype=='DirectMessages'){ if (newsSwipeview.stacktype=='DirectMessages'){
receiverLabel.text=contact.screen_name; receiverLabel.text=contact.screen_name;
reply_to_user=contact.screen_name reply_to_user=contact.screen_name
} else { } else {
bodyField.remove(bodyField.getText(0,bodyField.cursorPosition).lastIndexOf(bodyField.contactprefix,bodyField.cursorPosition),bodyField.cursorPosition); bodyField.remove(bodyField.getText(0,bodyField.cursorPosition).lastIndexOf(bodyField.contactprefix,bodyField.cursorPosition),bodyField.cursorPosition);
bodyField.insert(bodyField.cursorPosition, bodyField.contactprefix+contact.screen_name+" "); bodyField.insert(bodyField.cursorPosition, bodyField.contactprefix+contact.screen_name+" ");
bodyField.cursorPosition=bodyField.cursorPosition+contact.screen_name.length+1 bodyField.cursorPosition=bodyField.cursorPosition+contact.screen_name.length+1
} }
//receiverLabel.text=contact.screen_name; //receiverLabel.text=contact.screen_name;
contactSelector.visible=false contactSelector.visible=false
} }
delegate: ContactComponent { } delegate: ContactComponent { }
} }
ListModel{id:contactModel} ListModel{id:contactModel}
ListView{ ListView{
id: tagSelector id: tagSelector
visible: false visible: false
z:3 z:3
x:2*root.fontFactor*osSettings.bigFontSize//8*mm x:2*root.fontFactor*osSettings.bigFontSize//8*mm
width: parent.width-2.2*root.fontFactor*osSettings.bigFontSize//9*mm width: parent.width-2.2*root.fontFactor*osSettings.bigFontSize//9*mm
height: messageSend.height/2 height: messageSend.height/2
model:tagModel model:tagModel
clip: true clip: true
spacing: 0 spacing: 0
function processTagSelection(hashtag){ function processTagSelection(hashtag){
bodyField.insert(bodyField.cursorPosition, hashtag+" "); bodyField.insert(bodyField.cursorPosition, hashtag+" ");
bodyField.cursorPosition=bodyField.cursorPosition+hashtag.length+1 bodyField.cursorPosition=bodyField.cursorPosition+hashtag.length+1
tagSelector.visible=false tagSelector.visible=false
} }
delegate: MButton {text:tag;onClicked: tagSelector.processTagSelection(tag)} delegate: MButton {text:tag;onClicked: tagSelector.processTagSelection(tag)}
} }
ListModel{id:tagModel} ListModel{id:tagModel}
Item{ Item{
id:imageAttachment; id:imageAttachment;
property alias source:realimage.source property alias source:realimage.source
//property alias angle:rotator.angle //property alias angle:rotator.angle
visible: source!="" visible: source!=""
width: 45*mm width: 45*mm
height: 45*mm; height: 45*mm;
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
attachImageURLs.splice(attachImageURLs.indexOf(source),1); attachImageURLs.splice(attachImageURLs.indexOf(source),1);
imageAttachment.source="" imageAttachment.source=""
} }
} }
Image{id:realimage Image{id:realimage
source:""; source:"";
x:2*mm; x:2*mm;
width: 45*mm; width: 45*mm;
height: source==""?0:45*mm; height: source==""?0:45*mm;
fillMode: Image.PreserveAspectFit; fillMode: Image.PreserveAspectFit;
transform: Rotation {id:rotator; origin.x: 22.5*mm; origin.y: 22.5*mm; angle: 0} transform: Rotation {id:rotator; origin.x: 22.5*mm; origin.y: 22.5*mm; angle: 0}
} }
Rectangle{ Rectangle{
width: 5*mm width: 5*mm
height: 5*mm height: 5*mm
visible: imageAttachment.source!="" visible: imageAttachment.source!=""
anchors.bottom: imageAttachment.bottom anchors.bottom: imageAttachment.bottom
anchors.right: imageAttachment.right anchors.right: imageAttachment.right
color: "black" color: "black"
opacity: 0.5 opacity: 0.5
Text{anchors.centerIn:parent;text: "\uf01e";color: "white"} Text{anchors.centerIn:parent;text: "\uf01e";color: "white"}
MouseArea{ MouseArea{
anchors.fill:parent; anchors.fill:parent;
onClicked:{ onClicked:{
rotator.angle+=90; rotator.angle+=90;
}
}
}
}
Row{
id:buttonRow
visible:false //(bodyField.length>1)||(attachImageURLs.length>0)
spacing: mm
height: 2.5*root.fontFactor*osSettings.bigFontSize//12*mm
x: 0.5*mm
// MButton{id:permButton //Permissions not working in Friendica 02/2022
// visible: !conversation && (newsSwipeview.stacktype!=="DirectMessages")
// height: 2*root.fontFactor*osSettings.bigFontSize
// width: 2*root.fontFactor*osSettings.bigFontSize
// text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
// onClicked: { if (permissionDialog.visible==false){permissionDialog.visible=true} else{permissionDialog.visible=false}}
// }
MButton {
id: attachButton
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
text: "\uf03e"
visible:!conversation?(newsSwipeview.stacktype!="DirectMessages"):true
onClicked: {
if (attachImageURLs.length>0){//Server currently accepts only one attachment
Helperjs.showMessage( qsTr("Error"),qsTr("Only one attachment supported at the moment.\n Remove other attachment first!"), messageColumn)
}
else{
root.imagePicking=false;
var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
osSettings.imagePickQml+'{multiple : false;onReady: {attachImageURLs.push(imageUrl);'+
'attachImage(imageUrl)}}',root,"imagePicker");
imagePicker.pickImage()
}
}
}
MButton{
id:smileyButton
text: "\uf118"
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
onClicked: {if (smileyDialog.visible==false){smileyDialog.visible=true} else{smileyDialog.visible=false}}
}
MButton{
id:hastagButton
text: "\uf292"
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
onClicked: {if (tagSelector.visible==false){hashtagmenu()} else{tagSelector.visible=false}}
}
MButton {
id: cancelButton
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
text: "\uf057"
onClicked: {
if (textfocus==true){messageSend.destroy()}
else{
bodyField.text="";
messageSend.state="";
permissionDialog.visible=false;
receiverLabel.visible=false;
reply_to_user="";
attachImage("");
attachImageURLs.pop();
}
}
}
MButton {
id: sendButton
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
text: "\uf1d9"
onClicked: {
var title=titleField.text.replace("\"","\'");
var body=bodyField.getFormattedText(0,bodyField.length);
var dmbody=bodyField.getText(0,bodyField.length);
if (conversation || newsSwipeview.stacktype!=="DirectMessages"){
statusUpdate(title,body,parentId,attachImageURLs)
}else {
if (reply_to_user!=""){dmUpdate(title,dmbody,parentId,reply_to_user)}
else{Helperjs.showMessage(qsTr("Error"),qsTr("No receiver supplied!"),root)}
}
if (conversation==true){
newstab.newstabstatus=root.globaloptions.newsViewType; rootstackView.pop(null)
}
} }
} }
} }
PermissionDialog{id:permissionDialog;x:mm;visible: false} }
SmileyDialog{id:smileyDialog;x:mm;visible: false}
Row{
id:buttonRow
visible:false //(bodyField.length>1)||(attachImageURLs.length>0)
spacing: mm
height: 2.5*root.fontFactor*osSettings.bigFontSize//12*mm
x: 0.5*mm
// MButton{id:permButton //Permissions not working in Friendica 02/2022
// visible: !conversation && (newsSwipeview.stacktype!=="DirectMessages")
// height: 2*root.fontFactor*osSettings.bigFontSize
// width: 2*root.fontFactor*osSettings.bigFontSize
// text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
// onClicked: { if (permissionDialog.visible==false){permissionDialog.visible=true} else{permissionDialog.visible=false}}
// }
MButton {
id: attachButton
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
text: "\uf03e"
visible:!conversation?(newsSwipeview.stacktype!="DirectMessages"):true
onClicked: {
if (attachImageURLs.length>0){//Server currently accepts only one attachment
Helperjs.showMessage( qsTr("Error"),qsTr("Only one attachment supported at the moment.\n Remove other attachment first!"), messageColumn)
}
else{
root.imagePicking=false;
var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
osSettings.imagePickQml+'{multiple : false;onReady: {attachImageURLs.push(imageUrl);'+
'attachImage(imageUrl)}}',root,"imagePicker");
imagePicker.pickImage()
}
}
}
MButton{
id:smileyButton
text: "\uf118"
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
onClicked: {if (smileyDialog.visible==false){smileyDialog.visible=true} else{smileyDialog.visible=false}}
}
MButton{
id:hastagButton
text: "\uf292"
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
onClicked: {if (tagSelector.visible==false){hashtagmenu()} else{tagSelector.visible=false}}
}
MButton {
id: cancelButton
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
text: "\uf057"
onClicked: {
if (textfocus==true){messageSend.destroy()}
else{
bodyField.text="";
messageSend.state="";
permissionDialog.visible=false;
receiverLabel.visible=false;
reply_to_user="";
attachImage("");
attachImageURLs.pop();
}
}
}
MButton {
id: sendButton
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
text: "\uf1d9"
onClicked: {
var title=titleField.text.replace("\"","\'");
var body=bodyField.getFormattedText(0,bodyField.length);
var dmbody=bodyField.getText(0,bodyField.length);
if (conversation || newsSwipeview.stacktype!=="DirectMessages"){
if (parentId!=""){
statusUpdate(title,dmbody,parentId,attachImageURLs)
}else{
statusUpdate(title,body,parentId,attachImageURLs)}
}else {
if (reply_to_user!=""){dmUpdate(title,dmbody,parentId,reply_to_user)}
else{Helperjs.showMessage(qsTr("Error"),qsTr("No receiver supplied!"),root)}
}
if (conversation==true){
newstab.newstabstatus=root.globaloptions.newsViewType; rootstackView.pop(null)
}
}
}
}
PermissionDialog{id:permissionDialog;x:mm;visible: false}
SmileyDialog{id:smileyDialog;x:mm;visible: false}
}
Component.onCompleted:{
root.replySignal.connect(setParent);
root.directmessageSignal.connect(directmessagePrepare);
root.uploadSignal.connect(sendUrls);
root.sendtextSignal.connect(sendtext);
if (textfocus==true){bodyField.forceActiveFocus()}
} }
Component.onCompleted:{
root.replySignal.connect(setParent);
root.directmessageSignal.connect(directmessagePrepare);
root.uploadSignal.connect(sendUrls);
root.sendtextSignal.connect(sendtext);
if (textfocus==true){bodyField.forceActiveFocus()}
}
states: [ states: [
State { State {
name: "active" name: "active"
PropertyChanges { PropertyChanges {
target: messageColumn; height: implicitHeight target: messageColumn; height: implicitHeight
}
PropertyChanges {
target: buttonRow; visible:true
}
PropertyChanges {
target: titleField; visible:(newsSwipeview.stacktype!="DirectMessages")//true
}
PropertyChanges {
target: receiverLabel; visible:(newsSwipeview.stacktype=="DirectMessages");
}
},
State {
name: "conversation"
PropertyChanges {
target: messageColumn; height: implicitHeight
}
PropertyChanges {
target: buttonRow; visible:true
}
PropertyChanges {
target: titleField; visible:(!conversation&&newsSwipeview.stacktype!="DirectMessages")
}
},
State {
name: "reply"
PropertyChanges {
target: messageColumn; height: implicitHeight
}
PropertyChanges {
target: buttonRow; visible:true
}
PropertyChanges {
target: titleField; visible:false
}
PropertyChanges {
target: bodyField; placeholderText:"";focus:true
}
PropertyChanges {
target: stackTypeDescription; visible:false
}
} }
] PropertyChanges {
target: buttonRow; visible:true
}
PropertyChanges {
target: titleField; visible:(newsSwipeview.stacktype!="DirectMessages")//true
}
PropertyChanges {
target: receiverLabel; visible:(newsSwipeview.stacktype=="DirectMessages");
}
},
State {
name: "conversation"
PropertyChanges {
target: messageColumn; height: implicitHeight
}
PropertyChanges {
target: buttonRow; visible:true
}
PropertyChanges {
target: titleField; visible:(!conversation&&newsSwipeview.stacktype!="DirectMessages")
}
},
State {
name: "reply"
PropertyChanges {
target: messageColumn; height: implicitHeight
}
PropertyChanges {
target: buttonRow; visible:true
}
PropertyChanges {
target: titleField; visible:false
}
PropertyChanges {
target: attachButton; visible:false
}
PropertyChanges {
target: bodyField; placeholderText:"";focus:true
}
PropertyChanges {
target: stackTypeDescription; visible:false
}
}
]
} }

View file

@ -48,7 +48,7 @@ Rectangle{
MouseArea {anchors.fill:parent; MouseArea {anchors.fill:parent;
onClicked:{ onClicked:{
rootstackView.push("qrc:/qml/newsqml/NewsVideoLarge.qml",{"source": attachment.url,"mimetype": attachment.mimetype}); rootstackView.push("qrc:/qml/newsqml/NewsVideoLarge.qml",{"source": Qt.resolvedUrl(attachment.url),"mimetype": attachment.mimetype});
} }
} }
} }

View file

@ -29,8 +29,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtMultimedia 5.8 import QtMultimedia 5.15
import QtQuick 2.9 import QtQuick 2.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"

View file

@ -129,7 +129,8 @@ Item {
font.pointSize: 0.6*osSettings.systemFontSize font.pointSize: 0.6*osSettings.systemFontSize
font.family: "Noto Sans" font.family: "Noto Sans"
horizontalAlignment: Label.AlignRight horizontalAlignment: Label.AlignRight
text: (newsitemobject.in_reply_to_status_id!="null"&&newsitemobject.in_reply_to_status_id!=null)?" \u00B7 "+qsTr("In reply to ")+newsitemobject.reply_user.screen_name:" " //text: (newsitemobject.in_reply_to_status_id!="null"&&newsitemobject.in_reply_to_status_id!=null)?" \u00B7 "+qsTr("In reply to ")+newsitemobject.reply_user.screen_name:" "
text: (newsitemobject.reply_user!=false&&typeof(newsitemobject.reply_user)!="undefined")?" \u00B7 "+qsTr("In reply to ")+newsitemobject.reply_user.screen_name:" "
} }
} }
} }
@ -330,31 +331,31 @@ Item {
}} }}
} }
// CheckBox { CheckBox {
// id:favoritedCheckbox id:favoritedCheckbox
// visible:((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3)) visible:((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))
// width: newsitem.width/5 width: newsitem.width/5
// height: parent.height height: parent.height
// indicator:Rectangle{ indicator:Rectangle{
// implicitWidth: newsitem.width/5 implicitWidth: newsitem.width/5
// implicitHeight:root.fontFactor*osSettings.bigFontSize implicitHeight:root.fontFactor*osSettings.bigFontSize
// color:"transparent" color:"transparent"
// Text{ Text{
// anchors.centerIn: parent anchors.centerIn: parent
// font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
// font.family:fontAwesome.name font.family:fontAwesome.name
// color: favoritedCheckbox.checked?Material.primaryTextColor: Material.secondaryTextColor color: favoritedCheckbox.checked?Material.primaryTextColor: Material.secondaryTextColor
// text:"\uf005" text:"\uf005"
// } }
// } }
// checked:(newsitemobject.favorited>0) checked:(newsitemobject.favorited>0)
// onClicked:{ onClicked:{
// if(favoritedCheckbox.checkState==Qt.Checked){ if(favoritedCheckbox.checkState==Qt.Checked){
// Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1} Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
// else if(favoritedCheckbox.checkState==Qt.Unchecked){ else if(favoritedCheckbox.checkState==Qt.Unchecked){
// Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0} Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
// } }
// } }
Rectangle{ Rectangle{
width: newsitem.width/5 width: newsitem.width/5
height: parent.height height: parent.height

View file

@ -58,16 +58,16 @@ StackView{
if(albums.indexOf(fotorectangle.newimages[i].album)==-1){ if(albums.indexOf(fotorectangle.newimages[i].album)==-1){
filesystem.Directory=root.login.imagestore+"/albums"; filesystem.Directory=root.login.imagestore+"/albums";
filesystem.makeDir(fotorectangle.newimages[i].album)} filesystem.makeDir(fotorectangle.newimages[i].album)}
ownimagelist.push(root.login.server+"/api/friendica/photo?photo_id="+fotorectangle.newimages[i].id);
//ownimagelist.push(root.login.server+"/api/friendica/photo?scale='0'&photo_id="+fotorectangle.newimages[i].id);
} }
Imagejs.dataRequest(login,fotorectangle.newimages[0],db,xhr,fotorectangle); //Imagejs.dataRequest(login,fotorectangle.newimages[0],db,xhr,fotorectangle);
}) })
// xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
// xhr.setImagedir(login.imagestore); xhr.setImagedir(login.imagestore);
// xhr.setFilelist(ownimagelist); print("ownimagelist "+JSON.stringify(ownimagelist))
// xhr.setDownloadtype("picturelist"); xhr.setFilelist(ownimagelist);
// xhr.getlist(); xhr.setDownloadtype("picturelist");
xhr.getlist();
newImagesProgress.visible=true newImagesProgress.visible=true
} }
} }
@ -78,7 +78,7 @@ StackView{
fotorectangle.newimages=[];fotorectangle.currentimageno=0 fotorectangle.newimages=[];fotorectangle.currentimageno=0
}else{ }else{
// download next image // download next image
Imagejs.dataRequest(login,fotorectangle.newimages[currentimageno],db,xhr,fotorectangle) //Imagejs.dataRequest(login,fotorectangle.newimages[currentimageno],db,xhr,fotorectangle)
} }
} }
@ -95,8 +95,8 @@ StackView{
} }
function onError(data,url,api,code){ function onError(data,url,api,code){
if(data=="picturelist"){ if(data=="picturelist"){
var requestid=url.substring(url.lastIndexOf("=")+1); // var requestid=api.substring(api.lastIndexOf("=")+1);
Imagejs.dataRequest(login,requestid,db,xhr,fotorectangle); // Imagejs.dataRequest(login,requestid,db,xhr,fotorectangle);
fotorectangle.currentimageno=fotorectangle.currentimageno+1 fotorectangle.currentimageno=fotorectangle.currentimageno+1
} else if (data=="picture"){ } else if (data=="picture"){
Helperjs.deleteData(root.db,"imageData",root.login.username,function(){ Helperjs.deleteData(root.db,"imageData",root.login.username,function(){