Friendiqa v0.3

This commit is contained in:
LubuWest 2018-07-01 15:09:21 +02:00
parent 585e329bcb
commit bda2d9f7b5
63 changed files with 2746 additions and 1357 deletions

View File

@ -64,3 +64,13 @@
* Link to list of public server on Config Tab * Link to list of public server on Config Tab
* Small redesign of SendMessage page * Small redesign of SendMessage page
* Intents for texts/urls (Send text or url from everywhere to create message) * Intents for texts/urls (Send text or url from everywhere to create message)
## v0.3 ##
* Fix for [issue 6](https://github.com/LubuWest/Friendiqa/issues/6)
* Refactoring of news part
* Search button for news
* Click on hashtag in newsitem starts search for news with that word
* Public timeline
* Timeline for selected group
* Small redesign of SendMessage page

BIN
Friendiqa_v0.3.apk Normal file

Binary file not shown.

View File

@ -18,7 +18,9 @@ QML based client for the Friendica Social Network.
# News # # News #
Currently supported: Currently supported:
* Shows Posts from friends, favorited messages, Direct Messages and Notifications * Shows Posts from friends, selected group, favorited messages, public timeline, Direct Messages and notifications
* Search button for news
* Click on hashtag in newsitem starts search for news with that word
* Open links in external browser * Open links in external browser
* Click on contact photo for contact details * Click on contact photo for contact details
* Click on like text for additional contact info * Click on like text for additional contact info

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.2.2" android:versionCode="6" android:installLocation="auto"> <manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.3" android:versionCode="7" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:vmSafeMode="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Friendiqa" android:icon="@drawable/friendiqa" android:logo="@drawable/friendiqa" android:theme="@android:style/Theme.Holo.Light"> <application android:hardwareAccelerated="true" android:vmSafeMode="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Friendiqa" android:icon="@drawable/friendiqa" android:logo="@drawable/friendiqa" android:theme="@android:style/Theme.Holo.Light">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="androidnative.friendiqa.FriendiqaActivity" android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleInstance" android:taskAffinity=""> <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="androidnative.friendiqa.FriendiqaActivity" android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleInstance" android:taskAffinity="">
<intent-filter> <intent-filter>

View File

@ -21,7 +21,6 @@ public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.Qt
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if((getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY)) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_NEW_TASK) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) || (getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED))) { if((getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY)) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_NEW_TASK) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) || (getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED))) {
SystemDispatcher.onActivityResume(); SystemDispatcher.onActivityResume();
} else { } else {

View File

@ -135,7 +135,7 @@ public class SystemDispatcher {
message.put("requestCode",requestCode); message.put("requestCode",requestCode);
message.put("resultCode",resultCode); message.put("resultCode",resultCode);
message.put("data",data); message.put("data",data);
Log.d(TAG,"onActivityResult" + isInitialized);
if(isInitialized) { if(isInitialized) {
dispatch(ACTIVITY_RESULT_MESSAGE,message); dispatch(ACTIVITY_RESULT_MESSAGE,message);
waitingIntent=null; waitingIntent=null;

View File

@ -217,7 +217,9 @@
<file>js/image.js</file> <file>js/image.js</file>
<file>qml/contactqml/ProfileComponent.qml</file> <file>qml/contactqml/ProfileComponent.qml</file>
<file>translations/friendiqa-it.ts</file> <file>translations/friendiqa-it.ts</file>
<file>translations/friendiqa-it.qm</file> <file>qml/genericqml/Search.qml</file>
<file>qml/newsqml/Hashtag.qml</file>
<file>qml/genericqml/IntentReceiver.qml</file> <file>qml/genericqml/IntentReceiver.qml</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -73,6 +73,10 @@ QString FILESYSTEM::homePath() const
// return dir.exists(); // return dir.exists();
//} //}
bool FILESYSTEM::fileexist(QString name)
{ return QFile::exists(name);
}
void FILESYSTEM::makeDir(QString name) void FILESYSTEM::makeDir(QString name)
{ {
QDir dir(m_Directory); QDir dir(m_Directory);
@ -113,47 +117,3 @@ QFileInfoList FILESYSTEM::fileList()
//qDebug() << "filelist " << m_Filelist; //qDebug() << "filelist " << m_Filelist;
return dir.entryInfoList(); return dir.entryInfoList();
} }
//void FILESYSTEM::searchImage()
//{
// QAndroidJniObject ACTION_PICK = QAndroidJniObject::getStaticObjectField("android/content/Intent", "ACTION_PICK", "Ljava/lang/String;");
// QAndroidJniObject EXTERNAL_CONTENT_URI = QAndroidJniObject::getStaticObjectField("android/provider/MediaStore$Images$Media", "EXTERNAL_CONTENT_URI", "Landroid/net/Uri;");
// QAndroidJniObject intent=QAndroidJniObject("android/content/Intent", "(Ljava/lang/String;Landroid/net/Uri;)V", ACTION_PICK.object<jstring>(), EXTERNAL_CONTENT_URI.object<jobject>());
// if (ACTION_PICK.isValid() && intent.isValid())
// {
// intent.callObjectMethod("setType", "(Ljava/lang/String;)Landroid/content/Intent;", QAndroidJniObject::fromString("image/*").object<jstring>());
// QtAndroid::startActivity(intent.object<jobject>(), 101,this);
// qDebug() << "OK";
// }
// else
// {
// qDebug() << "ERRO";
// }
//}
//void FILESYSTEM::handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data)
//{
// jint RESULT_OK = QAndroidJniObject::getStaticField<jint>("android/app/Activity", "RESULT_OK");
// if (receiverRequestCode == 101 && resultCode == RESULT_OK)
// {
// QAndroidJniObject uri = data.callObjectMethod("getData", "()Landroid/net/Uri;");
// QAndroidJniObject dadosAndroid = QAndroidJniObject::getStaticObjectField("android/provider/MediaStore$MediaColumns", "DATA", "Ljava/lang/String;");
// QAndroidJniEnvironment env;
// jobjectArray projecao = (jobjectArray)env->NewObjectArray(1, env->FindClass("java/lang/String"), NULL);
// jobject projacaoDadosAndroid = env->NewStringUTF(dadosAndroid.toString().toStdString().c_str());
// env->SetObjectArrayElement(projecao, 0, projacaoDadosAndroid);
// QAndroidJniObject contentResolver = QtAndroid::androidActivity().callObjectMethod("getContentResolver", "()Landroid/content/ContentResolver;");
// QAndroidJniObject cursor = contentResolver.callObjectMethod("query", "(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", uri.object<jobject>(), projecao, NULL, NULL, NULL);
// jint columnIndex = cursor.callMethod<jint>("getColumnIndex", "(Ljava/lang/String;)I", dadosAndroid.object<jstring>());
// cursor.callMethod<jboolean>("moveToFirst", "()Z");
// QAndroidJniObject resultUri = cursor.callObjectMethod("getString", "(I)Ljava/lang/String;", columnIndex);
// QString imageSelect = "file://" + resultUri.toString();
// emit imageselected(imageSelect);
// }
// else
// {
// qDebug() << "Select error";
// }
//}

View File

@ -65,6 +65,7 @@ signals:
void error(QString data, int code); void error(QString data, int code);
public slots: public slots:
bool fileexist(QString name);
void makeDir(QString name); void makeDir(QString name);
void rmDir(); void rmDir();
void rmFile(QString name); void rmFile(QString name);

View File

@ -59,6 +59,14 @@ void XHR::setUrl(QString url)
} }
} }
void XHR::setApi(QString api)
{
if (api!=m_api) {
m_api = api;
emit apiChanged();
}
}
void XHR::setLogin(QString login) void XHR::setLogin(QString login)
{ {
if (login!=m_login) { if (login!=m_login) {
@ -111,6 +119,11 @@ QString XHR::url() const
return m_url; return m_url;
} }
QString XHR::api() const
{
return m_api;
}
QString XHR::login() const QString XHR::login() const
{ {
return m_login; return m_login;
@ -166,6 +179,7 @@ void XHR::download()
request.setRawHeader("Authorization", headerData.toLocal8Bit()); request.setRawHeader("Authorization", headerData.toLocal8Bit());
} }
request.setUrl(requrl); request.setUrl(requrl);
//qDebug() << requrl;
reply = manager.get(request); reply = manager.get(request);
reply->ignoreSslErrors(); reply->ignoreSslErrors();
connect(reply, &QNetworkReply::readyRead,this, &XHR::onReadyRead); connect(reply, &QNetworkReply::readyRead,this, &XHR::onReadyRead);
@ -185,9 +199,9 @@ void XHR::get()
query.addQueryItem(i.key(), i.value()); query.addQueryItem(i.key(), i.value());
} }
QUrl requrl(m_url); QUrl requrl(m_url+m_api);
//qDebug() << requrl;
requrl.setQuery(query); requrl.setQuery(query);
QByteArray loginData = m_login.toLocal8Bit().toBase64(); QByteArray loginData = m_login.toLocal8Bit().toBase64();
QString headerData = "Basic " + loginData; QString headerData = "Basic " + loginData;
request.setRawHeader("Authorization", headerData.toLocal8Bit()); request.setRawHeader("Authorization", headerData.toLocal8Bit());
@ -250,7 +264,7 @@ void XHR::post()
QString headerData = "Basic " + loginData; QString headerData = "Basic " + loginData;
request.setRawHeader(QByteArray("Authorization"), headerData.toLocal8Bit()); request.setRawHeader(QByteArray("Authorization"), headerData.toLocal8Bit());
request.setUrl(m_url); request.setUrl(m_url+m_api);
reply = manager.post(request, multiPart); reply = manager.post(request, multiPart);
qDebug() << "\t request sent"; qDebug() << "\t request sent";
connect(reply, &QNetworkReply::finished, this, &XHR::onReplySuccess); connect(reply, &QNetworkReply::finished, this, &XHR::onReplySuccess);
@ -263,7 +277,7 @@ void XHR::post()
void XHR::onReplyError(QNetworkReply::NetworkError code) void XHR::onReplyError(QNetworkReply::NetworkError code)
{ {
qDebug() << code; qDebug() << code;
emit this->error( bufferToString(), m_url, (int) code); emit this->error( bufferToString(), m_url,m_api, (int) code);
buffer.clear(); buffer.clear();
reply->deleteLater(); reply->deleteLater();
} }
@ -271,7 +285,7 @@ void XHR::onReplyError(QNetworkReply::NetworkError code)
void XHR::onReplySuccess() void XHR::onReplySuccess()
{ {
qDebug() << "!"; qDebug() << "!";
emit this->success( bufferToString() ); emit this->success( bufferToString(), m_api);
buffer.clear(); buffer.clear();
// reply->deleteLater(); // reply->deleteLater();
} }
@ -279,7 +293,7 @@ void XHR::onReplySuccess()
void XHR::onRequestFinished() void XHR::onRequestFinished()
{ {
// Save the file here // Save the file here
if (buffer.isNull()){qDebug() << "File empty"<<m_url; buffer.clear(); emit this->error(m_downloadtype,m_url,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);
QJsonObject jsonObject = jsonResponse.object(); QJsonObject jsonObject = jsonResponse.object();

View File

@ -56,6 +56,7 @@ public:
explicit XHR(QObject *parent = 0); explicit XHR(QObject *parent = 0);
QString url() const; QString url() const;
QString api() const;
QString login() const; QString login() const;
QString filename() const; QString filename() const;
QList<QString> contactlist() const; QList<QString> contactlist() const;
@ -65,6 +66,7 @@ public:
signals: signals:
void urlChanged(); void urlChanged();
void apiChanged();
void loginChanged(); void loginChanged();
void filenameChanged(); void filenameChanged();
void contactlistChanged(); void contactlistChanged();
@ -73,11 +75,12 @@ signals:
void downloadtypeChanged(); void downloadtypeChanged();
void downloaded(QString type, QString url, QString filename, int i); void downloaded(QString type, QString url, QString filename, int i);
void downloadedjson(QString type, QString url, QString filename, int i,QJsonObject jsonObject); void downloadedjson(QString type, QString url, QString filename, int i,QJsonObject jsonObject);
void success(QString data); void success(QString data, QString api);
void error(QString data, QString url, int code); void error(QString data, QString url,QString api, int code);
public slots: public slots:
void setUrl(QString url); void setUrl(QString url);
void setApi(QString api);
void setLogin(QString login); void setLogin(QString login);
void setDownloadtype(QString downloadtype); void setDownloadtype(QString downloadtype);
void setFilename(QString filename); void setFilename(QString filename);
@ -103,6 +106,7 @@ private slots:
private: private:
QByteArray buffer; QByteArray buffer;
QString m_url; QString m_url;
QString m_api;
QString m_login; QString m_login;
QString m_filename; QString m_filename;
QString m_downloadtype; QString m_downloadtype;

View File

@ -37,7 +37,7 @@ function friendicaRequest(login,api,rootwindow,callback) {
xhrequest.onreadystatechange = function() { xhrequest.onreadystatechange = function() {
if(xhrequest.readyState === XMLHttpRequest.DONE) { if(xhrequest.readyState === XMLHttpRequest.DONE) {
try{ try{
if (xhrequest.status=200){ if (xhrequest.status==200){
callback(xhrequest.responseText) callback(xhrequest.responseText)
}else{ }else{
showMessage("Error","API:\n" +login.server+api+"\n NO RESPONSE"+xhrequest.statusText,rootwindow); showMessage("Error","API:\n" +login.server+api+"\n NO RESPONSE"+xhrequest.statusText,rootwindow);
@ -65,7 +65,7 @@ function friendicaPostRequest(login,api,data,method,rootwindow,callback) {
callback(xhrequest.responseText) callback(xhrequest.responseText)
} }
} }
catch (e){showMessage("Error", "API:\n" + +api+" "+e+"\n Return:"+xhrequest.responseText,rootwindow)} catch (e){showMessage("Error", "API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText,rootwindow)}
} }
} }
xhrequest.open(method, login.server+api,true,login.username,Qt.atob(login.password)); xhrequest.open(method, login.server+api,true,login.username,Qt.atob(login.password));
@ -151,7 +151,7 @@ var where = " AND "+ filter +" = '" + filtervalue+"'";
}); });
} }
function showMessage(header,message,rootwindow){//print("message: "+message); function showMessage(header,message,rootwindow){print("message: "+message);
var cleanmessage=message.replace(/"/g,"-"); //print(cleanmessage); var cleanmessage=message.replace(/"/g,"-"); //print(cleanmessage);
if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'} if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
var messageString='import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:"'+header+'";standardButtons: StandardButton.Ok; text:" '+cleanmessage+'"}'; var messageString='import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:"'+header+'";standardButtons: StandardButton.Ok; text:" '+cleanmessage+'"}';

View File

@ -38,7 +38,7 @@ function requestFriends(login,database,rootwindow,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('UPDATE contacts SET isFriend=0 where username="'+login.username+'"')}); // clean old friends var result = tx.executeSql('UPDATE contacts SET isFriend=0 where username="'+login.username+'"')}); // clean old friends
Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){ Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){
var friends=JSON.parse(obj); var friends=JSON.parse(obj);
for (var i=0;i<friends.length;i++){ friends[i].isFriend=1} for (var i=0;i<friends.length;i++){ friends[i].isFriend=1}
//try{requestProfile(login,friends,rootwindow,function(friends_profile){callback(friends_profile)})} //try{requestProfile(login,friends,rootwindow,function(friends_profile){callback(friends_profile)})}
@ -47,8 +47,6 @@ function requestFriends(login,database,rootwindow,callback){
}); });
} }
function requestGroups(login,database,rootwindow,callback){ function requestGroups(login,database,rootwindow,callback){
// retrieve, save and return groups. Other features currently not implemented // retrieve, save and return groups. Other features currently not implemented
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
@ -87,23 +85,34 @@ function deleteGroup(login,database,rootwindow,group, callback){
}); });
}})} }})}
function getLastNews(login,database){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var lastnewsid=0;
db.transaction( function(tx) {
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1');
try{lastnewsid=result.rows.item(0).status_id;}catch(e){};
return lastnewsid
})
}
function getFriendsTimeline(login,database,contacts,onlynew,rootwindow,callback){
// retrieve and return timeline since last news, return contacts which are not friends and older than 2 days for update (friends can be updated in Contactstab)
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); //function getFriendsTimeline(login,database,contacts,onlynew,rootwindow,callback){
var parameter = "?count=50"; // // retrieve and return timeline since last news, return contacts which are not friends and older than 2 days for update (friends can be updated in Contactstab)
if(onlynew){db.transaction( function(tx) { // var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1'); // check for last news id // var parameter = "?count=50";
try{parameter=parameter+"&since_id="+result.rows.item(0).status_id;}catch(e){};})} // if(onlynew){db.transaction( function(tx) {
var newContacts=[]; // var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1'); // check for last news id
Helperjs.friendicaRequest(login,"/api/statuses/friends_timeline"+parameter, rootwindow,function (obj){ // try{parameter=parameter+"&since_id="+result.rows.item(0).status_id;}catch(e){};})}
var news=JSON.parse(obj); // var newContacts=[];
if (news.hasOwnProperty('status')){ // Helperjs.friendicaRequest(login,"/api/statuses/friends_timeline"+parameter, rootwindow,function (obj){
Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+"/api/statuses/friends_timeline"+parameter+"\n Return: \n"+obj,rootwindow) // var news=JSON.parse(obj);
} // if (news.hasOwnProperty('status')){
var newContacts=findNewContacts(news,contacts); // Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+"/api/statuses/friends_timeline"+parameter+"\n Return: \n"+obj,rootwindow)
callback(news,newContacts) // }
})} // var newContacts=findNewContacts(news,contacts);
// callback(news,newContacts)
//})}
function getCurrentContacts(login,database,callback){ function getCurrentContacts(login,database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
@ -121,7 +130,7 @@ function getCurrentContacts(login,database,callback){
contactlist.push(result2.rows.item(j).url ) contactlist.push(result2.rows.item(j).url )
} }
}) })
callback(contactlist) callback(contactlist)
} }
function findNewContacts(news,contacts){ function findNewContacts(news,contacts){
@ -132,7 +141,7 @@ function findNewContacts(news,contacts){
news[i].user.isFriend=0; news[i].user.isFriend=0;
newContacts.push(news[i].user); newContacts.push(news[i].user);
} }
if (news[i].friendica_activities.like.length>0){ if (news[i].hasOwnProperty('friendica_activities') && news[i].friendica_activities.like.length>0){
for (var j=0;j<news[i].friendica_activities.like.length;j++){ for (var j=0;j<news[i].friendica_activities.like.length;j++){
var like_url=news[i].friendica_activities.like[j].url; var like_url=news[i].friendica_activities.like[j].url;
if(contacts.indexOf(like_url)==-1 && !(inArray(newContacts,"url",like_url))){ if(contacts.indexOf(like_url)==-1 && !(inArray(newContacts,"url",like_url))){
@ -141,7 +150,7 @@ function findNewContacts(news,contacts){
} }
} }
} }
if (news[i].friendica_activities.dislike.length>0){ if (news[i].hasOwnProperty('friendica_activities') && news[i].friendica_activities.dislike.length>0){
for (var k=0;j<news[k].friendica_activities.dislike.length;k++){ for (var k=0;j<news[k].friendica_activities.dislike.length;k++){
var dislike_url=news[i].friendica_activities.dislike[k].url; var dislike_url=news[i].friendica_activities.dislike[k].url;
if(contacts.indexOf(dislike_url)==-1 && !(inArray(newContacts,"url",dislike_url))){ if(contacts.indexOf(dislike_url)==-1 && !(inArray(newContacts,"url",dislike_url))){
@ -151,118 +160,123 @@ function findNewContacts(news,contacts){
} }
} }
var owner_url=news[i].friendica_owner.url; if(news[i].hasOwnProperty('friendica_owner')){
if(contacts.indexOf(owner_url)==-1 && !(inArray(newContacts,"url",owner_url))){ var owner_url=news[i].friendica_owner.url;
news[i].friendica_owner.isFriend=0; if(contacts.indexOf(owner_url)==-1 && !(inArray(newContacts,"url",owner_url))){
newContacts.push(news[i].friendica_owner); news[i].friendica_owner.isFriend=0;
} newContacts.push(news[i].friendica_owner);
}
}
} }
return newContacts return newContacts
} }
function storeNews(login,database,news,rootwindow,callback){ function storeNews(login,database,news,rootwindow){
// save news after contacts download, call next function // save news after contacts download, call next function
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
for (var i=0;i<news.length;i++){ for (var i=0;i<news.length;i++){
//print('store news data for ' + news[i].id+JSON.stringify(news[i].friendica_activities)); //print('store news data for ' + news[i].id+JSON.stringify(news[i].friendica_activities));
//var ausdruck=news[i]; //var ausdruck=news[i];
var likearray=[]; for (var user in news[i].friendica_activities.like){likearray.push(news[i].friendica_activities.like[user].url)} var likearray=[];var dislikearray=[];var attendyesarray=[];var attendnoarray=[];var attendmaybearray=[];
var dislikearray=[]; for (var user in news[i].friendica_activities.dislike){dislikearray.push(news[i].friendica_activities.dislike[user].url)} if(news[i].hasOwnProperty('friendica_activities')){
var attendyesarray=[]; for (var user in news[i].friendica_activities.attendyes){attendyesarray.push(news[i].friendica_activities.attendyes[user].url)} for (var user in news[i].friendica_activities.like){likearray.push(news[i].friendica_activities.like[user].url)}
var attendnoarray=[]; for (var user in news[i].friendica_activities.attendno){attendnoarray.push(news[i].friendica_activities.attendno[user].url)} for (var user in news[i].friendica_activities.dislike){dislikearray.push(news[i].friendica_activities.dislike[user].url)}
var attendmaybearray=[]; for (var user in news[i].friendica_activities.attendmaybe){attendmaybearray.push(news[i].friendica_activities.attendmaybe[user].url)} for (var user in news[i].friendica_activities.attendyes){attendyesarray.push(news[i].friendica_activities.attendyes[user].url)}
for (var user in news[i].friendica_activities.attendno){attendnoarray.push(news[i].friendica_activities.attendno[user].url)}
for (var user in news[i].friendica_activities.attendmaybe){attendmaybearray.push(news[i].friendica_activities.attendmaybe[user].url)}
}
var friendica_activities=[likearray,dislikearray,attendyesarray,attendnoarray,attendmaybearray] var friendica_activities=[likearray,dislikearray,attendyesarray,attendnoarray,attendmaybearray]
var attachments="";if (news[i].attachments){attachments=Qt.btoa(JSON.stringify(news[i].attachments))} var attachments="";if (news[i].attachments){attachments=Qt.btoa(JSON.stringify(news[i].attachments))}
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+news[i].id+'" AND messagetype=0'); // check for news id var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+news[i].id+'" AND messagetype=0'); // check for news id
if(result.rows.length === 1) {// use update if(result.rows.length === 1) {// use update
//print(news[i].id +' news exists, update it'+'UPDATE news SET username="'+login.username+'", messagetype=0, text="'+Qt.btoa(news[i].text)+'", created_at="'+Date.parse(cleanDate(news[i].created_at))+'", in_reply_to_status_id="'+news[i].in_reply_to_status_id+'", source="'+news[i].source+'", status_id="'+news[i].id+'", in_reply_to_user_id="'+news[i].in_reply_to_user_id+'", geo="'+news[i].geo+'", favorited="'+news[i].favorited+'", uid="'+news[i].user.id+'", statusnet_html="'+Qt.btoa(news[i].status_html)+'", statusnet_conversation_id="'+news[i].statusnet_conversation_id+'",friendica_activities="'+Qt.btoa(JSON.stringify(friendica_activities))+'",attachments="'+attachments+'",friendica_owner="'+news[i].friendica_owner.url+'" where username="'+login.username+'" AND status_id="'+news[i].status_id+'" AND messagetype=0') //print(news[i].id +' news exists, update it'+'UPDATE news SET username="'+login.username+'", messagetype=0, text="'+Qt.btoa(news[i].text)+'", created_at="'+Date.parse(cleanDate(news[i].created_at))+'", in_reply_to_status_id="'+news[i].in_reply_to_status_id+'", source="'+news[i].source+'", status_id="'+news[i].id+'", in_reply_to_user_id="'+news[i].in_reply_to_user_id+'", geo="'+news[i].geo+'", favorited="'+news[i].favorited+'", uid="'+news[i].user.id+'", statusnet_html="'+Qt.btoa(news[i].status_html)+'", statusnet_conversation_id="'+news[i].statusnet_conversation_id+'",friendica_activities="'+Qt.btoa(JSON.stringify(friendica_activities))+'",attachments="'+attachments+'",friendica_owner="'+news[i].friendica_owner.url+'" where username="'+login.username+'" AND status_id="'+news[i].status_id+'" AND messagetype=0')
result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=0, text="'+Qt.btoa(news[i].text)+'", created_at="'+Date.parse(cleanDate(news[i].created_at))+'", in_reply_to_status_id="'+news[i].in_reply_to_status_id+'", source="'+news[i].source+'", status_id="'+news[i].id+'", in_reply_to_user_id="'+news[i].in_reply_to_user_id+'", geo="'+news[i].geo+'", favorited="'+news[i].favorited+'", uid="'+news[i].user.id+'", statusnet_html="'+Qt.btoa(news[i].status_html)+'", statusnet_conversation_id="'+news[i].statusnet_conversation_id+'",friendica_activities="'+Qt.btoa(JSON.stringify(friendica_activities))+'",attachments="'+attachments+'",friendica_owner="'+news[i].friendica_owner.url+'" where username="'+login.username+'" AND status_id="'+news[i].status_id+'" AND messagetype=0'); result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=0, text="'+Qt.btoa(news[i].text)+'", created_at="'+news[i].created_at+'", in_reply_to_status_id="'+news[i].in_reply_to_status_id+'", source="'+news[i].source+'", status_id="'+news[i].id+'", in_reply_to_user_id="'+news[i].in_reply_to_user_id+'", geo="'+news[i].geo+'", favorited="'+news[i].favorited+'", uid="'+news[i].user.id+'", statusnet_html="'+Qt.btoa(news[i].status_html)+'", statusnet_conversation_id="'+news[i].statusnet_conversation_id+'",friendica_activities="'+Qt.btoa(JSON.stringify(friendica_activities))+'",attachments="'+attachments+'",friendica_owner="'+news[i].friendica_owner.url+'" where username="'+login.username+'" AND status_id="'+news[i].status_id+'" AND messagetype=0');
} else {// use insert } else {// use insert
result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,in_reply_to_status_id,source,status_id,in_reply_to_user_id,geo,favorited,uid,statusnet_html,statusnet_conversation_id,friendica_activities,friendica_activities_self,attachments,friendica_owner) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,0,Qt.btoa(news[i].text),Date.parse(cleanDate(news[i].created_at)), news[i].in_reply_to_status_id, news[i].source, news[i].id,news[i].in_reply_to_user_id,news[i].geo,news[i].favorited, news[i].user.id,Qt.btoa(news[i].statusnet_html),news[i].statusnet_conversation_id, Qt.btoa(JSON.stringify(friendica_activities)),"[]",attachments,news[i].friendica_owner.url])}}) result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,in_reply_to_status_id,source,status_id,in_reply_to_user_id,geo,favorited,uid,statusnet_html,statusnet_conversation_id,friendica_activities,friendica_activities_self,attachments,friendica_owner) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,0,Qt.btoa(news[i].text),news[i].created_at, news[i].in_reply_to_status_id, news[i].source, news[i].id,news[i].in_reply_to_user_id,news[i].geo,news[i].favorited, news[i].user.id,Qt.btoa(news[i].statusnet_html),news[i].statusnet_conversation_id, Qt.btoa(JSON.stringify(friendica_activities)),"[]",attachments,news[i].friendica_owner.url])}})
} }
getDirectMessage(login,database,rootwindow,callback) // getDirectMessage(login,database,rootwindow,callback)
} }
function getDirectMessage(login,database,rootwindow,callback){ //function getDirectMessage(login,database,rootwindow,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); // var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var parameter = ""; // var parameter = "";
db.transaction( function(tx) { // db.transaction( function(tx) {
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=1 ORDER BY status_id DESC LIMIT 1'); // check for last news id // var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=1 ORDER BY status_id DESC LIMIT 1'); // check for last news id
try{parameter="&since_id="+result.rows.item(0).status_id;}catch(e){};}) // try{parameter="&since_id="+result.rows.item(0).status_id;}catch(e){};})
Helperjs.friendicaRequest(login,"/api/direct_messages/all"+parameter,rootwindow, function (obj){ // Helperjs.friendicaRequest(login,"/api/direct_messages/all"+parameter,rootwindow, function (obj){
var messages=JSON.parse(obj); // var messages=JSON.parse(obj);
for (var i=0;i<messages.length;i++){ // for (var i=0;i<messages.length;i++){
//print('store message data for '+JSON.stringify(messages[i])); // //print('store message data for '+JSON.stringify(messages[i]));
db.transaction( function(tx) { // db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from news where username= "'+login.username+'" AND status_id = "'+messages[i].id+'" AND messagetype=1'); // check for news id // var result = tx.executeSql('SELECT * from news where username= "'+login.username+'" AND status_id = "'+messages[i].id+'" AND messagetype=1'); // check for news id
if(result.rows.length === 1) {// use update // if(result.rows.length === 1) {// use update
print(messages[i].id +' directmessage exists, update it') // print(messages[i].id +' directmessage exists, update it')
result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=1, text="'+Qt.btoa(messages[i].text)+'", created_at="'+Date.parse(cleanDate(messages[i].created_at))+'", source="Friendica", status_id="'+messages[i].id+'", uid="'+messages[i].sender.id+'", statusnet_html="'+Qt.btoa(messages[i].text)+'", statusnet_conversation_id="'+messages[i].friendica_parent_uri+'" where username="'+login.username+'" AND status_id="'+messages[i].status_id+'" AND messagetype=1'); // result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=1, text="'+Qt.btoa(messages[i].text)+'", created_at="'+Date.parse(cleanDate(messages[i].created_at))+'", source="Friendica", status_id="'+messages[i].id+'", uid="'+messages[i].sender.id+'", statusnet_html="'+Qt.btoa(messages[i].text)+'", statusnet_conversation_id="'+messages[i].friendica_parent_uri+'" where username="'+login.username+'" AND status_id="'+messages[i].status_id+'" AND messagetype=1');
} else {// use insert // } else {// use insert
result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,source,status_id,uid,statusnet_html,statusnet_conversation_id) VALUES (?,?,?,?,?,?,?,?,?)', [login.username,1,Qt.btoa(messages[i].text),Date.parse(cleanDate(messages[i].created_at)), "Friendica", messages[i].id, messages[i].sender.id,Qt.btoa(messages[i].text),messages[i].friendica_parent_uri])} // result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,source,status_id,uid,statusnet_html,statusnet_conversation_id) VALUES (?,?,?,?,?,?,?,?,?)', [login.username,1,Qt.btoa(messages[i].text),Date.parse(cleanDate(messages[i].created_at)), "Friendica", messages[i].id, messages[i].sender.id,Qt.btoa(messages[i].text),messages[i].friendica_parent_uri])}
}); // });
} // }
}) // })
callback() // callback()
// if(login.newsViewType=="Timeline"){newsfromdb(database,login.username,callback)} //// if(login.newsViewType=="Timeline"){newsfromdb(database,login.username,callback)}
// else{chatsfromdb(database,login.username,callback)} //// else{chatsfromdb(database,login.username,callback)}
} //}
function getNotifications(login,database,rootwindow,callback){ //function getNotifications(login,database,rootwindow,callback){
Helperjs.friendicaRequest(login,"/api/friendica/notifications", rootwindow,function (obj){ // Helperjs.friendicaRequest(login,"/api/friendica/notifications", rootwindow,function (obj){
var messages=JSON.parse(obj); // var messages=JSON.parse(obj);
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); // var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
for (var i=0;i<messages.length;i++){ // for (var i=0;i<messages.length;i++){
//print('store message data for '+JSON.stringify(messages[i])); // //print('store message data for '+JSON.stringify(messages[i]));
db.transaction( function(tx) { // db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+messages[i].id+'" AND messagetype=2'); // check for news id // var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+messages[i].id+'" AND messagetype=2'); // check for news id
if(result.rows.length === 1) {// use update // if(result.rows.length === 1) {// use update
print(messages[i].id +' Notification exists, update it') // print(messages[i].id +' Notification exists, update it')
result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=2, text="'+Qt.btoa(messages[i].msg_html)+'", created_at="'+Date.parse(messages[i].date)+'", source="Friendica", status_id="'+messages[i].id+'", uid="'+messages[i].uid+'", statusnet_html="'+Qt.btoa(messages[i].msg_html)+'", statusnet_conversation_id="'+messages[i].parent+'" where username="'+login.username+'" AND status_id="'+messages[i].id+'" AND messagetype=2'); // result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=2, text="'+Qt.btoa(messages[i].msg_html)+'", created_at="'+Date.parse(messages[i].date)+'", source="Friendica", status_id="'+messages[i].id+'", uid="'+messages[i].uid+'", statusnet_html="'+Qt.btoa(messages[i].msg_html)+'", statusnet_conversation_id="'+messages[i].parent+'" where username="'+login.username+'" AND status_id="'+messages[i].id+'" AND messagetype=2');
} else {// use insert // } else {// use insert
result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,source,status_id, uid,statusnet_html,statusnet_conversation_id) VALUES (?,?,?,?,?,?,?,?,?)', [login.username,2,Qt.btoa(messages[i].msg_html),Date.parse(messages[i].date),"Friendica", messages[i].id, messages[i].uid,Qt.btoa(messages[i].msg_html),messages[i].parent])} // result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,source,status_id, uid,statusnet_html,statusnet_conversation_id) VALUES (?,?,?,?,?,?,?,?,?)', [login.username,2,Qt.btoa(messages[i].msg_html),Date.parse(messages[i].date),"Friendica", messages[i].id, messages[i].uid,Qt.btoa(messages[i].msg_html),messages[i].parent])}
}); // });
} // }
db.transaction( function(tx) { // db.transaction( function(tx) {
var newsrs=tx.executeSql('select * from news WHERE username="'+login.username+'" AND messagetype=2 ORDER BY status_id DESC LIMIT 20'); // var newsrs=tx.executeSql('select * from news WHERE username="'+login.username+'" AND messagetype=2 ORDER BY status_id DESC LIMIT 20');
var newsArray=[]; // var newsArray=[];
for(var j = 0; j < newsrs.rows.length; j++) { // for(var j = 0; j < newsrs.rows.length; j++) {
newsArray.push(newsrs.rows.item(j)); // newsArray.push(newsrs.rows.item(j));
callback(newsArray); // newsArray[j].statusnet_html=Qt.atob(newsArray[j].statusnet_html);
} // callback(newsArray);
}) // }
})} // })
//})}
function getActivitiesUserData(database,username,allcontacts,userUrlArray){//print(JSON.stringify(userUrlArray));
function getActivitiesUserData(allcontacts,userUrlArray){//print(JSON.stringify(userUrlArray));
var helpArray=[]; var helpArray=[];
for (var i=0;i<userUrlArray.length;i++){ for (var i=0;i<userUrlArray.length;i++){
helpArray.push(objFromArray(allcontacts,"url",userUrlArray[i])); helpArray.push(objFromArray(allcontacts,"url",userUrlArray[i]));
// Helperjs.readData(database,"contacts",username,function(userdata){
// helpArray.push(userdata[0]);
// },"url",userUrlArray[i]);
} }
return helpArray return helpArray
} }
function newsfromdb(database,username,callback,contact,stop_time){ function newsfromdb(database,user,callback,contact,stop_time){
// return news before stop_time (used by More button), in brackets of 20 entries, or by specified contact // return news before stop_time (used by More button), in brackets of 20 entries, or by specified contact
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
if (!stop_time){var stop=""; if (!stop_time){var stop="";
try{var rs = tx.executeSql('select created_at from news WHERE username="'+username+'" ORDER BY created_at DESC LIMIT 1'); try{var rs = tx.executeSql('select created_at from news WHERE username="'+user+'" ORDER BY created_at DESC LIMIT 1');
stop="<="+rs.rows.item(0).created_at}catch(e){stop="<99999999999999"}} stop="<="+rs.rows.item(0).created_at}catch(e){stop="<99999999999999"}}
else{var stop="<"+stop_time} else{var stop="<"+stop_time}
var contactfilter="";if(contact){contactfilter=" AND (uid='"+contact+"' OR friendica_owner='"+contact+"')"} var contactfilter="";if(contact){contactfilter=" AND (uid='"+contact+"' OR friendica_owner='"+contact+"')"}
//print('select * from news WHERE username="'+username+'" AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20'); //print('select * from news WHERE username="'+username+'" AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20');
var newsrs=tx.executeSql('select * from news WHERE username="'+username+'" AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20'); var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20');
var newsArray=[]; var newsArray=[];
var allcontacts=[]; var allcontacts=getAllContacts(database,user);
Helperjs.readData(database,"contacts",username,function(obj){allcontacts=obj});
for(var i = 0; i < newsrs.rows.length; i++) { for(var i = 0; i < newsrs.rows.length; i++) {
newsArray.push(newsrs.rows.item(i)); newsArray.push(newsrs.rows.item(i));
newsArray[i]=fetchUsersForNews(database,username,newsArray[i],allcontacts) newsArray[i].statusnet_html=Qt.atob(newsArray[i].statusnet_html);
newsArray[i].text=Qt.atob(newsArray[i].text);
newsArray[i].id=newsArray[i].status_id;
newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts);
if (newsArray[i].attachments!==null){newsArray[i].attachments=JSON.parse(Qt.atob(newsArray[i].attachments))};
} }
callback(newsArray)}); callback(newsArray)});
} }
@ -270,33 +284,21 @@ function newsfromdb(database,username,callback,contact,stop_time){
function fetchUsersForNews(database,username,news,allcontacts){//print(JSON.stringify(news)) function fetchUsersForNews(database,username,news,allcontacts){//print(JSON.stringify(news))
news.user=objFromArray(allcontacts,"id",news.uid); news.user=objFromArray(allcontacts,"id",news.uid);
if(news.in_reply_to_user_id){news.reply_user=objFromArray(allcontacts,"id",news.in_reply_to_user_id)} if(news.in_reply_to_user_id){news.reply_user=objFromArray(allcontacts,"id",news.in_reply_to_user_id)}
news.friendica_owner_object=objFromArray(allcontacts,"url",news.friendica_owner); //news.friendica_owner_object=objFromArray(allcontacts,"url",news.friendica_owner);
// Helperjs.readData(database,"contacts",username,function(userdata){ news.friendica_owner=objFromArray(allcontacts,"url",news.friendica_owner);
// news.user=userdata[0]; if (news.messagetype==0){
// //print("Fetch user"+JSON.stringify(news.user)); var friendicaArray=JSON.parse(Qt.atob(news.friendica_activities));
// },"id",news.uid); delete news.friendica_activities;
// if(news.in_reply_to_user_id){ news.friendica_activities={};
// Helperjs.readData(database,"contacts",username,function(replytodata){ //for(var j=0;j<friendicaArray.length;j++){
// news.reply_user=replytodata[0]; news.friendica_activities.like=getActivitiesUserData(allcontacts,friendicaArray[0]);
// //print("Fetch reply to"+JSON.stringify(news.reply_user)); news.friendica_activities.dislike=getActivitiesUserData(allcontacts,friendicaArray[1]);
// },"id",news.in_reply_to_user_id); news.friendica_activities.attendyes=getActivitiesUserData(allcontacts,friendicaArray[2]);
// } news.friendica_activities.attendno=getActivitiesUserData(allcontacts,friendicaArray[3]);
if (news.messagetype==0){ news.friendica_activities.attendmaybe=getActivitiesUserData(allcontacts,friendicaArray[4]);
for(var j=0;j<news.friendica_activities.length;j++) //}
{var friendicaArray=JSON.parse(Qt.atob(news.friendica_activities)); }
// print("Array: "+friendicaArray[1]); return news
news.like=getActivitiesUserData(database,username,allcontacts,friendicaArray[0]);
news.dislike=getActivitiesUserData(database,username,allcontacts,friendicaArray[1]);
news.attendyes=getActivitiesUserData(database,username,allcontacts,friendicaArray[2]);
news.attendno=getActivitiesUserData(database,username,allcontacts,friendicaArray[3]);
news.attendmaybe=getActivitiesUserData(database,username,allcontacts,friendicaArray[4]);
}
// Helperjs.readData(database,"contacts",username,function(friendica_owner_data){
// news.friendica_owner_object=friendica_owner_data[0];
// //print("Fetch friendica_owner"+JSON.stringify(news.friendica_owner));
// },"url",news.friendica_owner);
}
return news
} }
function deleteNews(login,database,newsid,messagetype,rootwindow,callback){ function deleteNews(login,database,newsid,messagetype,rootwindow,callback){
@ -401,11 +403,14 @@ function conversationfromdb(database,user,conversationId,callback){
db.transaction( function(tx) { db.transaction( function(tx) {
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversationId+'" ORDER BY created_at ASC'); var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversationId+'" ORDER BY created_at ASC');
var newsArray=[]; var newsArray=[];
var allcontacts=[]; var allcontacts=getAllContacts(database,user);
Helperjs.readData(database,"contacts",user,function(obj){allcontacts=obj});
for(var i = 0; i < newsrs.rows.length; i++) { for(var i = 0; i < newsrs.rows.length; i++) {
newsArray.push(newsrs.rows.item(i)); newsArray.push(newsrs.rows.item(i));
newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts) newsArray[i].statusnet_html=Qt.atob(newsArray[i].statusnet_html);
newsArray[i].text=Qt.atob(newsArray[i].text);
newsArray[i].id=newsArray[i].status_id;
newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts);
if (newsArray[i].attachments!==null){newsArray[i].attachments=JSON.parse(Qt.atob(newsArray[i].attachments))};
} }
callback(newsArray)}) callback(newsArray)})
} }
@ -419,19 +424,21 @@ function requestFavorites(login,database,contacts,rootwindow,callback){
callback(news,newContacts) callback(news,newContacts)
})} })}
function favoritesfromdb(database,user,callback){ //function favoritesfromdb(database,user,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); // var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { // db.transaction( function(tx) {
//print('select * from news WHERE username="'+user+'" AND favorited=1 ORDER BY status_id DESC'); // //print('select * from news WHERE username="'+user+'" AND favorited=1 ORDER BY status_id DESC');
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND favorited=1 ORDER BY status_id DESC'); // var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND favorited=1 ORDER BY status_id DESC');
var newsArray=[]; // var newsArray=[];
var allcontacts=[]; // var allcontacts=getAllContacts(database,user);
Helperjs.readData(database,"contacts",user,function(obj){allcontacts=obj}); // for(var i = 0; i < newsrs.rows.length; i++) {
for(var i = 0; i < newsrs.rows.length; i++) { // newsArray.push(newsrs.rows.item(i));
newsArray.push(newsrs.rows.item(i)); // newsArray[i].statusnet_html=Qt.atob(newsArray[i].statusnet_html);
newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts); // newsArray[i].id=newsArray[i].status_id;
callback(newsArray); // newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts);
}})} // if (newsArray[i].attachments!==null){newsArray[i].attachments=JSON.parse(Qt.atob(newsArray[i].attachments))};
// callback(newsArray);
// }})}
function chatsfromdb(database,user,callback,stop_time){ function chatsfromdb(database,user,callback,stop_time){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
@ -446,25 +453,91 @@ function chatsfromdb(database,user,callback,stop_time){
conversations.push(conversationsrs.rows.item(i).statusnet_conversation_id); conversations.push(conversationsrs.rows.item(i).statusnet_conversation_id);
} }
var newsArray=[]; var newsArray=[];
var allcontacts=[]; var allcontacts=getAllContacts(database,user);
Helperjs.readData(database,"contacts",user,function(obj){allcontacts=obj});
for(var j = 0; j< conversations.length; j++) { for(var j = 0; j< conversations.length; j++) {
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversations[j] +'" ORDER BY created_at ASC'); var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversations[j] +'" ORDER BY created_at ASC');
var helpernews=newsrs.rows.item(0); var helpernews=newsrs.rows.item(0);
helpernews.newscount=newsrs.rows.length; helpernews.newscount=newsrs.rows.length;
helpernews=fetchUsersForNews(database,user,helpernews,allcontacts); helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
//var chatArray=[]; helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
// for (var k=0;k<newsrs.rows.length;k++){ helpernews.text=Qt.atob(helpernews.text);
// var helperchat=newsrs.rows.item(k); helpernews.id=helpernews.status_id;
// helperchat=fetchUsersForNews(database,user,helperchat); if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
// chatArray.push(helperchat)
//}
//helpernews.chatArray=chatArray;
newsArray.push(helpernews); newsArray.push(helpernews);
} }
callback(newsArray); callback(newsArray);
})} })}
function allchatsfromdb(database,user,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
// if (!stop_time){var stop="";
// try{var rs = tx.executeSql('select created_at from news WHERE username="'+username+'" ORDER BY created_at DESC LIMIT 1');
// stop="<="+rs.rows.item(0).created_at}catch(e){stop="<99999999999999"}}
// else{var stop="<"+stop_time}
var conversationsrs=tx.executeSql('select DISTINCT statusnet_conversation_id from news WHERE username="'+user+'" ORDER BY created_at DESC'); //+' ORDER BY created_at DESC LIMIT 20');
var conversationIds=[];
for(var i = 0; i < conversationsrs.rows.length; i++) {
conversationIds.push(conversationsrs.rows.item(i).statusnet_conversation_id);
}
var newsArray=[];
var countArray=[];
var allcontacts=getAllContacts(database,user);
for(var j = 0; j< conversationIds.length; j++) {
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversationIds[j] +'" ORDER BY created_at ASC');
var helpernews=newsrs.rows.item(0);
//helpernews.newscount=newsrs.rows.length;
helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
helpernews.text=Qt.atob(helpernews.text);
helpernews.id=helpernews.status_id;
if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
newsArray.push(helpernews);
countArray.push(newsrs.rows.length)
}
var conversationsobject=({});
conversationsobject.conversationIds=conversationIds;
conversationsobject.newsArray=newsArray;
conversationsobject.countArray=countArray;
callback(conversationsobject);
})}
function oldchatfromdb(database,user,conversationId,lastpost,allcontacts,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
// var newsArray=[];
// var countArray=[];
//var allcontacts=getAllContacts(database,user);
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversationId +'" AND status_id<'+lastpost+' ORDER BY created_at ASC');
if(newsrs.rows.length>0){var helpernews=newsrs.rows.item(0);
var newscount=newsrs.rows.length;
helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
helpernews.text=Qt.atob(helpernews.text);
helpernews.id=helpernews.status_id;
if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
callback(helpernews,newscount);}
// var conversationobject={news:helpernews,newscount:newscount};
// return conversationobject;
})}
function getAllContacts(database,user){
var allcontacts=[];
Helperjs.readData(database,"contacts",user,function(obj){
allcontacts=obj;
for (var n in allcontacts){
allcontacts[n].name=Qt.atob(allcontacts[n].name);
allcontacts[n].description=Qt.atob(allcontacts[n].description)
}
});
return allcontacts;
}
function inArray(list, prop, val) { function inArray(list, prop, val) {
if (list.length > 0 ) { if (list.length > 0 ) {
for (var i in list) {if (list[i][prop] == val) { for (var i in list) {if (list[i][prop] == val) {

View File

@ -41,49 +41,50 @@ else{
if (msg.news[j]) { if (msg.news[j]) {
var newsitemobject=msg.news[j]; var newsitemobject=msg.news[j];
//print("Newsitem"+JSON.stringify(newsitemobject.friendica_owner+" userid: "+newsitemobject.user.id)); //print("Newsitem"+JSON.stringify(newsitemobject.friendica_owner+" userid: "+newsitemobject.user.id));
if (newsitemobject.messagetype==2){ // if (newsitemobject.messagetype==2){
newsitemobject.user={}; // newsitemobject.user={};
newsitemobject.user.profile_image=""; // newsitemobject.user.profile_image="";
newsitemobject.user.profile_image_url=""; // newsitemobject.user.profile_image_url="";
newsitemobject.user.name=""; // newsitemobject.user.name="";
} // }
var forumname="";try{if (newsitemobject.messagetype==0&&((newsitemobject.friendica_owner)!=(newsitemobject.user.url))){ var forumname="";try{if (newsitemobject.messagetype==0&&newsitemobject.hasOwnProperty('friendica_owner')&&((newsitemobject.friendica_owner.url)!=(newsitemobject.user.url))){
//print(newsitemobject.friendica_owner+" Friendica Owner "+JSON.stringify(newsitemobject)); //print(newsitemobject.friendica_owner+" Friendica Owner "+JSON.stringify(newsitemobject));
forumname=" via "+Qt.atob(newsitemobject.friendica_owner_object.name) forumname=" via "+newsitemobject.friendica_owner.name
}}catch(e){print("forum name "+e)} }}catch(e){print("forum name "+e)}
var likeText="";var dislikeText="";var attendyesText="";var attendnoText="";var attendmaybeText=""; var self={}; var likeText="";var dislikeText="";var attendyesText="";var attendnoText="";var attendmaybeText=""; var self={};
try{if (newsitemobject.messagetype==0){ try{if (newsitemobject.messagetype==0&&newsitemobject.hasOwnProperty('friendica_activities')){
if (newsitemobject.like.length>0){ if (newsitemobject.friendica_activities.like.length>0){
if (newsitemobject.like.length==1){likeText= Qt.atob(newsitemobject.like[0].name)+" "+ qsTr("likes this.")} if (newsitemobject.friendica_activities.like.length==1){likeText= newsitemobject.friendica_activities.like[0].name+" "+ qsTr("likes this.")}
else {likeText= newsitemobject.like.length+" "+ qsTr("like this.")} else {likeText= newsitemobject.friendica_activities.like.length+" "+ qsTr("like this.")}
} }
if (newsitemobject.dislike.length>0){ if (newsitemobject.friendica_activities.dislike.length>0){
if (newsitemobject.dislike.length==1){dislikeText= Qt.atob(newsitemobject.dislike[0].name)+" "+ qsTr("doesn't like this.")} if (newsitemobject.friendica_activities.dislike.length==1){dislikeText= newsitemobject.friendica_activities.dislike[0].name+" "+ qsTr("doesn't like this.")}
else {dislikeText= newsitemobject.dislike.length+" "+ qsTr("don't like this.")} else {dislikeText= newsitemobject.friendica_activities.dislike.length+" "+ qsTr("don't like this.")}
} }
if (newsitemobject.attendyes.length>0){ if (newsitemobject.friendica_activities.attendyes.length>0){
if (newsitemobject.attendyes.length==1){attendyesText= Qt.atob(newsitemobject.attendyes[0].name)+" "+ qsTr("will attend.")} if (newsitemobject.friendica_activities.attendyes.length==1){attendyesText=newsitemobject.friendica_activities.attendyes[0].name+" "+ qsTr("will attend.")}
else {attendyesText= newsitemobject.attendyes.length+" "+ qsTr("persons will attend.")} else {attendyesText= newsitemobject.friendica_activities.attendyes.length+" "+ qsTr("persons will attend.")}
} }
if (newsitemobject.attendno.length>0){ if (newsitemobject.friendica_activities.attendno.length>0){
if (newsitemobject.attendno.length==1){attendnoText= Qt.atob(newsitemobject.attendno[0].name)+" "+ qsTr("will not attend.")} if (newsitemobject.friendica_activities.attendno.length==1){attendnoText= newsitemobject.friendica_activities.attendno[0].name+" "+ qsTr("will not attend.")}
else {attendnoText= newsitemobject.attendno.length+" "+ qsTr("persons will not attend.")} else {attendnoText= newsitemobject.friendica_activities.attendno.length+" "+ qsTr("persons will not attend.")}
} }
if (newsitemobject.attendmaybe.length>0){ if (newsitemobject.friendica_activities.attendmaybe.length>0){
if (newsitemobject.attendmaybe.length==1){attendmaybeText= Qt.atob(newsitemobject.attendmaybe[0].name)+" "+ qsTr("may attend.")} if (newsitemobject.friendica_activities.attendmaybe.length==1){attendmaybeText= newsitemobject.friendica_activities.attendmaybe[0].name+" "+ qsTr("may attend.")}
else {attendmaybeText= newsitemobject.attendmaybe.length+" "+ qsTr("persons may attend.")} else {attendmaybeText= newsitemobject.friendica_activities.attendmaybe.length+" "+ qsTr("persons may attend.")}
} }
//var friendica_activities_self=JSON.parse(newsitemobject.friendica_activities_self); //var friendica_activities_self=JSON.parse(newsitemobject.friendica_activities_self);
if (newsitemobject.hasOwnProperty("friendica_activities_self")){
if (newsitemobject.friendica_activities_self.indexOf(3)!=-1){self.attending=qsTr("yes")} if (newsitemobject.friendica_activities_self.indexOf(3)!=-1){self.attending=qsTr("yes")}
if (newsitemobject.friendica_activities_self.indexOf(4)!=-1){self.attending=qsTr("no")} if (newsitemobject.friendica_activities_self.indexOf(4)!=-1){self.attending=qsTr("no")}
if (newsitemobject.friendica_activities_self.indexOf(5)!=-1){self.attending=qsTr("maybe")} if (newsitemobject.friendica_activities_self.indexOf(5)!=-1){self.attending=qsTr("maybe")}
if (newsitemobject.friendica_activities_self.indexOf(1)!=-1){self.liked=1} if (newsitemobject.friendica_activities_self.indexOf(1)!=-1){self.liked=1}
if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1} if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
}} catch(e){print("Activities "+e)} }}} 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 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=JSON.parse(Qt.atob(newsitemobject.attachments)); var attachArray=newsitemobject.attachments;
for (var image in attachArray){if(attachArray[image].mimetype=="image/gif"){ for (var image in attachArray){if(attachArray[image].mimetype=="image/gif"){
attachmentList.push(attachArray[image]) attachmentList.push(attachArray[image])
} }

View File

@ -1,5 +1,4 @@
// This file is part of Friendiqa // This file is part of Friendiqa // https://github.com/lubuwest/Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net> // Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
@ -314,7 +313,7 @@ function cleanNews(database,callback){
var maxnewsrs = tx.executeSql("SELECT DISTINCT maxnews FROM config"); var maxnewsrs = tx.executeSql("SELECT DISTINCT maxnews FROM config");
var maxnews=maxnewsrs.rows.item(0).maxnews; var maxnews=maxnewsrs.rows.item(0).maxnews;
var newscountrs = tx.executeSql('SELECT COUNT(*) from news'); var newscountrs = tx.executeSql('SELECT COUNT(*) from news');
var newscount = newscountrs.rows.item(0)["COUNT(*)"]; var newscount = newscountrs.rows.item(0)["COUNT(*)"];//print("newscount "+newscount)
if (newscount>maxnews){ if (newscount>maxnews){
var lastvalidtimers= tx.executeSql('SELECT DISTINCT created_at FROM news ORDER BY created_at ASC LIMIT ' +(newscount-maxnews)); var lastvalidtimers= tx.executeSql('SELECT DISTINCT created_at FROM news ORDER BY created_at ASC LIMIT ' +(newscount-maxnews));
var lastvalidtime=lastvalidtimers.rows.item(newscount-maxnews-1).created_at; var lastvalidtime=lastvalidtimers.rows.item(newscount-maxnews-1).created_at;
@ -330,6 +329,7 @@ function cleanContacts(login,database,callback){
if (oldestnewsrs.rows.length>0){ var oldestnewsTime=oldestnewsrs.rows.item(0).created_at- 604800000;} else{var oldestnewsTime=0} //contacts can be 7 days old if (oldestnewsrs.rows.length>0){ var oldestnewsTime=oldestnewsrs.rows.item(0).created_at- 604800000;} else{var oldestnewsTime=0} //contacts can be 7 days old
//print(login.username+" älteste news: "+ oldestnewsTime); //print(login.username+" älteste news: "+ oldestnewsTime);
var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge<'+oldestnewsTime); // check for friends var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge<'+oldestnewsTime); // check for friends
//print ("Contact result length: "+ result.rows.length)
for (var i=0;i<result.rows.length;i++){ for (var i=0;i<result.rows.length;i++){
filesystem.rmFile(result.rows.item(i).profile_image); filesystem.rmFile(result.rows.item(i).profile_image);
var deleters = tx.executeSql('DELETE from contacts WHERE username="'+login.username+'" AND url="'+result.rows.item(i).url+'"'); var deleters = tx.executeSql('DELETE from contacts WHERE username="'+login.username+'" AND url="'+result.rows.item(i).url+'"');
@ -338,50 +338,6 @@ function cleanContacts(login,database,callback){
}) })
} }
function processNews(callback){
if (contactLoadType=="news"){
if(root.news.length==0){}
else{// show news
Newsjs.storeNews(login,db,news,root,function(dbnews){
if(login.newsViewType=="Timeline"){
Newsjs.newsfromdb(db,login.username,function(dbnews){
root.newsSignal(dbnews);
newstab.newstabstatus=login.newsViewType})
}
else{
Newsjs.chatsfromdb(db,login.username,function(dbnews){
root.newsSignal(dbnews);
newstab.newstabstatus=login.newsViewType})
}
})
}
}
else if (contactLoadType=="friends"){// show friends
root.friendsSignal(login.username);
Newsjs.getCurrentContacts(login,db,function(contacts){
contactlist=contacts;
})}
else if (contactLoadType=="conversation"){
var conversationid=news[0].statusnet_conversation_id
if (!isNaN(parseInt(conversationid))){//no directmessage conversation
Newsjs.storeNews(root.login,root.db,news,root,function(){
Newsjs.conversationfromdb(db,root.login.username,conversationid, function(newsarray){
newstab.conversation=newsarray;
})
})}
else {newstab.conversation=news}//only DM conversations from database
}
else if (contactLoadType=="favorites"){//show favorited news
Newsjs.storeNews(root.login,root.db,news,root,function(){
Newsjs.favoritesfromdb(db,login.username,function(newsarray){
root.newsSignal(newsarray);
newstab.newstabstatus="Favorites";
})
})}
callback()
}
function updateContactInDB(login,database,isFriend,contact){// for newstab and friendstab function updateContactInDB(login,database,isFriend,contact){// for newstab and friendstab
var currentTime=Date.now(); var currentTime=Date.now();
var image_timestamp=0; var image_timestamp=0;
@ -393,8 +349,218 @@ function updateContactInDB(login,database,isFriend,contact){// for newstab and f
var result; var result;
result = tx.executeSql('SELECT * from contacts where username="'+login.username+'" AND url = "'+contact.url+'"'); // check for news url result = tx.executeSql('SELECT * from contacts where username="'+login.username+'" AND url = "'+contact.url+'"'); // check for news url
if(result.rows.length === 1) {// use update if(result.rows.length === 1) {// use update
result = tx.executeSql('UPDATE contacts SET id='+contact.id+', name="'+Qt.btoa(contact.name)+'", screen_name="'+contact.screen_name+'", location="'+contact.location+'",imageAge='+currentTime+', profile_image_url="'+contact.profile_image_url+'", description="'+Qt.btoa(contact.description)+'", protected="'+contact.protected+'", followers_count='+contact.followers_count+', friends_count='+contact.friends_count+', created_at="'+ Date.parse(Newsjs.cleanDate(contact.created_at))+'", favourites_count="'+contact.favorites_count+'", utc_offset="'+contact.utc_offset+'", time_zone="'+contact.time_zone+'", statuses_count='+contact.statuses_count+', following="'+contact.following+'", verified ="'+contact.verified+'", statusnet_blocking="'+contact.statusnet_blocking+'", notifications="'+contact.notifictions+'", statusnet_profile_url="'+contact.statusnet_profile_url+'", cid='+contact.cid+', network="'+contact.network+'", isFriend='+isFriend+', timestamp='+ currentTime+' where username="'+login.username+'" AND url="'+contact.url+'"'); result = tx.executeSql('UPDATE contacts SET id='+contact.id+', name="'+Qt.btoa(contact.name)+'", screen_name="'+contact.screen_name+'", location="'+contact.location+'",imageAge='+currentTime+', profile_image_url="'+contact.profile_image_url+'", description="'+Qt.btoa(contact.description)+'", protected="'+contact.protected+'", followers_count='+contact.followers_count+', friends_count='+contact.friends_count+', created_at="'+ contact.created_at+'", favourites_count="'+contact.favorites_count+'", utc_offset="'+contact.utc_offset+'", time_zone="'+contact.time_zone+'", statuses_count='+contact.statuses_count+', following="'+contact.following+'", verified ="'+contact.verified+'", statusnet_blocking="'+contact.statusnet_blocking+'", notifications="'+contact.notifictions+'", statusnet_profile_url="'+contact.statusnet_profile_url+'", cid='+contact.cid+', network="'+contact.network+'", isFriend='+isFriend+', timestamp='+ currentTime+' where username="'+login.username+'" AND url="'+contact.url+'"');
} else {// use insert } else {// use insert
result = tx.executeSql('INSERT INTO contacts VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,contact.id,Qt.btoa(contact.name),contact.screen_name,contact.location,currentTime,contact.profile_image_url, Qt.btoa(contact.description),"",contact.url,contact.protected,contact.followers_count, contact.friends_count,Date.parse(Newsjs.cleanDate(contact.created_at)),contact.favorites_count,contact.utc_offset,contact.time_zone,contact.statuses_count,contact.following,contact.verfied,contact.statusnet_blocking,contact.notifications,contact.statusnet_profile_url,contact.cid,contact.network,isFriend,image_timestamp]);} result = tx.executeSql('INSERT INTO contacts VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,contact.id,Qt.btoa(contact.name),contact.screen_name,contact.location,currentTime,contact.profile_image_url, Qt.btoa(contact.description),"",contact.url,contact.protected,contact.followers_count, contact.friends_count,contact.created_at,contact.favorites_count,contact.utc_offset,contact.time_zone,contact.statuses_count,contact.following,contact.verfied,contact.statusnet_blocking,contact.notifications,contact.statusnet_profile_url,contact.cid,contact.network,isFriend,image_timestamp]);}
}); });
} }
function processNews(api,data){
try{var newslist=JSON.parse(data);
} catch(e){
Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)};
if (typeof(newslist)=='undefined'){
Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
}
else if (newslist.hasOwnProperty('status')){
Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
} else if (!(Array.isArray(newslist))){
replytimer.restart()
} else {
var allcontacts=[];
allcontacts=Newsjs.getAllContacts(db,login.username);
if (api=="/api/direct_messages/all"){
for (var n in newslist){
newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at));
newslist[n].messagetype=1;
newslist[n].source=" Friendica";
newslist[n].status_id=newslist[n].id;
newslist[n].uid=newslist[n].sender.id;
newslist[n].statusnet_conversation_id=newslist[n].friendica_parent_uri;
newslist[n].user=cleanUser(newslist[n].sender);
newslist[n].statusnet_html=newslist[n].text;
}}
else if (api=="/api/friendica/notifications"){
for (var n in newslist){
newslist[n].created_at=Date.parse(newslist[n].date);
newslist[n].messagetype=2;
newslist[n].user=Newsjs.objFromArray(allcontacts,"url",newslist[n].url)
if (newslist[n].user==false){
newslist[n].user={"profile_image_url": newslist[n].photo,"name": newslist[n].name," url":newslist[n].url, "created_at":newslist[n].date};
newslist[n].user=cleanUser(newslist[n].user);
}
newslist[n].statusnet_html=newslist[n].msg_html;
}
} else {
var chatlist=[];
var conversationIds=[];
var commentCount=[];
for (var n in newslist){
newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at));
newslist[n].messagetype=0;
newslist[n].user=cleanUser(newslist[n].user)
if(newslist[n].in_reply_to_user_id){newslist[n].reply_user=Newsjs.objFromArray(allcontacts,"id",newslist[n].in_reply_to_user_id)}
//print (JSON.stringify(newslist[n].user))
if(newslist[n].hasOwnProperty('friendica_activities')){
for (var m in newslist[n].friendica_activities.like){
newslist[n].friendica_activities.like[m]=cleanUser(newslist[n].friendica_activities.like[m]);
}
for (var o in newslist[n].friendica_activities.dislike){
newslist[n].friendica_activities.dislike[o]=cleanUser(newslist[n].friendica_activities.dislike[o]);
}
for (var p in newslist[n].friendica_activities.attendyes){
newslist[n].friendica_activities.attendyes[p]=cleanUser(newslist[n].friendica_activities.attendyes[p]);
}
for (var q in newslist[n].friendica_activities.attendno){
newslist[n].friendica_activities.attendno[q]=cleanUser(newslist[n].friendica_activities.attendno[q]);
}
for (var r in newslist[n].friendica_activities.attendmaybe){
newslist[n].friendica_activities.attendmaybe[r]=cleanUser(newslist[n].friendica_activities.attendmaybe[r]);
}
}
if(!(newslist[n].hasOwnProperty('friendica_owner'))){
newslist[n].friendica_owner=newslist[n].user
}
var conversationindex=conversationIds.indexOf(newslist[n].statusnet_conversation_id);
//fill chatlist
if (conversationindex==-1){
chatlist.push(newslist[n]);
conversationIds.push(newslist[n].statusnet_conversation_id);
commentCount.push(1);
} else{
commentCount[conversationindex]=commentCount[conversationindex]+1;
chatlist[conversationindex]=newslist[n];
}
}
//enrich chatlist with old entries
for (var count in chatlist){ //print("chat "+JSON.stringify(chatlist[count])+" count: "+commentCount[count])
//chatlist[count].newscount=commentCount[count]
if (chatlist[count].id_str!==chatlist[count].statusnet_conversation_id){
try{
Newsjs.oldchatfromdb(db,login.username,chatlist[count].statusnet_conversation_id,chatlist[count].id,allcontacts,function(oldpost,oldcount){
chatlist[count]=oldpost;
chatlist[count].newscount=oldcount+commentCount[count];
//print("JSON "+chatlist[count].statusnet_conversation_id+" "+chatlist[count].id+JSON.stringify(oldpost))
})
}catch(e){print(e)}
}
else{chatlist[count].newscount=commentCount[count]}
}
}
if (api=="/api/conversation/show"){
newslist.reverse();
newstab.conversation=newslist
}
else if (newstab.newstabstatus==="Conversations"){
showNews(chatlist);root.news=newslist}
else {showNews(newslist);root.news=newslist};
var newstabarray=["Conversations","Favorites","Timeline","DirectMessage"];
if (newstabarray.indexOf(newstab.newstabstatus)>-1){contacttimer.start()}
}
}
function cleanUser(user){
user.created_at=Date.parse(Newsjs.cleanDate(user.created_at));
var imagehelper1=user.profile_image_url.split("?");
var imagehelper2=imagehelper1[0].substring(imagehelper1[0].lastIndexOf("/")+1,imagehelper1[0].length);
var imagehelper3=login.imagestore+"contacts/"+user.screen_name+"-"+imagehelper2
if(filesystem.fileexist(imagehelper3)){user.profile_image=imagehelper3}else {user.profile_image=""}
return user
}
function updateView(viewtype){
newsBusy.running=true;
//downloadNotice.text="xhr start "+Date.now()
switch(viewtype){
case "Conversations":
var lastnews=Newsjs.getLastNews(login,db);
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/friends_timeline");
xhr.clearParams();
xhr.setParam("since_id",lastnews);
xhr.setParam("count",50)
break;
case "Timeline":
var lastnews=Newsjs.getLastNews(login,db);
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/friends_timeline");
xhr.clearParams();
xhr.setParam("since_id",lastnews);
xhr.setParam("count",50)
break;
case "Search":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/search");
break;
case "Notifications":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/friendica/notifications");
xhr.clearParams();
break;
case "Direct Messages":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/all");
xhr.clearParams();
break;
case "Public Timeline":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/public_timeline");
xhr.clearParams();
break;
case "Favorites":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/favorites");
xhr.clearParams();
break;
default:
var lastnews=Newsjs.getLastNews(login,db);
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/friends_timeline");
xhr.clearParams();
xhr.setParam("since_id",lastnews);
xhr.setParam("count",50)
newstab.newstabstatus="Conversations";
}
xhr.get();
if (viewtype==="Conversations"){Newsjs.allchatsfromdb(db,login.username,function(temp){
newsStack.allchats=temp
})}
}
function showGroups(){
Helperjs.readData(db,"groups",login.username,function(groups){
var groupitems="";
for (var i=0;i<groups.length;i++){
groupitems=groupitems+"MenuItem{text:'"+groups[i].groupname+"'; onTriggered: Service.getGroupnews("+groups[i].gid+")}"
}
var menuString="import QtQuick.Controls 1.4; import 'qrc:/js/service.js' as Service; Menu {"+groupitems+"}";
var grouplistObject=Qt.createQmlObject(menuString,newsStack,"groupmenuOutput");
grouplistObject.popup()
})
}
function getGroupnews(list){
newstab.newstabstatus="Group news";
newsBusy.running=true;
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/lists/statuses");
xhr.clearParams();
xhr.setParam("list_id",list)
xhr.get();
}

View File

@ -43,7 +43,7 @@ Rectangle{
textFormat: Text.RichText textFormat: Text.RichText
width: parent.width width: parent.width
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: "<b>Friendiqa v0.2 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+ text: "<b>Friendiqa v0.3 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
"Profile <a href='https://freunde.ma-nic.de/profile/friendiqa'>https://freunde.ma-nic.de/profile/friendiqa</a><br>"+ "Profile <a href='https://freunde.ma-nic.de/profile/friendiqa'>https://freunde.ma-nic.de/profile/friendiqa</a><br>"+
"Sourcecode: <a href='https://github.com/LubuWest/Friendiqa'>https://github.com/LubuWest/Friendiqa</a><br>"+ "Sourcecode: <a href='https://github.com/LubuWest/Friendiqa'>https://github.com/LubuWest/Friendiqa</a><br>"+
"C++ code by <a href='https://kirgroup.com/profile/fabrixxm'>Fabio</a><br>"+ "C++ code by <a href='https://kirgroup.com/profile/fabrixxm'>Fabio</a><br>"+

View File

@ -37,7 +37,7 @@ Item {
id: contactLargeComponent id: contactLargeComponent
x:mm x:mm
y:mm y:mm
property var contact:{} property var contact:({})
property var createdAtDate: new Date(contact.created_at) property var createdAtDate: new Date(contact.created_at)
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>") property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
@ -63,7 +63,7 @@ Rectangle {
x: mm x: mm
width: root.width-6*mm //friendsTabView.width-4*mm width: root.width-6*mm //friendsTabView.width-4*mm
height: 3*mm height: 3*mm
text:Qt.atob(contact.name)+" (@"+contact.screen_name+")" text:contact.name+" (@"+contact.screen_name+")"
elide:Text.ElideRight elide:Text.ElideRight
anchors.topMargin: 0 anchors.topMargin: 0
anchors.left: photoImage.left anchors.left: photoImage.left
@ -91,7 +91,7 @@ Rectangle{
font.pixelSize: 3*mm font.pixelSize: 3*mm
textFormat:Text.RichText textFormat:Text.RichText
wrapMode: Text.Wrap wrapMode: Text.Wrap
text:"<b>"+qsTr("Description")+": </b> "+Qt.atob(contact.description)+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+ text:"<b>"+qsTr("Description")+": </b> "+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>"+ "<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+
connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale()) connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
onLinkActivated: { onLinkActivated: {
@ -123,7 +123,7 @@ Rectangle{
text: "\uf0e6" //"Messages" text: "\uf0e6" //"Messages"
onClicked:{ onClicked:{
root.currentIndex=0; root.currentIndex=0;
newstab.active=true; //newstab.active=true;
root.messageSignal(contact) ; root.messageSignal(contact) ;
contactLargeComponent.destroy(); contactLargeComponent.destroy();
} }
@ -135,7 +135,7 @@ Rectangle{
text: "\uf040" //"DM" text: "\uf040" //"DM"
onClicked:{ onClicked:{
root.currentIndex=0; root.currentIndex=0;
newstab.active=true; //newstab.active=true;
root.directmessageSignal(contact.screen_name); root.directmessageSignal(contact.screen_name);
contactLargeComponent.destroy(); contactLargeComponent.destroy();
} }

View File

@ -126,6 +126,8 @@ Rectangle {
try {friendsModel.clear()} catch(e){print(e)}; try {friendsModel.clear()} catch(e){print(e)};
Helperjs.readData(root.db,"contacts",login.username,function(friendsobject){ Helperjs.readData(root.db,"contacts",login.username,function(friendsobject){
for (var i=0;i<friendsobject.length;i++){ for (var i=0;i<friendsobject.length;i++){
friendsobject[i].description=Qt.atob(friendsobject[i].description);
friendsobject[i].name=Qt.atob(friendsobject[i].name);
if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){ if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){
friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
} }
@ -205,6 +207,8 @@ Rectangle {
try {contactsModel.clear()} catch(e){print(e)}; try {contactsModel.clear()} catch(e){print(e)};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){ Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){ for (var j=0;j<contactsobject.length;j++){
contactsobject[j].description=Qt.atob(contactsobject[j].description);
contactsobject[j].name=Qt.atob(contactsobject[j].name);
contactsModel.append({"contact":contactsobject[j]}); contactsModel.append({"contact":contactsobject[j]});
} }
},"isFriend",0,"screen_name ASC"); },"isFriend",0,"screen_name ASC");
@ -220,6 +224,8 @@ Rectangle {
try {contactsModel.clear()} catch(e){print(e)}; try {contactsModel.clear()} catch(e){print(e)};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){ Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){ for (var j=0;j<contactsobject.length;j++){
contactsobject[j].description=Qt.atob(contactsobject[j].description);
contactsobject[j].name=Qt.atob(contactsobject[j].name);
contactsModel.append({"contact":contactsobject[j]}); contactsModel.append({"contact":contactsobject[j]});
} }
},"isFriend",0,"screen_name ASC"); },"isFriend",0,"screen_name ASC");

View File

@ -42,7 +42,7 @@ import "qrc:/qml/genericqml"
TabView{ TabView{
id:root id:root
property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsAndroid.qml");return tmp.createObject(root)} property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsAndroid.qml");return tmp.createObject(root)}
IntentReceiver{} //IntentReceiver{}
tabPosition: Qt.BottomEdge tabPosition: Qt.BottomEdge
width: osSettings.appWidth width: osSettings.appWidth
height:osSettings.appHeight height:osSettings.appHeight
@ -88,16 +88,16 @@ TabView{
xhr.setContactlist(contactnames); xhr.setContactlist(contactnames);
xhr.setImagedir(login.imagestore); xhr.setImagedir(login.imagestore);
xhr.getlist(); xhr.getlist();
Service.processNews(function(){ // Service.processNews(function(){
root.contactLoadType=""; // root.contactLoadType="";
root.news=[]; // root.news=[];
}) // })
} }
else if (contactLoadType!=""){ // else if (contactLoadType!=""){
Service.processNews(function(){ // Service.processNews(function(){
root.contactLoadType=""; // root.contactLoadType="";
root.news=[]; // root.news=[];
})} // })}
} }
Connections{ Connections{
@ -146,7 +146,7 @@ TabView{
frameOverlap: 1 frameOverlap: 1
tab: Rectangle { tab: Rectangle {
color: styleData.selected?"sky blue":"light blue" color: styleData.selected?"sky blue":"light blue"
border.color: "light grey" //border.color: "light grey"
implicitWidth: root.width/5 implicitWidth: root.width/5
implicitHeight: 5*mm implicitHeight: 5*mm
Text { id: text Text { id: text
@ -192,11 +192,9 @@ TabView{
id: configtab id: configtab
source: (root.currentIndex==4)?"qrc:/qml/configqml/ConfigTab.qml":"" source: (root.currentIndex==4)?"qrc:/qml/configqml/ConfigTab.qml":""
} }
// Component.onCompleted: { Component.onCompleted: {
// var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+ if(osSettings.imagePickQml=="ImagePicker"){var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
// osSettings.imagePickQml+'{multiple : true; onReady: {'+ var IntentReceiverQml = component.createObject(root)
// 'if(imageUrls.length==1){root.currentIndex=0;newstab.active=true;root.uploadSignal(imageUrls)} else{'+ }
// ' root.currentIndex=2;fotostab.active=true;'+ }
// 'root.uploadSignal(imageUrls)};}}',root,"imagePicker");
// }
} }

View File

@ -34,10 +34,10 @@ Rectangle{
id: blueButton id: blueButton
width: Math.max(mainText.width+2*mm,8*mm) width: Math.max(mainText.width+2*mm,8*mm)
height: 5*mm height: 5*mm
color:"light blue" color:"light blue"//"#EFEAEA" "sky blue"
property alias fontColor: mainText.color property alias fontColor: mainText.color
border.color:"grey" // border.color:"grey"
border.width:1 // border.width:1
radius: mm radius: mm
property alias text: mainText.text property alias text: mainText.text
signal clicked signal clicked

View File

@ -0,0 +1,83 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In addition, as a special exception, the copyright holders give
// permission to link the code of portions of this program with the
// OpenSSL library under certain conditions as described in each
// individual source file, and distribute linked combinations including
// the two.
//
// You must obey the GNU General Public License in all respects for all
// of the code used other than OpenSSL. If you modify file(s) with this
// exception, you may extend this exception to your version of the
// file(s), but you are not obligated to do so. If you do not wish to do
// so, delete this exception statement from your version. If you delete
// this exception statement from all source files in the program, then
// also delete it here.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// 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.7
import QtQuick.Controls 1.2
import "qrc:/qml/genericqml"
import "qrc:/js/news.js" as Newsjs
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/service.js" as Service
Item {
id:searchComponent
onVisibleChanged: if (visible) searchText.forceActiveFocus()
// border.color: "#EEEEEE"
// border.width: 1
// color:"lightgrey"
// width:conversationView.width
// height:Math.max(replyText.contentHeight+2*mm,6*mm)
Rectangle{
color: "white"
radius:0.5*mm
anchors.left: parent.left
anchors.leftMargin:mm
anchors.top:parent.top
anchors.topMargin: 0.5*mm
width:parent.width-2*mm
height:Math.max( searchText.contentHeight,5*mm)
TextInput {
id: searchText
font.pixelSize: 3*mm
wrapMode: Text.Wrap
anchors.fill: parent
selectByMouse: true
cursorVisible: false
onEditingFinished: search(displayText)
//onHeightChanged: newsView.contentY+=4.5*mm
}
// BlueButton {
// id: sendButton
// text: "\uf002"
// anchors.left: parent.right
// anchors.leftMargin:mm
// anchors.top:parent.top
// //anchors.topMargin: 0.5*mm
// color:"white"
// onClicked: {
// var body=searchText.getText(0,searchText.length);
// search(body)
// }
// }
}
}

View File

@ -126,14 +126,19 @@ Rectangle {
xhr.clearParams(); xhr.clearParams();
xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
if (conversationModel.get(0).newsitemobject.messagetype==0){ if (conversationModel.get(0).newsitemobject.messagetype==0){
//xhr.url= login.server + "/api/statuses/update.json";
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/update");
xhr.setParam("source", "Friendiqa"); xhr.setParam("source", "Friendiqa");
xhr.url= login.server + "/api/statuses/update.json";
xhr.setParam("status", body); xhr.setParam("status", body);
xhr.setParam("in_reply_to_status_id", conversationModel.get(conversationModel.count-1).newsitemobject.status_id)} xhr.setParam("in_reply_to_status_id", conversationModel.get(conversationModel.count-1).newsitemobject.id)}
else {xhr.url= login.server + "/api/direct_messages/new.json"; else {//xhr.url= login.server + "/api/direct_messages/new.json";
xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/new");
xhr.setParam("text", body); xhr.setParam("text", body);
xhr.setParam("screen_name",conversationModel.get(conversationModel.count-1).newsitemobject.screen_name); xhr.setParam("screen_name",conversationModel.get(conversationModel.count-1).newsitemobject.screen_name);
xhr.setParam("replyto", conversationModel.get(conversationModel.count-1).newsitemobject.status_id) xhr.setParam("replyto", conversationModel.get(conversationModel.count-1).newsitemobject.id)
} }
xhr.post(); xhr.post();
} catch(e){Helperjs.showMessage("Error",e.toString(),root)} } catch(e){Helperjs.showMessage("Error",e.toString(),root)}

View File

@ -77,7 +77,7 @@ Rectangle {
font.pixelSize: 3*mm font.pixelSize: 3*mm
anchors.left: contactImage.right anchors.left: contactImage.right
anchors.margins: 1*mm anchors.margins: 1*mm
text:Qt.atob(contact.name) text:contact.name
} }
MouseArea{ MouseArea{

View File

@ -0,0 +1,51 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In addition, as a special exception, the copyright holders give
// permission to link the code of portions of this program with the
// OpenSSL library under certain conditions as described in each
// individual source file, and distribute linked combinations including
// the two.
//
// You must obey the GNU General Public License in all respects for all
// of the code used other than OpenSSL. If you modify file(s) with this
// exception, you may extend this exception to your version of the
// file(s), but you are not obligated to do so. If you do not wish to do
// so, delete this exception statement from your version. If you delete
// this exception statement from all source files in the program, then
// also delete it here.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// 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.0
Rectangle {
id:hasgtagRectangle
color: "light grey"
property alias text: hashtagText.text
radius:0.3*mm
width:hashtagText.contentWidth+mm
height:2.5* mm
Text{
id:hashtagText
font.pixelSize: 1.5*mm
anchors.centerIn: parent
anchors.margins: 0.5*mm
}
MouseArea{
anchors.fill: parent
onClicked:{search(hashtagText.text.replace("#",""))}
}
}

View File

@ -39,12 +39,11 @@ import "qrc:/js/smiley.js" as Smileyjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Flickable{ Rectangle{
color:"white"
width:root.width-5*mm width:root.width-5*mm
height:root.height-12*mm height:root.height-12*mm
contentHeight: messageColumn.height //anchors.fill: parent
boundsBehavior: Flickable.StopAtBounds
id:messageSend
property string parentId: "" property string parentId: ""
property string reply_to_user:"" property string reply_to_user:""
property alias bodyMessage: bodyField.text property alias bodyMessage: bodyField.text
@ -57,15 +56,17 @@ Flickable{
property var group_allow:login.permissions[2] property var group_allow:login.permissions[2]
property var group_deny:login.permissions[3] property var group_deny:login.permissions[3]
function attachImage(url){ function attachImage(url){ print("attachImage "+url)
var imageAttachmentObject=Qt.createQmlObject('import QtQuick 2.0; Image {id:imageAttachment'+attachImageURLs.length+'; source:"'+ var imageAttachmentObject=Qt.createQmlObject('import QtQuick 2.0; Image {id:imageAttachment'+attachImageURLs.length+'; source:"'+
url.toString()+'"; x:2*mm; width: 45*mm; height: 45*mm;fillMode: Image.PreserveAspectFit;MouseArea{anchors.fill:parent;onClicked:{attachImageURLs.splice(attachImageURLs.indexOf("'+ url.toString()+'"; x:2*mm; width: 45*mm; height: 45*mm;fillMode: Image.PreserveAspectFit;MouseArea{anchors.fill:parent;onClicked:{attachImageURLs.splice(attachImageURLs.indexOf("'+
url+'"),1); imageAttachment'+attachImageURLs.length+'.destroy()}}}',messageColumn,"attachedImage"); url+'"),1); imageAttachment'+attachImageURLs.length+'.destroy()}}}',messageColumn,"attachedImage");
} }
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";
xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/update");
xhr.clearParams(); xhr.clearParams();
xhr.setParam("source", "Friendiqa"); xhr.setParam("source", "Friendiqa");
xhr.setParam("status", status); xhr.setParam("status", status);
@ -80,17 +81,27 @@ Flickable{
} }
function dmUpdate(title,text,replyto,screen_name,attachImageURL) { function dmUpdate(title,text,replyto,screen_name,attachImageURL) {
xhr.url= login.server + "/api/direct_messages/new.json"; //xhr.url= login.server + "/api/direct_messages/new.json";
xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/new");
xhr.clearParams(); xhr.clearParams();
xhr.setParam("text", text); xhr.setParam("text", text);
xhr.setParam("screen_name", screen_name); xhr.setParam("screen_name", screen_name);
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();
} }
Column { Flickable{
anchors.fill: parent
contentHeight: messageColumn.height
boundsBehavior: Flickable.StopAtBounds
id:messageSend
Column {
id:messageColumn id:messageColumn
spacing: 0.5*mm spacing: 0.5*mm
width: parent.width width: parent.width
@ -98,7 +109,7 @@ Flickable{
id: titleField id: titleField
width: parent.width width: parent.width
placeholderText: qsTr("Title (optional)") placeholderText: qsTr("Title (optional)")
visible: messageSend.parentId === "" visible: parentId === ""
} }
Rectangle{ Rectangle{
@ -236,3 +247,4 @@ Flickable{
} }
Component.onCompleted: if(attachImageURLs.length>0){attachImage(attachImageURLs[0])} Component.onCompleted: if(attachImageURLs.length>0){attachImage(attachImageURLs[0])}
} }
}

View File

@ -31,64 +31,98 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.3
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
import "qrc:/js/news.js" as Newsjs import "qrc:/js/news.js" as Newsjs
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
//import AndroidNative 1.0
Item { Item {
Connections{ Connections{
target:newstab target:newstab
onNewstabstatusChanged:{ onNewstabstatusChanged:{
newstabstatusButton.text= qsTr(newstab.newstabstatus) newstabstatusButton.text= qsTr(newstab.newstabstatus)
// switch(newstab.newstabstatus){
// case "Timeline": newstabstatusCombo.currentIndex=1; break;
// case "Conversations":newstabstatusCombo.currentIndex=2; break;
// case "Favorites":newstabstatusCombo.currentIndex=3; break;
// case "Network":newstabstatusCombo.currentIndex=4; break;
// case "Direct Messages":newstabstatusCombo.currentIndex=5; break;
// case "Notifications":newstabstatusCombo.currentIndex=6; break;
// case "Search":newstabstatusCombo.currentIndex=7; break;
// case "Groupnews":newstabstatusCombo.currentIndex=8; break;
// }
} }
} }
Connections{ Connections{
target:xhr target:xhr
// onError:{if (data=="contact"){downloadNotice.text=root.newContacts[root.currentContact].name+"... Error!"}} onError:{
onSuccess:{replytimer.start() //wait 1 second to load new timeline Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);
}
onSuccess:{
// downloadNotice.text=downloadNotice.text+ "\n xhr finished "+Date.now();
Service.processNews(api,data);
} }
} }
Timer {id:replytimer; interval: 1000; running: false; repeat: false Timer {id:replytimer; interval: 1000; running: false; repeat: false
onTriggered: { onTriggered: {
if(newstab.newstabstatus=="Conversation"){ if(newstab.newstabstatus=="Conversation"){
showConversation(newsStack.timelineIndex-1,newsModel.get(0).newsitemobject)} showConversation(newsStack.timelineIndex-1,newsModel.get(0).newsitemobject)}
else{ else{
var onlynew=true; Service.updateView(newstab.newstabstatus)
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(rns,rnc){
root.contactLoadType="news"; root.contactLoadType="news";
root.news=rns;root.newContacts=rnc;})
} }
} }
} }
Timer {id:contacttimer; interval: 50; running: false; repeat: false
onTriggered: {
// downloadNotice.text=downloadNotice.text + "\n contactTimer start "+ Date.now()
root.newContacts=Newsjs.findNewContacts(root.news,root.contactlist);
Newsjs.storeNews(login,db,root.news,root)
}
}
function showNews(newsToShow){ function showNews(newsToShow){
try{if (newsStack.depth>1){newsStack.pop()}}catch(e){} try{if (newsStack.depth>1){newsStack.pop()}}catch(e){}
newsBusy.running=false; newsBusy.running=false;
var currentTime= new Date(); var currentTime= new Date();
downloadNotice.text=""; // downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow}; //print("appendnews "+newsStack.appendNews +JSON.stringify(newsToShow))
var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'appendnews':newsStack.appendNews};
newsWorker.sendMessage(msg); newsWorker.sendMessage(msg);
newsStack.appendNews=false
} }
function showConversation(conversationIndex,newsitemobject){ function showConversation(conversationIndex,newsitemobject){
//newsBusy.running=true; //newsBusy.running=true;
root.contactLoadType="conversation"; root.contactLoadType="conversation";
newsStack.conversationIndex= conversationIndex; newsStack.conversationIndex= conversationIndex;
//print(newsitemobject.id);
if(newsitemobject.messagetype==0){ if(newsitemobject.messagetype==0){
Newsjs.requestConversation(root.login,db,newsitemobject.status_id,root.contactlist,root,function(ns,nc){ xhr.clearParams();
root.news=ns;root.newContacts=nc; xhr.setLogin(login.username+":"+Qt.atob(login.password));
})} xhr.setUrl(login.server);
else{Newsjs.conversationfromdb(root.db,root.login.username,newsitemobject.statusnet_conversation_id, function(newsarray){ xhr.setApi("/api/conversation/show");
root.news=newsarray;root.newContacts=[]; xhr.setParam("id",newsitemobject.id)
})} xhr.get();
}
else{
xhr.clearParams();
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/conversation");
xhr.setParam("uri",newsitemobject.statusnet_conversation_id)
xhr.get();
}
} }
function showContact(contact){ function showContact(contact){
@ -98,6 +132,21 @@ Item {
} }
} }
function search(term){print("Search "+term)
if (term!=""){
newstab.newstabstatus="Search";
newsBusy.running=true;
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/search");
xhr.clearParams();
xhr.setParam("q",term)
xhr.get();}
newsSearch.visible=false;
newsView.anchors.topMargin=7*mm
}
function onFriendsMessages(friend){ function onFriendsMessages(friend){
newstab.newstabstatus="Contact" newstab.newstabstatus="Contact"
Newsjs.newsfromdb(db,root.login.username, function(dbnews){ Newsjs.newsfromdb(db,root.login.username, function(dbnews){
@ -132,18 +181,163 @@ Item {
id: newsStack id: newsStack
anchors.fill:parent anchors.fill:parent
property int conversationIndex: 0 property int conversationIndex: 0
property bool appendNews: false
property var allchats: ({})
initialItem:Rectangle { initialItem:Rectangle {
id:newslistRectangle id:newslistRectangle
y:1 y:1
color: "white" color: "white"
// ComboBox{
// id:newstabstatusCombo
// anchors.top: parent.top
// anchors.topMargin: 0.5*mm
// width: 1/3*root.width
// height: 5*mm;
// style:
// ComboBoxStyle{
// background: Rectangle {
// color:"light blue"
// radius: 0.5*mm
// }
// label: Text {
// verticalAlignment: Text.AlignVCenter
// horizontalAlignment: Text.AlignHCenter
// text: control.currentText
// }
// }
// model: ListModel {
// id: newscomboItems
// ListElement { type: "Timeline"; text: qsTr("Timeline")}
// ListElement { type: "Conversations";text: qsTr("Conversations")}
// ListElement { type: "Favorites";text: qsTr("Favorites") }
// ListElement { type: "PublicTimeline";text: qsTr("Public timeline") }
// ListElement { type: "DirectMessages";text: qsTr("Direct Messages") }
// ListElement { type: "Notifications";text: qsTr("Notifications") }
// ListElement { type: "Search";text: qsTr("Search") }
// ListElement { type: "Groupnews"; text: qsTr("Group News") }
// ListElement { type: "Quit";text: qsTr("Quit") }
// }
// currentIndex:(login.newsViewType=="Timeline")?0:1
// onCurrentIndexChanged:{
// //onActivated:{
// print(newscomboItems.get(currentIndex).type);
// switch(newscomboItems.get(currentIndex).type){
// case "Timeline":
// newstab.newstabstatus="Timeline";
// newsModel.clear();
// try{ Newsjs.newsfromdb(root.db,root.login.username, function(dbnews){
// showNews(dbnews)
// })}catch(e){Helperjs.showMessage("Error",e,root)}
// break;
// case "Conversations":
// newsModel.clear();
// newstab.newstabstatus="Conversations";
// Newsjs.chatsfromdb(db,root.login.username,function(news){showNews(news)})
// break;
// case "Favorites":
// newstab.newstabstatus="Favorites";
// root.contactLoadType="favorites";
// Service.updateView("Favorites");
// break;
// case "PublicTimeline":
// newstab.newstabstatus="Network";
// Service.updateView("Network");
// break;
// case "DirectMessages":
// newstab.newstabstatus="DirectMessages";
// Service.updateView("DirectMessages");
// break;
// case "Notifications":
// newstab.newstabstatus="Notifications";
// Service.updateView("Notifications");
// break;
// case "Search":
// newsView.anchors.topMargin=18*mm;
// newsSearch.visible=true
// break;
// case "Groupnews":
// Service.showGroups();
// break;
// case "Quit":
// Service.cleanNews(root.db,function(){
// Service.cleanContacts(root.login,root.db,function(){
// Qt.quit()})
// })
// }
// }
// }
BlueButton{ BlueButton{
id:newstabstatusButton id:newstabstatusButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0.5*mm anchors.topMargin: 0.5*mm
text: qsTr(newstab.newstabstatus) text: qsTr(newstab.newstabstatus)
onClicked: {newstabmenu.popup()} onClicked: {newstabmenu.popup()}
Menu{id:newstabmenu
MenuItem {
text: qsTr("Timeline")
onTriggered: {
newstab.newstabstatus="Timeline";
newsModel.clear();
try{ Newsjs.newsfromdb(root.db,root.login.username, function(dbnews){
showNews(dbnews)
})}catch(e){Helperjs.showMessage("Error",e,root)}}
}
MenuItem {
text: qsTr("Conversations")
onTriggered:{
newsModel.clear();
newstab.newstabstatus="Conversations";
Newsjs.chatsfromdb(db,root.login.username,function(news){showNews(news)})
}
}
MenuItem {
text: qsTr("Favorites")
onTriggered:{
newstab.newstabstatus="Favorites";
// root.contactLoadType="favorites";
Service.updateView("Favorites")
}
}
MenuItem {
text: qsTr("Public timeline")
onTriggered:{
newstab.newstabstatus="Public Timeline";
Service.updateView("Public Timeline")
}
}
MenuItem {
text: qsTr("Direct Messages")
onTriggered:{
newstab.newstabstatus="Direct Messages";
Service.updateView("Direct Messages")
}
}
MenuItem {
text: qsTr("Notifications")
onTriggered:{
newstab.newstabstatus="Notifications";
Service.updateView("Notifications")
}
}
MenuItem {
text: qsTr("Group news")
onTriggered:Service.showGroups();
}
MenuItem {
text: qsTr("Quit")
onTriggered:{
Service.cleanNews(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
Qt.quit()})
})
}
}
}
} }
Row{ Row{
@ -152,6 +346,20 @@ Item {
anchors.topMargin: 0.5*mm anchors.topMargin: 0.5*mm
anchors.right: parent.right anchors.right: parent.right
BlueButton {
id: searchButton
text: "\uf002"
onClicked: {
if (newsSearch.visible==false){
newsView.anchors.topMargin=18*mm;
newsSearch.visible=true}
else{
newsSearch.visible=false;
newsView.anchors.topMargin=7*mm;
}
}
}
BlueButton { BlueButton {
id: newMessageButton id: newMessageButton
text: "\uf040" text: "\uf040"
@ -166,32 +374,20 @@ Item {
},"isFriend",1); },"isFriend",1);
} }
} }
BlueButton { // BlueButton {
id: quitButton // id: quitButton
text: "\uf08b" // text: "\uf08b"
onClicked: {Service.cleanNews(root.db,function(){ // onClicked: {Service.cleanNews(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){ // Service.cleanContacts(root.login,root.db,function(){
Qt.quit() }) // Qt.quit() })
})} // })}
} // }
BlueButton { BlueButton {
id: update id: update
text: "\uf021" text: "\uf021"
onClicked: { onClicked: {
newsBusy.running=true; //root.contactLoadType="news";
newstab.newstabstatus=login.newsViewType; Service.updateView(newstab.newstabstatus)
root.contactLoadType="news";
var onlynew=true;
//print("newstab "+ JSON.stringify(contactlist));
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(ns,nc){
root.news=ns;root.newContacts=nc;
if (ns.length==0){// update last 20 existing news for changes and likes
onlynew=false;
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(rns,rnc){
root.contactLoadType="news";
root.news=rns;root.newContacts=rnc;})
}
})
} }
} }
@ -211,7 +407,6 @@ Item {
onClicked:{ onClicked:{
var currentTime= new Date(); var currentTime= new Date();
var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at; var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;
print("Lastnews ID "+lastnews_id+Qt.atob(newsModel.get(newsModel.count-1).newsitemobject.statusnet_html))
if(newstab.newstabstatus=="Timeline"){ if(newstab.newstabstatus=="Timeline"){
Newsjs.newsfromdb(root.db,root.login.username, function(news){ Newsjs.newsfromdb(root.db,root.login.username, function(news){
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true}; var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
@ -227,11 +422,27 @@ Item {
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true}; var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
newsWorker.sendMessage(msg); newsWorker.sendMessage(msg);
},newsModel.get(newsModel.count-1).newsitemobject.uid,lastnews_id)} },newsModel.get(newsModel.count-1).newsitemobject.uid,lastnews_id)}
} else if (newstab.newstabstatus=="Notifications"){}
else{
newsStack.appendNews=true;
xhr.setParam("max_id",newsModel.get(newsModel.count-1).newsitemobject.id-1);
xhr.get()
}}
} }
} }
} }
Rectangle{
id: newsSearch
color: "#FFFAFA"
y:8*mm
width:root.width
height: 8*mm
visible:false
Search{
anchors.fill: parent
anchors.margins: mm
}
}
ListView { ListView {
id: newsView id: newsView
anchors.fill: parent anchors.fill: parent
@ -245,19 +456,9 @@ Item {
delegate: Newsitem{} delegate: Newsitem{}
//onContentYChanged:{if(contentY<-8*mm&&contentY>(-8*mm-1)){print("refreshing"); //onContentYChanged:{if(contentY<-8*mm&&contentY>(-8*mm-1)){print("refreshing");
onDragEnded:{if(contentY<-5*mm){//print("refreshing"); onDragEnded:{if(contentY<-5*mm){//print("refreshing");
newsBusy.running=true;
newstab.newstabstatus=login.newsViewType;
root.contactLoadType="news"; root.contactLoadType="news";
var onlynew=true; var onlynew=true;
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(ns,nc){ Service.updateView(newstab.newstabstatus)
root.news=ns;root.newContacts=nc;
if (ns.length==0){// update last 20 existing news for changes and likes
onlynew=false;
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(rns,rnc){
root.contactLoadType="news";
root.news=rns;root.newContacts=rnc;})
}
})
}} }}
} }
@ -299,67 +500,23 @@ Item {
text:"" text:""
} }
} }
Menu {
id:newstabmenu
MenuItem {
text: qsTr("Timeline")
onTriggered: {
newstab.newstabstatus="Timeline";
newsModel.clear();
try{ Newsjs.newsfromdb(root.db,root.login.username, function(dbnews){
showNews(dbnews)
})}catch(e){Helperjs.showMessage("Error",e,root)}}
}
MenuItem {
text: qsTr("Favorites")
onTriggered:{
newstab.newstabstatus="Favorites";
root.contactLoadType="favorites";
newsBusy.running=true;
Newsjs.requestFavorites(root.login,db,root.contactlist,root,function(ns,nc){
root.news=ns; root.newContacts=nc;
})
}
}
MenuItem {
text: qsTr("Conversations")
onTriggered:{
newsModel.clear();
newstab.newstabstatus="Conversations";
Newsjs.chatsfromdb(db,root.login.username,function(news){showNews(news)})
}
}
MenuItem {
text: qsTr("Notifications")
onTriggered:{
newstab.newstabstatus="Notifications";
newsBusy.running=true;
Newsjs.getNotifications(root.login,db,root,function(news){
showNews(news)}
)}
}
}
Component.onCompleted: { Component.onCompleted: {
root.messageSignal.connect(onFriendsMessages); root.messageSignal.connect(onFriendsMessages);
root.directmessageSignal.connect(onDirectMessage); root.directmessageSignal.connect(onDirectMessage);
root.newsSignal.connect(showNews); root.newsSignal.connect(showNews);
root.uploadSignal.connect(sendUrls); root.uploadSignal.connect(sendUrls);
root.sendtextSignal.connect(sendtext); root.sendtextSignal.connect(sendtext);
try{newsModel.clear()} catch(e){} try{newsModel.clear()} catch(e){}
xhr.setLogin(login.username+":"+Qt.atob(login.password));
//print("imageUrls "+JSON.stringify(imageUrls)+" newsstack.depth:"+newsStack.depth); xhr.setUrl(login.server);
//newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{attachImageURLs:[imageUrl]}})
// var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
// osSettings.imagePickQml+'{multiple : true; onReady: {'+
// 'if(imageUrls.length==1){root.currentIndex=0;newstab.active=true;root.uploadSignal(imageUrls)} else{'+
// ' root.currentIndex=2;fotostab.active=true;'+
// 'root.uploadSignal(imageUrls)};}}',newstab,"imagePicker");
//SystemDispatcher.setInitialized();
if(root.news.length>0){showNews(root.news)} if(root.news.length>0){showNews(root.news)}
else{ newstab.newstabstatus=login.newsViewType; else{ newstab.newstabstatus=login.newsViewType;
if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})} if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
else{Newsjs.chatsfromdb(db,login.username,function(dbnews){showNews(dbnews)})} else{Newsjs.chatsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
}
if(osSettings.imagePickQml=="ImagePicker"){var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
var IntentReceiverQml = component.createObject(root)
} }
} }
} }

View File

@ -52,6 +52,11 @@ Item {
var component = Qt.createComponent("qrc:/qml/newsqml/FriendicaActivities.qml"); var component = Qt.createComponent("qrc:/qml/newsqml/FriendicaActivities.qml");
var imagedialog = component.createObject(friendicaActivities,{"activitymembers": contacts}); var imagedialog = component.createObject(friendicaActivities,{"activitymembers": contacts});
} }
function findTags(fulltext){
return fulltext.match(/\s+[#]+[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]+/g)
}
Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"} Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"}
Rectangle{ Rectangle{
@ -72,7 +77,8 @@ Item {
height: 7*mm height: 7*mm
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked:{showContact(newsitemobject.user)} onClicked:{
showContact(newsitemobject.user)}
} }
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"} onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
} }
@ -82,7 +88,7 @@ Item {
width:parent.width width:parent.width
font.pixelSize: 1.5*mm font.pixelSize: 1.5*mm
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: Qt.atob(newsitemobject.user.name)+forumname text: newsitemobject.user.name+forumname
} }
} }
Column { Column {
@ -143,7 +149,7 @@ Item {
linkColor: "light green" linkColor: "light green"
id: itemMessage id: itemMessage
textFormat: Text.RichText textFormat: Text.RichText
text:Qt.atob(newsitemobject.statusnet_html) text:newsitemobject.statusnet_html
width: newsitem.width-8*mm-2 width: newsitem.width-8*mm-2
height: Math.min(implicitHeight,3/4*root.height) height: Math.min(implicitHeight,3/4*root.height)
wrapMode: Text.Wrap wrapMode: Text.Wrap
@ -151,6 +157,14 @@ Item {
onLinkActivated:{ onLinkActivated:{
Qt.openUrlExternally(link)} Qt.openUrlExternally(link)}
Component.onCompleted:{ Component.onCompleted:{
if (newsitemobject.messagetype==0){
var hashtags=[];
hashtags=findTags(newsitemobject.text);
var component = Qt.createComponent("qrc:/qml/newsqml/Hashtag.qml");
for (var tags in hashtags){
var hashtagQml = component.createObject(friendicaActivities,{"text":hashtags[tags].trim()});
}}
if (newsitemobject.attachmentList.length>0){ if (newsitemobject.attachmentList.length>0){
for(var attachments in newsitemobject.attachmentList){// (newsitemobject.attachmentList[attachments].url); for(var attachments in newsitemobject.attachmentList){// (newsitemobject.attachmentList[attachments].url);
var attachcomponent = Qt.createQmlObject('import QtQuick 2.0; '+ var attachcomponent = Qt.createQmlObject('import QtQuick 2.0; '+
@ -198,7 +212,7 @@ Item {
text: friendica_activities.likeText text: friendica_activities.likeText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.like)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.like)}
} }
} }
Label{color: "grey" Label{color: "grey"
@ -207,7 +221,7 @@ Item {
text: friendica_activities.dislikeText text: friendica_activities.dislikeText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.dislike)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.dislike)}
} }
} }
Label{color: "grey" Label{color: "grey"
@ -216,7 +230,7 @@ Item {
text: friendica_activities.attendyesText text: friendica_activities.attendyesText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.attendyes)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendyes)}
}} }}
Label{color: "grey" Label{color: "grey"
height:3.5*mm height:3.5*mm
@ -224,7 +238,7 @@ Item {
text: friendica_activities.attendnoText text: friendica_activities.attendnoText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.attendno)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendno)}
} }
} }
Label{color: "grey" Label{color: "grey"
@ -233,7 +247,7 @@ Item {
text: friendica_activities.attendmaybeText text: friendica_activities.attendmaybeText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.attendmaybe)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendmaybe)}
} }
} }
Label{ Label{
@ -267,8 +281,8 @@ Item {
} }
} }
onClicked: { onClicked: {
if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.status_id,root);dislikeCheckbox.checked=false; model.friendica_activities.self.liked=0 } if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.id,root);dislikeCheckbox.checked=false; model.friendica_activities.self.liked=0 }
else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.status_id,root); model.friendica_activities.self.liked=1}} else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.id,root); model.friendica_activities.self.liked=1}}
} }
CheckBox{ CheckBox{
id: dislikeCheckbox id: dislikeCheckbox
@ -289,8 +303,8 @@ Item {
} }
} }
onClicked: { onClicked: {
if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.status_id,root);likeCheckbox.checked=false; model.friendica_activities.self.disliked=0} if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.id,root);likeCheckbox.checked=false; model.friendica_activities.self.disliked=0}
else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.status_id,root); model.friendica_activities.self.disliked=1}} else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.id,root); model.friendica_activities.self.disliked=1}}
} }
CheckBox { CheckBox {
@ -312,22 +326,23 @@ Item {
checked:(newsitemobject.favorited>0) checked:(newsitemobject.favorited>0)
onClicked:{ onClicked:{
if(favoritedCheckbox.checkedState==Qt.Checked){ if(favoritedCheckbox.checkedState==Qt.Checked){
Newsjs.favorite(login,true,newsitemobject.status_id,root); model.newsitemobject.favorited=1} Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
else if(favoritedCheckbox.checkedState==Qt.Unchecked){ else if(favoritedCheckbox.checkedState==Qt.Unchecked){
Newsjs.favorite(login,false,newsitemobject.status_id,root);model.newsitemobject.favorited=0} Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
} }
} }
Rectangle{ Rectangle{
width: 10*mm width: 10*mm
height: 4*mm height: 4*mm
visible:(newsitemobject.messagetype!==2)
color:"transparent" color:"transparent"
Text{ Text{
id:newsmenusymbol id:newsmenusymbol
color: "grey" color: "grey"
anchors.centerIn: parent anchors.centerIn: parent
font.pixelSize: 2*mm font.pixelSize: 2.5*mm
font.bold: true font.family:fontAwesome.name
text: "\u22EE" text: "\uf142"
} }
MouseArea{ MouseArea{
anchors.fill:parent anchors.fill:parent
@ -336,7 +351,7 @@ Item {
Rectangle{ Rectangle{
width: 10*mm width: 10*mm
height: 4*mm height: 4*mm
visible:newstab.newstabstatus!="Conversation" visible:(newsitemobject.messagetype!==2)&&(newstab.newstabstatus!="Conversation")
color:"transparent" color:"transparent"
Text{ Text{
id:conversationsymbol id:conversationsymbol
@ -365,7 +380,7 @@ Item {
onTriggered: { onTriggered: {
var directmessage=0; var directmessage=0;
if (newsitemobject.messagetype==1){ directmessage=1} if (newsitemobject.messagetype==1){ directmessage=1}
newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.status_id,"login":root.login,"directmessage":directmessage}}); newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.id,"login":root.login,"directmessage":directmessage}});
} }
} }
MenuItem { MenuItem {
@ -377,7 +392,7 @@ Item {
MenuItem { MenuItem {
text: qsTr("Repost") text: qsTr("Repost")
onTriggered: { onTriggered: {
Newsjs.retweetNews(root.login,db,newsitemobject.status_id,root,function(reply){ Newsjs.retweetNews(root.login,db,newsitemobject.id,root,function(reply){
Helperjs.showMessage("Repost",qsTr("Success!"),root) Helperjs.showMessage("Repost",qsTr("Success!"),root)
}) })
} }
@ -396,17 +411,17 @@ Item {
title: qsTr("Attending") title: qsTr("Attending")
MenuItem{ MenuItem{
text:qsTr("yes") text:qsTr("yes")
onTriggered: {Newsjs.attend(root.login,db,"yes",newsitemobject.status_id,root,function(){ onTriggered: {Newsjs.attend(root.login,db,"yes",newsitemobject.id,root,function(){
model.friendica_activities.self.attending="yes";attending="yes"}) model.friendica_activities.self.attending="yes";attending="yes"})
} }
} }
MenuItem{text:qsTr("maybe") MenuItem{text:qsTr("maybe")
onTriggered: {Newsjs.attend(root.login,db,"maybe",newsitemobject.status_id,root,function(){ onTriggered: {Newsjs.attend(root.login,db,"maybe",newsitemobject.id,root,function(){
model.friendica_activities.self.attending="maybe";attending="maybe"}) model.friendica_activities.self.attending="maybe";attending="maybe"})
} }
} }
MenuItem{text:qsTr("no") MenuItem{text:qsTr("no")
onTriggered: {Newsjs.attend(root.login,db,"no",newsitemobject.status_id,root,function(){ onTriggered: {Newsjs.attend(root.login,db,"no",newsitemobject.id,root,function(){
model.friendica_activities.self.attending="no";attending="no"})} model.friendica_activities.self.attending="no";attending="no"})}
} }
} }
@ -414,7 +429,7 @@ Item {
MenuItem { MenuItem {
text: qsTr("Delete") text: qsTr("Delete")
onTriggered: { onTriggered: {
Newsjs.deleteNews(root.login,root.db,newsitemobject.status_id,newsitemobject.messagetype,root,function(reply){ Newsjs.deleteNews(root.login,root.db,newsitemobject.id,newsitemobject.messagetype,root,function(reply){
var msg = {'deleteId': index, 'model': newsModel}; var msg = {'deleteId': index, 'model': newsModel};
newsWorker.sendMessage(msg); newsWorker.sendMessage(msg);
}) })

View File

@ -104,7 +104,7 @@ Package {
Component.onCompleted:{ Component.onCompleted:{
try {photoModel.clear()}catch (e){print(e)} try {photoModel.clear()}catch (e){print(e)}
if(foreignPicture){ if(foreignPicture){
Imagejs.newRequestFriendsPictures(login,albumlink,friend,remoteContact,remoteauth,root,function(obj){ Imagejs.newRequestFriendsPictures(login,albumlink,friend,photoStack.remoteContact,remoteauth,root,function(obj){
if (obj) { if (obj) {
for (var k=0;k<obj.length;k++){ for (var k=0;k<obj.length;k++){
photoModel.append({"imageLocation": obj[k].thumb,"photoDescription":obj[k].name,"photoLink":obj[k].link}) photoModel.append({"imageLocation": obj[k].thumb,"photoDescription":obj[k].name,"photoLink":obj[k].link})

View File

@ -17,76 +17,76 @@
<context> <context>
<name>ConfigTab</name> <name>ConfigTab</name>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="78"/> <location filename="../qml/configqml/ConfigTab.qml" line="69"/>
<location filename="../qml/configqml/ConfigTab.qml" line="362"/> <location filename="../qml/configqml/ConfigTab.qml" line="351"/>
<location filename="../qml/configqml/ConfigTab.qml" line="384"/> <location filename="../qml/configqml/ConfigTab.qml" line="374"/>
<source>User</source> <source>User</source>
<translation>Name</translation> <translation>Name</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="105"/> <location filename="../qml/configqml/ConfigTab.qml" line="96"/>
<source>Server</source> <source>Server</source>
<translation>Server</translation> <translation>Server</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="109"/> <location filename="../qml/configqml/ConfigTab.qml" line="100"/>
<source>Nickname</source> <source>Nickname</source>
<translation>Kurzname</translation> <translation>Kurzname</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="114"/> <location filename="../qml/configqml/ConfigTab.qml" line="105"/>
<source>Password</source> <source>Password</source>
<translation>Passwort</translation> <translation>Passwort</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="118"/> <location filename="../qml/configqml/ConfigTab.qml" line="109"/>
<source>Image dir.</source> <source>Image dir.</source>
<translation>Bildverz.</translation> <translation>Bildverz.</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="123"/> <location filename="../qml/configqml/ConfigTab.qml" line="114"/>
<source>Max. News</source> <source>Max. News</source>
<translation>Max. Nachr.</translation> <translation>Max. Nachr.</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="127"/> <location filename="../qml/configqml/ConfigTab.qml" line="118"/>
<source>News as</source> <source>News as</source>
<translation>Anzeige</translation> <translation>Anzeige</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="131"/> <location filename="../qml/configqml/ConfigTab.qml" line="122"/>
<source>Interval (0=None)</source> <source>Interval (0=None)</source>
<translation>Intervall (0=keins)</translation> <translation>Intervall (0=keins)</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<location filename="../qml/configqml/ConfigTab.qml" line="340"/> <location filename="../qml/configqml/ConfigTab.qml" line="328"/>
<source>Error</source> <source>Error</source>
<translation>Fehler</translation> <translation>Fehler</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<source>Nickname not registered at given server!</source> <source>Nickname not registered at given server!</source>
<translation>Name auf der Seite nicht registriert!</translation> <translation>Name auf der Seite nicht registriert!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="301"/> <location filename="../qml/configqml/ConfigTab.qml" line="289"/>
<source>Confirm</source> <source>Confirm</source>
<translation>Bestätigen</translation> <translation>Bestätigen</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="305"/> <location filename="../qml/configqml/ConfigTab.qml" line="293"/>
<source>No server given! </source> <source>No server given! </source>
<translation>Kein Server angegeben!</translation> <translation>Kein Server angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="306"/> <location filename="../qml/configqml/ConfigTab.qml" line="294"/>
<source>No nickname given! </source> <source>No nickname given! </source>
<translation>Kein Kurzname angegeben!</translation> <translation>Kein Kurzname angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="307"/> <location filename="../qml/configqml/ConfigTab.qml" line="295"/>
<source>Nickname not registered at given server! </source> <source>Nickname not registered at given server! </source>
<translation>Name auf der Seite nicht registriert!</translation> <translation>Name auf der Seite nicht registriert!</translation>
</message> </message>
@ -95,42 +95,42 @@
<translation type="vanished">Kein Nutzername angegeben!</translation> <translation type="vanished">Kein Nutzername angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="308"/> <location filename="../qml/configqml/ConfigTab.qml" line="296"/>
<source>No password given! </source> <source>No password given! </source>
<translation>Kein Passwort angegeben!</translation> <translation>Kein Passwort angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="309"/> <location filename="../qml/configqml/ConfigTab.qml" line="297"/>
<source>No image directory given!</source> <source>No image directory given!</source>
<translation>Kein Verzeichnis für Bilder angegeben!</translation> <translation>Kein Verzeichnis für Bilder angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="310"/> <location filename="../qml/configqml/ConfigTab.qml" line="298"/>
<source>No maximum news number given!</source> <source>No maximum news number given!</source>
<translation>Maximale News-Anzahl nicht angegeben!</translation> <translation>Maximale News-Anzahl nicht angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<source>Wrong password!</source> <source>Wrong password!</source>
<translation>Falsches Passwort!</translation> <translation>Falsches Passwort!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Success</source> <source>Success</source>
<translation>Bestätigt</translation> <translation>Bestätigt</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Name</source> <source>Name</source>
<translation>Name</translation> <translation>Name</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="399"/> <location filename="../qml/configqml/ConfigTab.qml" line="389"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Chronologisch</translation> <translation>Chronologisch</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="403"/> <location filename="../qml/configqml/ConfigTab.qml" line="393"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Unterhaltungen</translation> <translation>Unterhaltungen</translation>
</message> </message>
@ -189,12 +189,12 @@
<translation>Freunde</translation> <translation>Freunde</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="200"/> <location filename="../qml/contactqml/FriendsTab.qml" line="202"/>
<source>Contacts</source> <source>Contacts</source>
<translation>Kontakte</translation> <translation>Kontakte</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="253"/> <location filename="../qml/contactqml/FriendsTab.qml" line="259"/>
<source>Groups</source> <source>Groups</source>
<translation>Gruppen</translation> <translation>Gruppen</translation>
</message> </message>
@ -213,32 +213,37 @@
<context> <context>
<name>ImageUploadDialog</name> <name>ImageUploadDialog</name>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="127"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="100"/>
<source>Upload to album</source>
<translation>In Album hochladen</translation>
</message>
<message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="121"/>
<source>Album</source> <source>Album</source>
<translation>Album</translation> <translation>Album</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="132"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="126"/>
<source>Image</source> <source>Image</source>
<translation>Bild</translation> <translation>Bild</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="137"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="131"/>
<source>Description</source> <source>Description</source>
<translation>Beschreibung</translation> <translation>Beschreibung</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="236"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="229"/>
<source>Upload</source> <source>Upload</source>
<translation>Hochladen</translation> <translation>Hochladen</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source>Error</source> <source>Error</source>
<translation>Fehler</translation> <translation>Fehler</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source> No album name given</source> <source> No album name given</source>
<translation>Kein Albumname angegeben</translation> <translation>Kein Albumname angegeben</translation>
</message> </message>
@ -246,17 +251,17 @@
<context> <context>
<name>MessageSend</name> <name>MessageSend</name>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="98"/> <location filename="../qml/newsqml/MessageSend.qml" line="111"/>
<source>Title (optional)</source> <source>Title (optional)</source>
<translation>Überschrift (optional)</translation> <translation>Überschrift (optional)</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Error</source> <source>Error</source>
<translation>Fehler</translation> <translation>Fehler</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Only one attachment supported at the moment. <source>Only one attachment supported at the moment.
Remove other attachment first!</source> Remove other attachment first!</source>
<translation>Nur ein Anhang derzeit unterstützt. <translation>Nur ein Anhang derzeit unterstützt.
@ -270,30 +275,55 @@
<translation type="vanished">Lade Profilbild für </translation> <translation type="vanished">Lade Profilbild für </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="204"/> <location filename="../qml/newsqml/NewsTab.qml" line="404"/>
<source>More</source> <source>More</source>
<translation>Mehr</translation> <translation>Mehr</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="301"/> <location filename="../qml/newsqml/NewsTab.qml" line="281"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Chronologisch</translation> <translation>Chronologisch</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="310"/> <location filename="../qml/newsqml/NewsTab.qml" line="63"/>
<source>Error</source>
<translation>Fehler</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="298"/>
<source>Favorites</source> <source>Favorites</source>
<translation>Markierte News</translation> <translation>Markierte News</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="322"/> <location filename="../qml/newsqml/NewsTab.qml" line="290"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Unterhaltungen</translation> <translation>Unterhaltungen</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="330"/> <location filename="../qml/newsqml/NewsTab.qml" line="306"/>
<source>Public timeline</source>
<translation>Gemeinschaft</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="314"/>
<source>Direct Messages</source>
<translation>Direktnachrichten</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="321"/>
<source>Notifications</source> <source>Notifications</source>
<translation>Meldungen</translation> <translation>Meldungen</translation>
</message> </message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="328"/>
<source>Group news</source>
<translation>News Gruppe</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="332"/>
<source>Quit</source>
<translation>Schliessen</translation>
</message>
</context> </context>
<context> <context>
<name>Newsitem</name> <name>Newsitem</name>
@ -303,77 +333,77 @@
<translation>Teilnahme</translation> <translation>Teilnahme</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="99"/> <location filename="../qml/newsqml/Newsitem.qml" line="105"/>
<source>Source: </source> <source>Source: </source>
<translation>Quelle: </translation> <translation>Quelle: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="100"/> <location filename="../qml/newsqml/Newsitem.qml" line="106"/>
<source>Direct Message</source> <source>Direct Message</source>
<translation>Direktnachricht</translation> <translation>Direktnachricht</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="115"/> <location filename="../qml/newsqml/Newsitem.qml" line="121"/>
<source>In reply to </source> <source>In reply to </source>
<translation>Antwort an </translation> <translation>Antwort an </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="127"/> <location filename="../qml/newsqml/Newsitem.qml" line="133"/>
<source> comments</source> <source> comments</source>
<translation> Kommentare</translation> <translation> Kommentare</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="221"/> <location filename="../qml/newsqml/Newsitem.qml" line="258"/>
<source>Attending: </source> <source>Attending: </source>
<translation>Teilnahme: </translation> <translation>Teilnahme: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="343"/> <location filename="../qml/newsqml/Newsitem.qml" line="378"/>
<source>Reply</source> <source>Reply</source>
<translation>Antworten</translation> <translation>Antworten</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="351"/> <location filename="../qml/newsqml/Newsitem.qml" line="386"/>
<source>DM</source> <source>DM</source>
<translation>Direktnachricht</translation> <translation>Direktnachricht</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="357"/> <location filename="../qml/newsqml/Newsitem.qml" line="392"/>
<source>Repost</source> <source>Repost</source>
<translation>Teilen</translation> <translation>Teilen</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="360"/> <location filename="../qml/newsqml/Newsitem.qml" line="395"/>
<source>Success!</source> <source>Success!</source>
<translation>Erledigt!</translation> <translation>Erledigt!</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="365"/> <location filename="../qml/newsqml/Newsitem.qml" line="400"/>
<source>Conversation</source> <source>Conversation</source>
<translation>Unterhaltung</translation> <translation>Unterhaltung</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="376"/> <location filename="../qml/newsqml/Newsitem.qml" line="410"/>
<source>Attending</source> <source>Attending</source>
<translation>Teilnahme</translation> <translation>Teilnahme</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="378"/> <location filename="../qml/newsqml/Newsitem.qml" line="412"/>
<source>yes</source> <source>yes</source>
<translation>ja</translation> <translation>ja</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="383"/> <location filename="../qml/newsqml/Newsitem.qml" line="417"/>
<source>maybe</source> <source>maybe</source>
<translation>vielleicht</translation> <translation>vielleicht</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="388"/> <location filename="../qml/newsqml/Newsitem.qml" line="422"/>
<source>no</source> <source>no</source>
<translation>nein</translation> <translation>nein</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="395"/> <location filename="../qml/newsqml/Newsitem.qml" line="429"/>
<source>Delete</source> <source>Delete</source>
<translation>Löschen</translation> <translation>Löschen</translation>
</message> </message>
@ -394,28 +424,28 @@
<context> <context>
<name>PhotoTab</name> <name>PhotoTab</name>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="115"/> <location filename="../qml/photoqml/PhotoTab.qml" line="121"/>
<source>&apos;s images</source> <source>&apos;s images</source>
<translation>s Bilder</translation> <translation>s Bilder</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="167"/> <location filename="../qml/photoqml/PhotoTab.qml" line="178"/>
<source>All Images</source> <source>All Images</source>
<translation>Alle Bilder</translation> <translation>Alle Bilder</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="172"/> <location filename="../qml/photoqml/PhotoTab.qml" line="183"/>
<source>Only new</source> <source>Only new</source>
<translation>Nur neue</translation> <translation>Nur neue</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="186"/> <location filename="../qml/photoqml/PhotoTab.qml" line="197"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="190"/> <location filename="../qml/photoqml/PhotoTab.qml" line="201"/>
<source>Own Images</source> <source>Own Images</source>
<translation>Eigene Bilder</translation> <translation>Eigene Bilder</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="227"/> <location filename="../qml/photoqml/PhotoTab.qml" line="238"/>
<source>More</source> <source>More</source>
<translation>Mehr</translation> <translation>Mehr</translation>
</message> </message>
@ -613,32 +643,32 @@
<translation>Aktualisieren</translation> <translation>Aktualisieren</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="206"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="208"/>
<source>profile id</source> <source>profile id</source>
<translation>Profil-Nummer</translation> <translation>Profil-Nummer</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Description</source> <source>Description</source>
<translation>Beschreibung</translation> <translation>Beschreibung</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Location</source> <source>Location</source>
<translation>Ort</translation> <translation>Ort</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Posts</source> <source>Posts</source>
<translation>Beiträge</translation> <translation>Beiträge</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="230"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="233"/>
<source>URL</source> <source>URL</source>
<translation>Profilseite</translation> <translation>Profilseite</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="231"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="234"/>
<source>Created at</source> <source>Created at</source>
<translation>Erstellt</translation> <translation>Erstellt</translation>
</message> </message>
@ -714,27 +744,26 @@
<translation>Personen nehmen vielleicht teil.</translation> <translation>Personen nehmen vielleicht teil.</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="77"/> <location filename="../js/newsworker.js" line="78"/>
<source>yes</source> <source>yes</source>
<translation>ja</translation> <translation>ja</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="78"/> <location filename="../js/newsworker.js" line="79"/>
<source>no</source> <source>no</source>
<translation>nein</translation> <translation>nein</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="79"/> <location filename="../js/newsworker.js" line="80"/>
<source>maybe</source> <source>maybe</source>
<translation>vielleicht</translation> <translation>vielleicht</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/> <location filename="../js/newsworker.js" line="96"/>
<source>seconds</source> <source>seconds</source>
<translation>Sekunden</translation> <translation>Sekunden</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="96"/>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="97"/>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="98"/>
@ -744,53 +773,64 @@
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="102"/>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="103"/>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="104"/>
<location filename="../js/newsworker.js" line="105"/>
<source>ago</source> <source>ago</source>
<translation>her</translation> <translation>her</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="97"/>
<source>minute</source> <source>minute</source>
<translation>Minute</translation> <translation>Minute</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="98"/>
<source>minutes</source> <source>minutes</source>
<translation>Minuten</translation> <translation>Minuten</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="99"/>
<source>hour</source> <source>hour</source>
<translation>Stunde</translation> <translation>Stunde</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="99"/> <location filename="../js/newsworker.js" line="100"/>
<source>hours</source> <source>hours</source>
<translation>Stunden</translation> <translation>Stunden</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="100"/> <location filename="../js/newsworker.js" line="101"/>
<source>day</source> <source>day</source>
<translation>Tag</translation> <translation>Tag</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="101"/> <location filename="../js/newsworker.js" line="102"/>
<source>days</source> <source>days</source>
<translation>Tage</translation> <translation>Tage</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="103"/>
<source>month</source> <source>month</source>
<translation>Monat</translation> <translation>Monat</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="104"/>
<source>months</source> <source>months</source>
<translation>Monate</translation> <translation>Monate</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="105"/>
<source>years</source> <source>years</source>
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context>
<name>service</name>
<message>
<location filename="../js/service.js" line="360"/>
<location filename="../js/service.js" line="362"/>
<location filename="../js/service.js" line="365"/>
<source>Error</source>
<translation>Fehler</translation>
</message>
</context>
</TS> </TS>

View File

@ -17,76 +17,76 @@
<context> <context>
<name>ConfigTab</name> <name>ConfigTab</name>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="78"/> <location filename="../qml/configqml/ConfigTab.qml" line="69"/>
<location filename="../qml/configqml/ConfigTab.qml" line="362"/> <location filename="../qml/configqml/ConfigTab.qml" line="351"/>
<location filename="../qml/configqml/ConfigTab.qml" line="384"/> <location filename="../qml/configqml/ConfigTab.qml" line="374"/>
<source>User</source> <source>User</source>
<translation>Usuario</translation> <translation>Usuario</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="105"/> <location filename="../qml/configqml/ConfigTab.qml" line="96"/>
<source>Server</source> <source>Server</source>
<translation>Servidor</translation> <translation>Servidor</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="109"/> <location filename="../qml/configqml/ConfigTab.qml" line="100"/>
<source>Nickname</source> <source>Nickname</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="114"/> <location filename="../qml/configqml/ConfigTab.qml" line="105"/>
<source>Password</source> <source>Password</source>
<translation>Contraseña</translation> <translation>Contraseña</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="118"/> <location filename="../qml/configqml/ConfigTab.qml" line="109"/>
<source>Image dir.</source> <source>Image dir.</source>
<translation>Dir. de imágenes</translation> <translation>Dir. de imágenes</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="123"/> <location filename="../qml/configqml/ConfigTab.qml" line="114"/>
<source>Max. News</source> <source>Max. News</source>
<translation> Max. de noticias.</translation> <translation> Max. de noticias.</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="127"/> <location filename="../qml/configqml/ConfigTab.qml" line="118"/>
<source>News as</source> <source>News as</source>
<translation>Noticias como</translation> <translation>Noticias como</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="131"/> <location filename="../qml/configqml/ConfigTab.qml" line="122"/>
<source>Interval (0=None)</source> <source>Interval (0=None)</source>
<translation>Intervalo (0=ningún)</translation> <translation>Intervalo (0=ningún)</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<location filename="../qml/configqml/ConfigTab.qml" line="340"/> <location filename="../qml/configqml/ConfigTab.qml" line="328"/>
<source>Error</source> <source>Error</source>
<translation type="unfinished">Error</translation> <translation type="unfinished">Error</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<source>Nickname not registered at given server!</source> <source>Nickname not registered at given server!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="301"/> <location filename="../qml/configqml/ConfigTab.qml" line="289"/>
<source>Confirm</source> <source>Confirm</source>
<translation>Confirmar</translation> <translation>Confirmar</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="305"/> <location filename="../qml/configqml/ConfigTab.qml" line="293"/>
<source>No server given! </source> <source>No server given! </source>
<translation>¡Servidor no encontrado!</translation> <translation>¡Servidor no encontrado!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="306"/> <location filename="../qml/configqml/ConfigTab.qml" line="294"/>
<source>No nickname given! </source> <source>No nickname given! </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="307"/> <location filename="../qml/configqml/ConfigTab.qml" line="295"/>
<source>Nickname not registered at given server! </source> <source>Nickname not registered at given server! </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -95,42 +95,42 @@
<translation type="vanished">¡Usuario incorrecto!</translation> <translation type="vanished">¡Usuario incorrecto!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="308"/> <location filename="../qml/configqml/ConfigTab.qml" line="296"/>
<source>No password given! </source> <source>No password given! </source>
<translation>¡Contraseña incorrecta!</translation> <translation>¡Contraseña incorrecta!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="309"/> <location filename="../qml/configqml/ConfigTab.qml" line="297"/>
<source>No image directory given!</source> <source>No image directory given!</source>
<translation>¡No se ha encontrado el directorio de imágenes!</translation> <translation>¡No se ha encontrado el directorio de imágenes!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="310"/> <location filename="../qml/configqml/ConfigTab.qml" line="298"/>
<source>No maximum news number given!</source> <source>No maximum news number given!</source>
<translation>¡ máximo de noticias incorrecto!</translation> <translation>¡ máximo de noticias incorrecto!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<source>Wrong password!</source> <source>Wrong password!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Success</source> <source>Success</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="399"/> <location filename="../qml/configqml/ConfigTab.qml" line="389"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Cronología</translation> <translation>Cronología</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="403"/> <location filename="../qml/configqml/ConfigTab.qml" line="393"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Conversaciones</translation> <translation>Conversaciones</translation>
</message> </message>
@ -189,12 +189,12 @@
<translation>Amigos</translation> <translation>Amigos</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="200"/> <location filename="../qml/contactqml/FriendsTab.qml" line="202"/>
<source>Contacts</source> <source>Contacts</source>
<translation>Contactos</translation> <translation>Contactos</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="253"/> <location filename="../qml/contactqml/FriendsTab.qml" line="259"/>
<source>Groups</source> <source>Groups</source>
<translation>Grupos</translation> <translation>Grupos</translation>
</message> </message>
@ -202,32 +202,37 @@
<context> <context>
<name>ImageUploadDialog</name> <name>ImageUploadDialog</name>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="127"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="100"/>
<source>Upload to album</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="121"/>
<source>Album</source> <source>Album</source>
<translation>álbum</translation> <translation>álbum</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="132"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="126"/>
<source>Image</source> <source>Image</source>
<translation>imagen</translation> <translation>imagen</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="137"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="131"/>
<source>Description</source> <source>Description</source>
<translation>Descripción</translation> <translation>Descripción</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="236"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="229"/>
<source>Upload</source> <source>Upload</source>
<translation>Subir</translation> <translation>Subir</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source>Error</source> <source>Error</source>
<translation>Error</translation> <translation>Error</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source> No album name given</source> <source> No album name given</source>
<translation>¡Nombre del álbum no encontrado!</translation> <translation>¡Nombre del álbum no encontrado!</translation>
</message> </message>
@ -235,17 +240,17 @@
<context> <context>
<name>MessageSend</name> <name>MessageSend</name>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="98"/> <location filename="../qml/newsqml/MessageSend.qml" line="111"/>
<source>Title (optional)</source> <source>Title (optional)</source>
<translation>Título (opcional)</translation> <translation>Título (opcional)</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Error</source> <source>Error</source>
<translation>Error</translation> <translation>Error</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Only one attachment supported at the moment. <source>Only one attachment supported at the moment.
Remove other attachment first!</source> Remove other attachment first!</source>
<translation>Solo se admite adjuntar un solo archivo en este momento. <translation>Solo se admite adjuntar un solo archivo en este momento.
@ -259,30 +264,55 @@
<translation type="vanished">Descargar la imagen del perfil para </translation> <translation type="vanished">Descargar la imagen del perfil para </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="204"/> <location filename="../qml/newsqml/NewsTab.qml" line="404"/>
<source>More</source> <source>More</source>
<translation>Mas</translation> <translation>Mas</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="301"/> <location filename="../qml/newsqml/NewsTab.qml" line="281"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Cronología</translation> <translation>Cronología</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="310"/> <location filename="../qml/newsqml/NewsTab.qml" line="63"/>
<source>Error</source>
<translation type="unfinished">Error</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="298"/>
<source>Favorites</source> <source>Favorites</source>
<translation>Favoritos</translation> <translation>Favoritos</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="322"/> <location filename="../qml/newsqml/NewsTab.qml" line="290"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Conversaciones</translation> <translation>Conversaciones</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="330"/> <location filename="../qml/newsqml/NewsTab.qml" line="306"/>
<source>Public timeline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="314"/>
<source>Direct Messages</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="321"/>
<source>Notifications</source> <source>Notifications</source>
<translation>Notificaciones</translation> <translation>Notificaciones</translation>
</message> </message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="328"/>
<source>Group news</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="332"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Newsitem</name> <name>Newsitem</name>
@ -292,77 +322,77 @@
<translation>Asistiendo: </translation> <translation>Asistiendo: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="99"/> <location filename="../qml/newsqml/Newsitem.qml" line="105"/>
<source>Source: </source> <source>Source: </source>
<translation>Fuente: </translation> <translation>Fuente: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="100"/> <location filename="../qml/newsqml/Newsitem.qml" line="106"/>
<source>Direct Message</source> <source>Direct Message</source>
<translation>Mensaje directo</translation> <translation>Mensaje directo</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="115"/> <location filename="../qml/newsqml/Newsitem.qml" line="121"/>
<source>In reply to </source> <source>In reply to </source>
<translation>En respuesta a </translation> <translation>En respuesta a </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="127"/> <location filename="../qml/newsqml/Newsitem.qml" line="133"/>
<source> comments</source> <source> comments</source>
<translation> comentarios</translation> <translation> comentarios</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="221"/> <location filename="../qml/newsqml/Newsitem.qml" line="258"/>
<source>Attending: </source> <source>Attending: </source>
<translation>Asistiendo: </translation> <translation>Asistiendo: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="343"/> <location filename="../qml/newsqml/Newsitem.qml" line="378"/>
<source>Reply</source> <source>Reply</source>
<translation>Respuesta</translation> <translation>Respuesta</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="351"/> <location filename="../qml/newsqml/Newsitem.qml" line="386"/>
<source>DM</source> <source>DM</source>
<translation>Mensaje directo</translation> <translation>Mensaje directo</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="357"/> <location filename="../qml/newsqml/Newsitem.qml" line="392"/>
<source>Repost</source> <source>Repost</source>
<translation>Volver a publicar</translation> <translation>Volver a publicar</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="360"/> <location filename="../qml/newsqml/Newsitem.qml" line="395"/>
<source>Success!</source> <source>Success!</source>
<translation>éxito!</translation> <translation>éxito!</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="365"/> <location filename="../qml/newsqml/Newsitem.qml" line="400"/>
<source>Conversation</source> <source>Conversation</source>
<translation>Conversación</translation> <translation>Conversación</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="376"/> <location filename="../qml/newsqml/Newsitem.qml" line="410"/>
<source>Attending</source> <source>Attending</source>
<translation>Asistiendo</translation> <translation>Asistiendo</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="378"/> <location filename="../qml/newsqml/Newsitem.qml" line="412"/>
<source>yes</source> <source>yes</source>
<translation>si</translation> <translation>si</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="383"/> <location filename="../qml/newsqml/Newsitem.qml" line="417"/>
<source>maybe</source> <source>maybe</source>
<translation>quizás</translation> <translation>quizás</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="388"/> <location filename="../qml/newsqml/Newsitem.qml" line="422"/>
<source>no</source> <source>no</source>
<translation>no</translation> <translation>no</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="395"/> <location filename="../qml/newsqml/Newsitem.qml" line="429"/>
<source>Delete</source> <source>Delete</source>
<translation>Borrar</translation> <translation>Borrar</translation>
</message> </message>
@ -383,28 +413,28 @@
<context> <context>
<name>PhotoTab</name> <name>PhotoTab</name>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="115"/> <location filename="../qml/photoqml/PhotoTab.qml" line="121"/>
<source>&apos;s images</source> <source>&apos;s images</source>
<translation>s Imágenes</translation> <translation>s Imágenes</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="167"/> <location filename="../qml/photoqml/PhotoTab.qml" line="178"/>
<source>All Images</source> <source>All Images</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="172"/> <location filename="../qml/photoqml/PhotoTab.qml" line="183"/>
<source>Only new</source> <source>Only new</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="186"/> <location filename="../qml/photoqml/PhotoTab.qml" line="197"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="190"/> <location filename="../qml/photoqml/PhotoTab.qml" line="201"/>
<source>Own Images</source> <source>Own Images</source>
<translation>Mis imágenes</translation> <translation>Mis imágenes</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="227"/> <location filename="../qml/photoqml/PhotoTab.qml" line="238"/>
<source>More</source> <source>More</source>
<translation>Mas</translation> <translation>Mas</translation>
</message> </message>
@ -602,32 +632,32 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="206"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="208"/>
<source>profile id</source> <source>profile id</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Description</source> <source>Description</source>
<translation type="unfinished">Descripción</translation> <translation type="unfinished">Descripción</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Location</source> <source>Location</source>
<translation type="unfinished">Localización</translation> <translation type="unfinished">Localización</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Posts</source> <source>Posts</source>
<translation type="unfinished">Mensajes</translation> <translation type="unfinished">Mensajes</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="230"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="233"/>
<source>URL</source> <source>URL</source>
<translation type="unfinished">URL</translation> <translation type="unfinished">URL</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="231"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="234"/>
<source>Created at</source> <source>Created at</source>
<translation type="unfinished">Creado en</translation> <translation type="unfinished">Creado en</translation>
</message> </message>
@ -703,27 +733,26 @@
<translation>Personas que pueden asistir.</translation> <translation>Personas que pueden asistir.</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="77"/> <location filename="../js/newsworker.js" line="78"/>
<source>yes</source> <source>yes</source>
<translation>si</translation> <translation>si</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="78"/> <location filename="../js/newsworker.js" line="79"/>
<source>no</source> <source>no</source>
<translation>no</translation> <translation>no</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="79"/> <location filename="../js/newsworker.js" line="80"/>
<source>maybe</source> <source>maybe</source>
<translation>quizás</translation> <translation>quizás</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/> <location filename="../js/newsworker.js" line="96"/>
<source>seconds</source> <source>seconds</source>
<translation>Segundos</translation> <translation>Segundos</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="96"/>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="97"/>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="98"/>
@ -733,53 +762,64 @@
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="102"/>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="103"/>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="104"/>
<location filename="../js/newsworker.js" line="105"/>
<source>ago</source> <source>ago</source>
<translation>hace</translation> <translation>hace</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="97"/>
<source>minute</source> <source>minute</source>
<translation>Minuto</translation> <translation>Minuto</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="98"/>
<source>minutes</source> <source>minutes</source>
<translation>Minutos</translation> <translation>Minutos</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="99"/>
<source>hour</source> <source>hour</source>
<translation>Hora</translation> <translation>Hora</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="99"/> <location filename="../js/newsworker.js" line="100"/>
<source>hours</source> <source>hours</source>
<translation>Horas</translation> <translation>Horas</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="100"/> <location filename="../js/newsworker.js" line="101"/>
<source>day</source> <source>day</source>
<translation>Dia</translation> <translation>Dia</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="101"/> <location filename="../js/newsworker.js" line="102"/>
<source>days</source> <source>days</source>
<translation>Dias</translation> <translation>Dias</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="103"/>
<source>month</source> <source>month</source>
<translation>Mes</translation> <translation>Mes</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="104"/>
<source>months</source> <source>months</source>
<translation>Meses</translation> <translation>Meses</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="105"/>
<source>years</source> <source>years</source>
<translation>Años</translation> <translation>Años</translation>
</message> </message>
</context> </context>
<context>
<name>service</name>
<message>
<location filename="../js/service.js" line="360"/>
<location filename="../js/service.js" line="362"/>
<location filename="../js/service.js" line="365"/>
<source>Error</source>
<translation type="unfinished">Error</translation>
</message>
</context>
</TS> </TS>

View File

@ -17,76 +17,76 @@
<context> <context>
<name>ConfigTab</name> <name>ConfigTab</name>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="78"/> <location filename="../qml/configqml/ConfigTab.qml" line="69"/>
<location filename="../qml/configqml/ConfigTab.qml" line="362"/> <location filename="../qml/configqml/ConfigTab.qml" line="351"/>
<location filename="../qml/configqml/ConfigTab.qml" line="384"/> <location filename="../qml/configqml/ConfigTab.qml" line="374"/>
<source>User</source> <source>User</source>
<translation>Utente</translation> <translation>Utente</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="105"/> <location filename="../qml/configqml/ConfigTab.qml" line="96"/>
<source>Server</source> <source>Server</source>
<translation>Server</translation> <translation>Server</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="109"/> <location filename="../qml/configqml/ConfigTab.qml" line="100"/>
<source>Nickname</source> <source>Nickname</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="114"/> <location filename="../qml/configqml/ConfigTab.qml" line="105"/>
<source>Password</source> <source>Password</source>
<translation>Password</translation> <translation>Password</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="118"/> <location filename="../qml/configqml/ConfigTab.qml" line="109"/>
<source>Image dir.</source> <source>Image dir.</source>
<translation>Directory immagini</translation> <translation>Directory immagini</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="123"/> <location filename="../qml/configqml/ConfigTab.qml" line="114"/>
<source>Max. News</source> <source>Max. News</source>
<translation> Max. di notizie</translation> <translation> Max. di notizie</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="127"/> <location filename="../qml/configqml/ConfigTab.qml" line="118"/>
<source>News as</source> <source>News as</source>
<translation>News come</translation> <translation>News come</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="131"/> <location filename="../qml/configqml/ConfigTab.qml" line="122"/>
<source>Interval (0=None)</source> <source>Interval (0=None)</source>
<translation>Intervallo (0=nessuno)</translation> <translation>Intervallo (0=nessuno)</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<location filename="../qml/configqml/ConfigTab.qml" line="340"/> <location filename="../qml/configqml/ConfigTab.qml" line="328"/>
<source>Error</source> <source>Error</source>
<translation type="unfinished">Errore</translation> <translation type="unfinished">Errore</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<source>Nickname not registered at given server!</source> <source>Nickname not registered at given server!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="301"/> <location filename="../qml/configqml/ConfigTab.qml" line="289"/>
<source>Confirm</source> <source>Confirm</source>
<translation>Conferma</translation> <translation>Conferma</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="305"/> <location filename="../qml/configqml/ConfigTab.qml" line="293"/>
<source>No server given! </source> <source>No server given! </source>
<translation>Nessun server inserito!</translation> <translation>Nessun server inserito!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="306"/> <location filename="../qml/configqml/ConfigTab.qml" line="294"/>
<source>No nickname given! </source> <source>No nickname given! </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="307"/> <location filename="../qml/configqml/ConfigTab.qml" line="295"/>
<source>Nickname not registered at given server! </source> <source>Nickname not registered at given server! </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -95,42 +95,42 @@
<translation type="vanished">Nessun utente inserito!</translation> <translation type="vanished">Nessun utente inserito!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="308"/> <location filename="../qml/configqml/ConfigTab.qml" line="296"/>
<source>No password given! </source> <source>No password given! </source>
<translation>Nessuna password inserita!</translation> <translation>Nessuna password inserita!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="309"/> <location filename="../qml/configqml/ConfigTab.qml" line="297"/>
<source>No image directory given!</source> <source>No image directory given!</source>
<translation>Nessuna directory immagini inserita!</translation> <translation>Nessuna directory immagini inserita!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="310"/> <location filename="../qml/configqml/ConfigTab.qml" line="298"/>
<source>No maximum news number given!</source> <source>No maximum news number given!</source>
<translation>Nessun numero massimo di news inserito!</translation> <translation>Nessun numero massimo di news inserito!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<source>Wrong password!</source> <source>Wrong password!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Success</source> <source>Success</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="399"/> <location filename="../qml/configqml/ConfigTab.qml" line="389"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Cronologia</translation> <translation>Cronologia</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="403"/> <location filename="../qml/configqml/ConfigTab.qml" line="393"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Conversazioni</translation> <translation>Conversazioni</translation>
</message> </message>
@ -189,12 +189,12 @@
<translation>Amici</translation> <translation>Amici</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="200"/> <location filename="../qml/contactqml/FriendsTab.qml" line="202"/>
<source>Contacts</source> <source>Contacts</source>
<translation>Contatti</translation> <translation>Contatti</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="253"/> <location filename="../qml/contactqml/FriendsTab.qml" line="259"/>
<source>Groups</source> <source>Groups</source>
<translation>Gruppi</translation> <translation>Gruppi</translation>
</message> </message>
@ -202,32 +202,37 @@
<context> <context>
<name>ImageUploadDialog</name> <name>ImageUploadDialog</name>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="127"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="100"/>
<source>Upload to album</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="121"/>
<source>Album</source> <source>Album</source>
<translation>Album</translation> <translation>Album</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="132"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="126"/>
<source>Image</source> <source>Image</source>
<translation>Immagine</translation> <translation>Immagine</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="137"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="131"/>
<source>Description</source> <source>Description</source>
<translation>Descrizione</translation> <translation>Descrizione</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="236"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="229"/>
<source>Upload</source> <source>Upload</source>
<translation>Carica</translation> <translation>Carica</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source>Error</source> <source>Error</source>
<translation>Errore</translation> <translation>Errore</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source> No album name given</source> <source> No album name given</source>
<translation>Nessun nome album inserito!</translation> <translation>Nessun nome album inserito!</translation>
</message> </message>
@ -235,17 +240,17 @@
<context> <context>
<name>MessageSend</name> <name>MessageSend</name>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="98"/> <location filename="../qml/newsqml/MessageSend.qml" line="111"/>
<source>Title (optional)</source> <source>Title (optional)</source>
<translation>Titolo (opzionale)</translation> <translation>Titolo (opzionale)</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Error</source> <source>Error</source>
<translation>Errore</translation> <translation>Errore</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Only one attachment supported at the moment. <source>Only one attachment supported at the moment.
Remove other attachment first!</source> Remove other attachment first!</source>
<translation>Solo un allegato è attualmente supportato. <translation>Solo un allegato è attualmente supportato.
@ -259,30 +264,55 @@
<translation type="vanished">Download immagine profilo per </translation> <translation type="vanished">Download immagine profilo per </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="204"/> <location filename="../qml/newsqml/NewsTab.qml" line="404"/>
<source>More</source> <source>More</source>
<translation>Ancora</translation> <translation>Ancora</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="301"/> <location filename="../qml/newsqml/NewsTab.qml" line="281"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Cronologia</translation> <translation>Cronologia</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="310"/> <location filename="../qml/newsqml/NewsTab.qml" line="63"/>
<source>Error</source>
<translation type="unfinished">Errore</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="298"/>
<source>Favorites</source> <source>Favorites</source>
<translation>Favoriti</translation> <translation>Favoriti</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="322"/> <location filename="../qml/newsqml/NewsTab.qml" line="290"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Conversazioni</translation> <translation>Conversazioni</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="330"/> <location filename="../qml/newsqml/NewsTab.qml" line="306"/>
<source>Public timeline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="314"/>
<source>Direct Messages</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="321"/>
<source>Notifications</source> <source>Notifications</source>
<translation>Notifiche</translation> <translation>Notifiche</translation>
</message> </message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="328"/>
<source>Group news</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="332"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Newsitem</name> <name>Newsitem</name>
@ -292,77 +322,77 @@
<translation>attendere: </translation> <translation>attendere: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="99"/> <location filename="../qml/newsqml/Newsitem.qml" line="105"/>
<source>Source: </source> <source>Source: </source>
<translation>Codice: </translation> <translation>Codice: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="100"/> <location filename="../qml/newsqml/Newsitem.qml" line="106"/>
<source>Direct Message</source> <source>Direct Message</source>
<translation>Messaggio diretto</translation> <translation>Messaggio diretto</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="115"/> <location filename="../qml/newsqml/Newsitem.qml" line="121"/>
<source>In reply to </source> <source>In reply to </source>
<translation>In risposta a </translation> <translation>In risposta a </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="127"/> <location filename="../qml/newsqml/Newsitem.qml" line="133"/>
<source> comments</source> <source> comments</source>
<translation> commenti</translation> <translation> commenti</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="221"/> <location filename="../qml/newsqml/Newsitem.qml" line="258"/>
<source>Attending: </source> <source>Attending: </source>
<translation>Attendi: </translation> <translation>Attendi: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="343"/> <location filename="../qml/newsqml/Newsitem.qml" line="378"/>
<source>Reply</source> <source>Reply</source>
<translation>Risposta</translation> <translation>Risposta</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="351"/> <location filename="../qml/newsqml/Newsitem.qml" line="386"/>
<source>DM</source> <source>DM</source>
<translation>Messaggio diretto</translation> <translation>Messaggio diretto</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="357"/> <location filename="../qml/newsqml/Newsitem.qml" line="392"/>
<source>Repost</source> <source>Repost</source>
<translation>Condividi</translation> <translation>Condividi</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="360"/> <location filename="../qml/newsqml/Newsitem.qml" line="395"/>
<source>Success!</source> <source>Success!</source>
<translation>Ha funzionato!</translation> <translation>Ha funzionato!</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="365"/> <location filename="../qml/newsqml/Newsitem.qml" line="400"/>
<source>Conversation</source> <source>Conversation</source>
<translation>Conversazione</translation> <translation>Conversazione</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="376"/> <location filename="../qml/newsqml/Newsitem.qml" line="410"/>
<source>Attending</source> <source>Attending</source>
<translation>Attendi</translation> <translation>Attendi</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="378"/> <location filename="../qml/newsqml/Newsitem.qml" line="412"/>
<source>yes</source> <source>yes</source>
<translation>si</translation> <translation>si</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="383"/> <location filename="../qml/newsqml/Newsitem.qml" line="417"/>
<source>maybe</source> <source>maybe</source>
<translation>potrebbe</translation> <translation>potrebbe</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="388"/> <location filename="../qml/newsqml/Newsitem.qml" line="422"/>
<source>no</source> <source>no</source>
<translation>no</translation> <translation>no</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="395"/> <location filename="../qml/newsqml/Newsitem.qml" line="429"/>
<source>Delete</source> <source>Delete</source>
<translation>Cancella</translation> <translation>Cancella</translation>
</message> </message>
@ -383,28 +413,28 @@
<context> <context>
<name>PhotoTab</name> <name>PhotoTab</name>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="115"/> <location filename="../qml/photoqml/PhotoTab.qml" line="121"/>
<source>&apos;s images</source> <source>&apos;s images</source>
<translation> Immagini</translation> <translation> Immagini</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="167"/> <location filename="../qml/photoqml/PhotoTab.qml" line="178"/>
<source>All Images</source> <source>All Images</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="172"/> <location filename="../qml/photoqml/PhotoTab.qml" line="183"/>
<source>Only new</source> <source>Only new</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="186"/> <location filename="../qml/photoqml/PhotoTab.qml" line="197"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="190"/> <location filename="../qml/photoqml/PhotoTab.qml" line="201"/>
<source>Own Images</source> <source>Own Images</source>
<translation>Mie immagini</translation> <translation>Mie immagini</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="227"/> <location filename="../qml/photoqml/PhotoTab.qml" line="238"/>
<source>More</source> <source>More</source>
<translation>Ancora</translation> <translation>Ancora</translation>
</message> </message>
@ -602,32 +632,32 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="206"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="208"/>
<source>profile id</source> <source>profile id</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Description</source> <source>Description</source>
<translation type="unfinished">Descrizione</translation> <translation type="unfinished">Descrizione</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Location</source> <source>Location</source>
<translation type="unfinished">Località</translation> <translation type="unfinished">Località</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Posts</source> <source>Posts</source>
<translation type="unfinished">Messaggi</translation> <translation type="unfinished">Messaggi</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="230"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="233"/>
<source>URL</source> <source>URL</source>
<translation type="unfinished">URL</translation> <translation type="unfinished">URL</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="231"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="234"/>
<source>Created at</source> <source>Created at</source>
<translation type="unfinished">Creato il</translation> <translation type="unfinished">Creato il</translation>
</message> </message>
@ -703,27 +733,26 @@
<translation>Persone che possono attendere.</translation> <translation>Persone che possono attendere.</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="77"/> <location filename="../js/newsworker.js" line="78"/>
<source>yes</source> <source>yes</source>
<translation>si</translation> <translation>si</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="78"/> <location filename="../js/newsworker.js" line="79"/>
<source>no</source> <source>no</source>
<translation>no</translation> <translation>no</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="79"/> <location filename="../js/newsworker.js" line="80"/>
<source>maybe</source> <source>maybe</source>
<translation>potrebbe</translation> <translation>potrebbe</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/> <location filename="../js/newsworker.js" line="96"/>
<source>seconds</source> <source>seconds</source>
<translation>secondi</translation> <translation>secondi</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="96"/>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="97"/>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="98"/>
@ -733,53 +762,64 @@
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="102"/>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="103"/>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="104"/>
<location filename="../js/newsworker.js" line="105"/>
<source>ago</source> <source>ago</source>
<translation>fa</translation> <translation>fa</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="97"/>
<source>minute</source> <source>minute</source>
<translation>minuti</translation> <translation>minuti</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="98"/>
<source>minutes</source> <source>minutes</source>
<translation>minuti</translation> <translation>minuti</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="99"/>
<source>hour</source> <source>hour</source>
<translation>ora</translation> <translation>ora</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="99"/> <location filename="../js/newsworker.js" line="100"/>
<source>hours</source> <source>hours</source>
<translation>ore</translation> <translation>ore</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="100"/> <location filename="../js/newsworker.js" line="101"/>
<source>day</source> <source>day</source>
<translation>giorno</translation> <translation>giorno</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="101"/> <location filename="../js/newsworker.js" line="102"/>
<source>days</source> <source>days</source>
<translation>giorni</translation> <translation>giorni</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="103"/>
<source>month</source> <source>month</source>
<translation>mese</translation> <translation>mese</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="104"/>
<source>months</source> <source>months</source>
<translation>mesi</translation> <translation>mesi</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="105"/>
<source>years</source> <source>years</source>
<translation>anni</translation> <translation>anni</translation>
</message> </message>
</context> </context>
<context>
<name>service</name>
<message>
<location filename="../js/service.js" line="360"/>
<location filename="../js/service.js" line="362"/>
<location filename="../js/service.js" line="365"/>
<source>Error</source>
<translation type="unfinished">Errore</translation>
</message>
</context>
</TS> </TS>

View File

@ -217,5 +217,9 @@
<file>js/image.js</file> <file>js/image.js</file>
<file>qml/contactqml/ProfileComponent.qml</file> <file>qml/contactqml/ProfileComponent.qml</file>
<file>translations/friendiqa-it.ts</file> <file>translations/friendiqa-it.ts</file>
<file>qml/genericqml/Search.qml</file>
<file>qml/newsqml/Hashtag.qml</file>
<file>qml/genericqml/IntentReceiver.qml</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -73,6 +73,10 @@ QString FILESYSTEM::homePath() const
// return dir.exists(); // return dir.exists();
//} //}
bool FILESYSTEM::fileexist(QString name)
{ return QFile::exists(name);
}
void FILESYSTEM::makeDir(QString name) void FILESYSTEM::makeDir(QString name)
{ {
QDir dir(m_Directory); QDir dir(m_Directory);

View File

@ -65,6 +65,7 @@ signals:
void error(QString data, int code); void error(QString data, int code);
public slots: public slots:
bool fileexist(QString name);
void makeDir(QString name); void makeDir(QString name);
void rmDir(); void rmDir();
void rmFile(QString name); void rmFile(QString name);

View File

@ -59,6 +59,14 @@ void XHR::setUrl(QString url)
} }
} }
void XHR::setApi(QString api)
{
if (api!=m_api) {
m_api = api;
emit apiChanged();
}
}
void XHR::setLogin(QString login) void XHR::setLogin(QString login)
{ {
if (login!=m_login) { if (login!=m_login) {
@ -111,6 +119,11 @@ QString XHR::url() const
return m_url; return m_url;
} }
QString XHR::api() const
{
return m_api;
}
QString XHR::login() const QString XHR::login() const
{ {
return m_login; return m_login;
@ -166,6 +179,7 @@ void XHR::download()
request.setRawHeader("Authorization", headerData.toLocal8Bit()); request.setRawHeader("Authorization", headerData.toLocal8Bit());
} }
request.setUrl(requrl); request.setUrl(requrl);
//qDebug() << requrl;
reply = manager.get(request); reply = manager.get(request);
reply->ignoreSslErrors(); reply->ignoreSslErrors();
connect(reply, &QNetworkReply::readyRead,this, &XHR::onReadyRead); connect(reply, &QNetworkReply::readyRead,this, &XHR::onReadyRead);
@ -185,9 +199,9 @@ void XHR::get()
query.addQueryItem(i.key(), i.value()); query.addQueryItem(i.key(), i.value());
} }
QUrl requrl(m_url); QUrl requrl(m_url+m_api);
//qDebug() << requrl;
requrl.setQuery(query); requrl.setQuery(query);
QByteArray loginData = m_login.toLocal8Bit().toBase64(); QByteArray loginData = m_login.toLocal8Bit().toBase64();
QString headerData = "Basic " + loginData; QString headerData = "Basic " + loginData;
request.setRawHeader("Authorization", headerData.toLocal8Bit()); request.setRawHeader("Authorization", headerData.toLocal8Bit());
@ -250,7 +264,7 @@ void XHR::post()
QString headerData = "Basic " + loginData; QString headerData = "Basic " + loginData;
request.setRawHeader(QByteArray("Authorization"), headerData.toLocal8Bit()); request.setRawHeader(QByteArray("Authorization"), headerData.toLocal8Bit());
request.setUrl(m_url); request.setUrl(m_url+m_api);
reply = manager.post(request, multiPart); reply = manager.post(request, multiPart);
qDebug() << "\t request sent"; qDebug() << "\t request sent";
connect(reply, &QNetworkReply::finished, this, &XHR::onReplySuccess); connect(reply, &QNetworkReply::finished, this, &XHR::onReplySuccess);
@ -263,7 +277,7 @@ void XHR::post()
void XHR::onReplyError(QNetworkReply::NetworkError code) void XHR::onReplyError(QNetworkReply::NetworkError code)
{ {
qDebug() << code; qDebug() << code;
emit this->error( bufferToString(), m_url, (int) code); emit this->error( bufferToString(), m_url,m_api, (int) code);
buffer.clear(); buffer.clear();
reply->deleteLater(); reply->deleteLater();
} }
@ -271,7 +285,7 @@ void XHR::onReplyError(QNetworkReply::NetworkError code)
void XHR::onReplySuccess() void XHR::onReplySuccess()
{ {
qDebug() << "!"; qDebug() << "!";
emit this->success( bufferToString() ); emit this->success( bufferToString(), m_api);
buffer.clear(); buffer.clear();
// reply->deleteLater(); // reply->deleteLater();
} }
@ -279,7 +293,7 @@ void XHR::onReplySuccess()
void XHR::onRequestFinished() void XHR::onRequestFinished()
{ {
// Save the file here // Save the file here
if (buffer.isNull()){qDebug() << "File empty"<<m_url; buffer.clear(); emit this->error(m_downloadtype,m_url,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);
QJsonObject jsonObject = jsonResponse.object(); QJsonObject jsonObject = jsonResponse.object();

View File

@ -56,6 +56,7 @@ public:
explicit XHR(QObject *parent = 0); explicit XHR(QObject *parent = 0);
QString url() const; QString url() const;
QString api() const;
QString login() const; QString login() const;
QString filename() const; QString filename() const;
QList<QString> contactlist() const; QList<QString> contactlist() const;
@ -65,6 +66,7 @@ public:
signals: signals:
void urlChanged(); void urlChanged();
void apiChanged();
void loginChanged(); void loginChanged();
void filenameChanged(); void filenameChanged();
void contactlistChanged(); void contactlistChanged();
@ -73,11 +75,12 @@ signals:
void downloadtypeChanged(); void downloadtypeChanged();
void downloaded(QString type, QString url, QString filename, int i); void downloaded(QString type, QString url, QString filename, int i);
void downloadedjson(QString type, QString url, QString filename, int i,QJsonObject jsonObject); void downloadedjson(QString type, QString url, QString filename, int i,QJsonObject jsonObject);
void success(QString data); void success(QString data, QString api);
void error(QString data, QString url, int code); void error(QString data, QString url,QString api, int code);
public slots: public slots:
void setUrl(QString url); void setUrl(QString url);
void setApi(QString api);
void setLogin(QString login); void setLogin(QString login);
void setDownloadtype(QString downloadtype); void setDownloadtype(QString downloadtype);
void setFilename(QString filename); void setFilename(QString filename);
@ -103,6 +106,7 @@ private slots:
private: private:
QByteArray buffer; QByteArray buffer;
QString m_url; QString m_url;
QString m_api;
QString m_login; QString m_login;
QString m_filename; QString m_filename;
QString m_downloadtype; QString m_downloadtype;

View File

@ -51,3 +51,4 @@ DISTFILES += \
qml/photoqml/*.qml \ qml/photoqml/*.qml \
qml/configqml/*.qml \ qml/configqml/*.qml \
js/*.js \ js/*.js \
qml/newsqml/Hashtag.qml

View File

@ -37,7 +37,7 @@ function friendicaRequest(login,api,rootwindow,callback) {
xhrequest.onreadystatechange = function() { xhrequest.onreadystatechange = function() {
if(xhrequest.readyState === XMLHttpRequest.DONE) { if(xhrequest.readyState === XMLHttpRequest.DONE) {
try{ try{
if (xhrequest.status=200){ if (xhrequest.status==200){
callback(xhrequest.responseText) callback(xhrequest.responseText)
}else{ }else{
showMessage("Error","API:\n" +login.server+api+"\n NO RESPONSE"+xhrequest.statusText,rootwindow); showMessage("Error","API:\n" +login.server+api+"\n NO RESPONSE"+xhrequest.statusText,rootwindow);
@ -65,7 +65,7 @@ function friendicaPostRequest(login,api,data,method,rootwindow,callback) {
callback(xhrequest.responseText) callback(xhrequest.responseText)
} }
} }
catch (e){showMessage("Error", "API:\n" + +api+" "+e+"\n Return:"+xhrequest.responseText,rootwindow)} catch (e){showMessage("Error", "API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText,rootwindow)}
} }
} }
xhrequest.open(method, login.server+api,true,login.username,Qt.atob(login.password)); xhrequest.open(method, login.server+api,true,login.username,Qt.atob(login.password));
@ -151,7 +151,7 @@ var where = " AND "+ filter +" = '" + filtervalue+"'";
}); });
} }
function showMessage(header,message,rootwindow){//print("message: "+message); function showMessage(header,message,rootwindow){print("message: "+message);
var cleanmessage=message.replace(/"/g,"-"); //print(cleanmessage); var cleanmessage=message.replace(/"/g,"-"); //print(cleanmessage);
if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'} if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
var messageString='import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:"'+header+'";standardButtons: StandardButton.Ok; text:" '+cleanmessage+'"}'; var messageString='import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:"'+header+'";standardButtons: StandardButton.Ok; text:" '+cleanmessage+'"}';

View File

@ -38,7 +38,7 @@ function requestFriends(login,database,rootwindow,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('UPDATE contacts SET isFriend=0 where username="'+login.username+'"')}); // clean old friends var result = tx.executeSql('UPDATE contacts SET isFriend=0 where username="'+login.username+'"')}); // clean old friends
Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){ Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){
var friends=JSON.parse(obj); var friends=JSON.parse(obj);
for (var i=0;i<friends.length;i++){ friends[i].isFriend=1} for (var i=0;i<friends.length;i++){ friends[i].isFriend=1}
//try{requestProfile(login,friends,rootwindow,function(friends_profile){callback(friends_profile)})} //try{requestProfile(login,friends,rootwindow,function(friends_profile){callback(friends_profile)})}
@ -47,8 +47,6 @@ function requestFriends(login,database,rootwindow,callback){
}); });
} }
function requestGroups(login,database,rootwindow,callback){ function requestGroups(login,database,rootwindow,callback){
// retrieve, save and return groups. Other features currently not implemented // retrieve, save and return groups. Other features currently not implemented
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
@ -87,23 +85,34 @@ function deleteGroup(login,database,rootwindow,group, callback){
}); });
}})} }})}
function getLastNews(login,database){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var lastnewsid=0;
db.transaction( function(tx) {
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1');
try{lastnewsid=result.rows.item(0).status_id;}catch(e){};
return lastnewsid
})
}
function getFriendsTimeline(login,database,contacts,onlynew,rootwindow,callback){
// retrieve and return timeline since last news, return contacts which are not friends and older than 2 days for update (friends can be updated in Contactstab)
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); //function getFriendsTimeline(login,database,contacts,onlynew,rootwindow,callback){
var parameter = "?count=50"; // // retrieve and return timeline since last news, return contacts which are not friends and older than 2 days for update (friends can be updated in Contactstab)
if(onlynew){db.transaction( function(tx) { // var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1'); // check for last news id // var parameter = "?count=50";
try{parameter=parameter+"&since_id="+result.rows.item(0).status_id;}catch(e){};})} // if(onlynew){db.transaction( function(tx) {
var newContacts=[]; // var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1'); // check for last news id
Helperjs.friendicaRequest(login,"/api/statuses/friends_timeline"+parameter, rootwindow,function (obj){ // try{parameter=parameter+"&since_id="+result.rows.item(0).status_id;}catch(e){};})}
var news=JSON.parse(obj); // var newContacts=[];
if (news.hasOwnProperty('status')){ // Helperjs.friendicaRequest(login,"/api/statuses/friends_timeline"+parameter, rootwindow,function (obj){
Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+"/api/statuses/friends_timeline"+parameter+"\n Return: \n"+obj,rootwindow) // var news=JSON.parse(obj);
} // if (news.hasOwnProperty('status')){
var newContacts=findNewContacts(news,contacts); // Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+"/api/statuses/friends_timeline"+parameter+"\n Return: \n"+obj,rootwindow)
callback(news,newContacts) // }
})} // var newContacts=findNewContacts(news,contacts);
// callback(news,newContacts)
//})}
function getCurrentContacts(login,database,callback){ function getCurrentContacts(login,database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
@ -121,7 +130,7 @@ function getCurrentContacts(login,database,callback){
contactlist.push(result2.rows.item(j).url ) contactlist.push(result2.rows.item(j).url )
} }
}) })
callback(contactlist) callback(contactlist)
} }
function findNewContacts(news,contacts){ function findNewContacts(news,contacts){
@ -132,7 +141,7 @@ function findNewContacts(news,contacts){
news[i].user.isFriend=0; news[i].user.isFriend=0;
newContacts.push(news[i].user); newContacts.push(news[i].user);
} }
if (news[i].friendica_activities.like.length>0){ if (news[i].hasOwnProperty('friendica_activities') && news[i].friendica_activities.like.length>0){
for (var j=0;j<news[i].friendica_activities.like.length;j++){ for (var j=0;j<news[i].friendica_activities.like.length;j++){
var like_url=news[i].friendica_activities.like[j].url; var like_url=news[i].friendica_activities.like[j].url;
if(contacts.indexOf(like_url)==-1 && !(inArray(newContacts,"url",like_url))){ if(contacts.indexOf(like_url)==-1 && !(inArray(newContacts,"url",like_url))){
@ -141,7 +150,7 @@ function findNewContacts(news,contacts){
} }
} }
} }
if (news[i].friendica_activities.dislike.length>0){ if (news[i].hasOwnProperty('friendica_activities') && news[i].friendica_activities.dislike.length>0){
for (var k=0;j<news[k].friendica_activities.dislike.length;k++){ for (var k=0;j<news[k].friendica_activities.dislike.length;k++){
var dislike_url=news[i].friendica_activities.dislike[k].url; var dislike_url=news[i].friendica_activities.dislike[k].url;
if(contacts.indexOf(dislike_url)==-1 && !(inArray(newContacts,"url",dislike_url))){ if(contacts.indexOf(dislike_url)==-1 && !(inArray(newContacts,"url",dislike_url))){
@ -151,118 +160,123 @@ function findNewContacts(news,contacts){
} }
} }
var owner_url=news[i].friendica_owner.url; if(news[i].hasOwnProperty('friendica_owner')){
if(contacts.indexOf(owner_url)==-1 && !(inArray(newContacts,"url",owner_url))){ var owner_url=news[i].friendica_owner.url;
news[i].friendica_owner.isFriend=0; if(contacts.indexOf(owner_url)==-1 && !(inArray(newContacts,"url",owner_url))){
newContacts.push(news[i].friendica_owner); news[i].friendica_owner.isFriend=0;
} newContacts.push(news[i].friendica_owner);
}
}
} }
return newContacts return newContacts
} }
function storeNews(login,database,news,rootwindow,callback){ function storeNews(login,database,news,rootwindow){
// save news after contacts download, call next function // save news after contacts download, call next function
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
for (var i=0;i<news.length;i++){ for (var i=0;i<news.length;i++){
//print('store news data for ' + news[i].id+JSON.stringify(news[i].friendica_activities)); //print('store news data for ' + news[i].id+JSON.stringify(news[i].friendica_activities));
//var ausdruck=news[i]; //var ausdruck=news[i];
var likearray=[]; for (var user in news[i].friendica_activities.like){likearray.push(news[i].friendica_activities.like[user].url)} var likearray=[];var dislikearray=[];var attendyesarray=[];var attendnoarray=[];var attendmaybearray=[];
var dislikearray=[]; for (var user in news[i].friendica_activities.dislike){dislikearray.push(news[i].friendica_activities.dislike[user].url)} if(news[i].hasOwnProperty('friendica_activities')){
var attendyesarray=[]; for (var user in news[i].friendica_activities.attendyes){attendyesarray.push(news[i].friendica_activities.attendyes[user].url)} for (var user in news[i].friendica_activities.like){likearray.push(news[i].friendica_activities.like[user].url)}
var attendnoarray=[]; for (var user in news[i].friendica_activities.attendno){attendnoarray.push(news[i].friendica_activities.attendno[user].url)} for (var user in news[i].friendica_activities.dislike){dislikearray.push(news[i].friendica_activities.dislike[user].url)}
var attendmaybearray=[]; for (var user in news[i].friendica_activities.attendmaybe){attendmaybearray.push(news[i].friendica_activities.attendmaybe[user].url)} for (var user in news[i].friendica_activities.attendyes){attendyesarray.push(news[i].friendica_activities.attendyes[user].url)}
for (var user in news[i].friendica_activities.attendno){attendnoarray.push(news[i].friendica_activities.attendno[user].url)}
for (var user in news[i].friendica_activities.attendmaybe){attendmaybearray.push(news[i].friendica_activities.attendmaybe[user].url)}
}
var friendica_activities=[likearray,dislikearray,attendyesarray,attendnoarray,attendmaybearray] var friendica_activities=[likearray,dislikearray,attendyesarray,attendnoarray,attendmaybearray]
var attachments="";if (news[i].attachments){attachments=Qt.btoa(JSON.stringify(news[i].attachments))} var attachments="";if (news[i].attachments){attachments=Qt.btoa(JSON.stringify(news[i].attachments))}
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+news[i].id+'" AND messagetype=0'); // check for news id var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+news[i].id+'" AND messagetype=0'); // check for news id
if(result.rows.length === 1) {// use update if(result.rows.length === 1) {// use update
//print(news[i].id +' news exists, update it'+'UPDATE news SET username="'+login.username+'", messagetype=0, text="'+Qt.btoa(news[i].text)+'", created_at="'+Date.parse(cleanDate(news[i].created_at))+'", in_reply_to_status_id="'+news[i].in_reply_to_status_id+'", source="'+news[i].source+'", status_id="'+news[i].id+'", in_reply_to_user_id="'+news[i].in_reply_to_user_id+'", geo="'+news[i].geo+'", favorited="'+news[i].favorited+'", uid="'+news[i].user.id+'", statusnet_html="'+Qt.btoa(news[i].status_html)+'", statusnet_conversation_id="'+news[i].statusnet_conversation_id+'",friendica_activities="'+Qt.btoa(JSON.stringify(friendica_activities))+'",attachments="'+attachments+'",friendica_owner="'+news[i].friendica_owner.url+'" where username="'+login.username+'" AND status_id="'+news[i].status_id+'" AND messagetype=0') //print(news[i].id +' news exists, update it'+'UPDATE news SET username="'+login.username+'", messagetype=0, text="'+Qt.btoa(news[i].text)+'", created_at="'+Date.parse(cleanDate(news[i].created_at))+'", in_reply_to_status_id="'+news[i].in_reply_to_status_id+'", source="'+news[i].source+'", status_id="'+news[i].id+'", in_reply_to_user_id="'+news[i].in_reply_to_user_id+'", geo="'+news[i].geo+'", favorited="'+news[i].favorited+'", uid="'+news[i].user.id+'", statusnet_html="'+Qt.btoa(news[i].status_html)+'", statusnet_conversation_id="'+news[i].statusnet_conversation_id+'",friendica_activities="'+Qt.btoa(JSON.stringify(friendica_activities))+'",attachments="'+attachments+'",friendica_owner="'+news[i].friendica_owner.url+'" where username="'+login.username+'" AND status_id="'+news[i].status_id+'" AND messagetype=0')
result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=0, text="'+Qt.btoa(news[i].text)+'", created_at="'+Date.parse(cleanDate(news[i].created_at))+'", in_reply_to_status_id="'+news[i].in_reply_to_status_id+'", source="'+news[i].source+'", status_id="'+news[i].id+'", in_reply_to_user_id="'+news[i].in_reply_to_user_id+'", geo="'+news[i].geo+'", favorited="'+news[i].favorited+'", uid="'+news[i].user.id+'", statusnet_html="'+Qt.btoa(news[i].status_html)+'", statusnet_conversation_id="'+news[i].statusnet_conversation_id+'",friendica_activities="'+Qt.btoa(JSON.stringify(friendica_activities))+'",attachments="'+attachments+'",friendica_owner="'+news[i].friendica_owner.url+'" where username="'+login.username+'" AND status_id="'+news[i].status_id+'" AND messagetype=0'); result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=0, text="'+Qt.btoa(news[i].text)+'", created_at="'+news[i].created_at+'", in_reply_to_status_id="'+news[i].in_reply_to_status_id+'", source="'+news[i].source+'", status_id="'+news[i].id+'", in_reply_to_user_id="'+news[i].in_reply_to_user_id+'", geo="'+news[i].geo+'", favorited="'+news[i].favorited+'", uid="'+news[i].user.id+'", statusnet_html="'+Qt.btoa(news[i].status_html)+'", statusnet_conversation_id="'+news[i].statusnet_conversation_id+'",friendica_activities="'+Qt.btoa(JSON.stringify(friendica_activities))+'",attachments="'+attachments+'",friendica_owner="'+news[i].friendica_owner.url+'" where username="'+login.username+'" AND status_id="'+news[i].status_id+'" AND messagetype=0');
} else {// use insert } else {// use insert
result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,in_reply_to_status_id,source,status_id,in_reply_to_user_id,geo,favorited,uid,statusnet_html,statusnet_conversation_id,friendica_activities,friendica_activities_self,attachments,friendica_owner) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,0,Qt.btoa(news[i].text),Date.parse(cleanDate(news[i].created_at)), news[i].in_reply_to_status_id, news[i].source, news[i].id,news[i].in_reply_to_user_id,news[i].geo,news[i].favorited, news[i].user.id,Qt.btoa(news[i].statusnet_html),news[i].statusnet_conversation_id, Qt.btoa(JSON.stringify(friendica_activities)),"[]",attachments,news[i].friendica_owner.url])}}) result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,in_reply_to_status_id,source,status_id,in_reply_to_user_id,geo,favorited,uid,statusnet_html,statusnet_conversation_id,friendica_activities,friendica_activities_self,attachments,friendica_owner) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,0,Qt.btoa(news[i].text),news[i].created_at, news[i].in_reply_to_status_id, news[i].source, news[i].id,news[i].in_reply_to_user_id,news[i].geo,news[i].favorited, news[i].user.id,Qt.btoa(news[i].statusnet_html),news[i].statusnet_conversation_id, Qt.btoa(JSON.stringify(friendica_activities)),"[]",attachments,news[i].friendica_owner.url])}})
} }
getDirectMessage(login,database,rootwindow,callback) // getDirectMessage(login,database,rootwindow,callback)
} }
function getDirectMessage(login,database,rootwindow,callback){ //function getDirectMessage(login,database,rootwindow,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); // var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var parameter = ""; // var parameter = "";
db.transaction( function(tx) { // db.transaction( function(tx) {
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=1 ORDER BY status_id DESC LIMIT 1'); // check for last news id // var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=1 ORDER BY status_id DESC LIMIT 1'); // check for last news id
try{parameter="&since_id="+result.rows.item(0).status_id;}catch(e){};}) // try{parameter="&since_id="+result.rows.item(0).status_id;}catch(e){};})
Helperjs.friendicaRequest(login,"/api/direct_messages/all"+parameter,rootwindow, function (obj){ // Helperjs.friendicaRequest(login,"/api/direct_messages/all"+parameter,rootwindow, function (obj){
var messages=JSON.parse(obj); // var messages=JSON.parse(obj);
for (var i=0;i<messages.length;i++){ // for (var i=0;i<messages.length;i++){
//print('store message data for '+JSON.stringify(messages[i])); // //print('store message data for '+JSON.stringify(messages[i]));
db.transaction( function(tx) { // db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from news where username= "'+login.username+'" AND status_id = "'+messages[i].id+'" AND messagetype=1'); // check for news id // var result = tx.executeSql('SELECT * from news where username= "'+login.username+'" AND status_id = "'+messages[i].id+'" AND messagetype=1'); // check for news id
if(result.rows.length === 1) {// use update // if(result.rows.length === 1) {// use update
print(messages[i].id +' directmessage exists, update it') // print(messages[i].id +' directmessage exists, update it')
result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=1, text="'+Qt.btoa(messages[i].text)+'", created_at="'+Date.parse(cleanDate(messages[i].created_at))+'", source="Friendica", status_id="'+messages[i].id+'", uid="'+messages[i].sender.id+'", statusnet_html="'+Qt.btoa(messages[i].text)+'", statusnet_conversation_id="'+messages[i].friendica_parent_uri+'" where username="'+login.username+'" AND status_id="'+messages[i].status_id+'" AND messagetype=1'); // result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=1, text="'+Qt.btoa(messages[i].text)+'", created_at="'+Date.parse(cleanDate(messages[i].created_at))+'", source="Friendica", status_id="'+messages[i].id+'", uid="'+messages[i].sender.id+'", statusnet_html="'+Qt.btoa(messages[i].text)+'", statusnet_conversation_id="'+messages[i].friendica_parent_uri+'" where username="'+login.username+'" AND status_id="'+messages[i].status_id+'" AND messagetype=1');
} else {// use insert // } else {// use insert
result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,source,status_id,uid,statusnet_html,statusnet_conversation_id) VALUES (?,?,?,?,?,?,?,?,?)', [login.username,1,Qt.btoa(messages[i].text),Date.parse(cleanDate(messages[i].created_at)), "Friendica", messages[i].id, messages[i].sender.id,Qt.btoa(messages[i].text),messages[i].friendica_parent_uri])} // result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,source,status_id,uid,statusnet_html,statusnet_conversation_id) VALUES (?,?,?,?,?,?,?,?,?)', [login.username,1,Qt.btoa(messages[i].text),Date.parse(cleanDate(messages[i].created_at)), "Friendica", messages[i].id, messages[i].sender.id,Qt.btoa(messages[i].text),messages[i].friendica_parent_uri])}
}); // });
} // }
}) // })
callback() // callback()
// if(login.newsViewType=="Timeline"){newsfromdb(database,login.username,callback)} //// if(login.newsViewType=="Timeline"){newsfromdb(database,login.username,callback)}
// else{chatsfromdb(database,login.username,callback)} //// else{chatsfromdb(database,login.username,callback)}
} //}
function getNotifications(login,database,rootwindow,callback){ //function getNotifications(login,database,rootwindow,callback){
Helperjs.friendicaRequest(login,"/api/friendica/notifications", rootwindow,function (obj){ // Helperjs.friendicaRequest(login,"/api/friendica/notifications", rootwindow,function (obj){
var messages=JSON.parse(obj); // var messages=JSON.parse(obj);
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); // var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
for (var i=0;i<messages.length;i++){ // for (var i=0;i<messages.length;i++){
//print('store message data for '+JSON.stringify(messages[i])); // //print('store message data for '+JSON.stringify(messages[i]));
db.transaction( function(tx) { // db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+messages[i].id+'" AND messagetype=2'); // check for news id // var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+messages[i].id+'" AND messagetype=2'); // check for news id
if(result.rows.length === 1) {// use update // if(result.rows.length === 1) {// use update
print(messages[i].id +' Notification exists, update it') // print(messages[i].id +' Notification exists, update it')
result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=2, text="'+Qt.btoa(messages[i].msg_html)+'", created_at="'+Date.parse(messages[i].date)+'", source="Friendica", status_id="'+messages[i].id+'", uid="'+messages[i].uid+'", statusnet_html="'+Qt.btoa(messages[i].msg_html)+'", statusnet_conversation_id="'+messages[i].parent+'" where username="'+login.username+'" AND status_id="'+messages[i].id+'" AND messagetype=2'); // result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype=2, text="'+Qt.btoa(messages[i].msg_html)+'", created_at="'+Date.parse(messages[i].date)+'", source="Friendica", status_id="'+messages[i].id+'", uid="'+messages[i].uid+'", statusnet_html="'+Qt.btoa(messages[i].msg_html)+'", statusnet_conversation_id="'+messages[i].parent+'" where username="'+login.username+'" AND status_id="'+messages[i].id+'" AND messagetype=2');
} else {// use insert // } else {// use insert
result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,source,status_id, uid,statusnet_html,statusnet_conversation_id) VALUES (?,?,?,?,?,?,?,?,?)', [login.username,2,Qt.btoa(messages[i].msg_html),Date.parse(messages[i].date),"Friendica", messages[i].id, messages[i].uid,Qt.btoa(messages[i].msg_html),messages[i].parent])} // result = tx.executeSql('INSERT INTO news (username,messagetype,text,created_at,source,status_id, uid,statusnet_html,statusnet_conversation_id) VALUES (?,?,?,?,?,?,?,?,?)', [login.username,2,Qt.btoa(messages[i].msg_html),Date.parse(messages[i].date),"Friendica", messages[i].id, messages[i].uid,Qt.btoa(messages[i].msg_html),messages[i].parent])}
}); // });
} // }
db.transaction( function(tx) { // db.transaction( function(tx) {
var newsrs=tx.executeSql('select * from news WHERE username="'+login.username+'" AND messagetype=2 ORDER BY status_id DESC LIMIT 20'); // var newsrs=tx.executeSql('select * from news WHERE username="'+login.username+'" AND messagetype=2 ORDER BY status_id DESC LIMIT 20');
var newsArray=[]; // var newsArray=[];
for(var j = 0; j < newsrs.rows.length; j++) { // for(var j = 0; j < newsrs.rows.length; j++) {
newsArray.push(newsrs.rows.item(j)); // newsArray.push(newsrs.rows.item(j));
callback(newsArray); // newsArray[j].statusnet_html=Qt.atob(newsArray[j].statusnet_html);
} // callback(newsArray);
}) // }
})} // })
//})}
function getActivitiesUserData(database,username,allcontacts,userUrlArray){//print(JSON.stringify(userUrlArray));
function getActivitiesUserData(allcontacts,userUrlArray){//print(JSON.stringify(userUrlArray));
var helpArray=[]; var helpArray=[];
for (var i=0;i<userUrlArray.length;i++){ for (var i=0;i<userUrlArray.length;i++){
helpArray.push(objFromArray(allcontacts,"url",userUrlArray[i])); helpArray.push(objFromArray(allcontacts,"url",userUrlArray[i]));
// Helperjs.readData(database,"contacts",username,function(userdata){
// helpArray.push(userdata[0]);
// },"url",userUrlArray[i]);
} }
return helpArray return helpArray
} }
function newsfromdb(database,username,callback,contact,stop_time){ function newsfromdb(database,user,callback,contact,stop_time){
// return news before stop_time (used by More button), in brackets of 20 entries, or by specified contact // return news before stop_time (used by More button), in brackets of 20 entries, or by specified contact
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
if (!stop_time){var stop=""; if (!stop_time){var stop="";
try{var rs = tx.executeSql('select created_at from news WHERE username="'+username+'" ORDER BY created_at DESC LIMIT 1'); try{var rs = tx.executeSql('select created_at from news WHERE username="'+user+'" ORDER BY created_at DESC LIMIT 1');
stop="<="+rs.rows.item(0).created_at}catch(e){stop="<99999999999999"}} stop="<="+rs.rows.item(0).created_at}catch(e){stop="<99999999999999"}}
else{var stop="<"+stop_time} else{var stop="<"+stop_time}
var contactfilter="";if(contact){contactfilter=" AND (uid='"+contact+"' OR friendica_owner='"+contact+"')"} var contactfilter="";if(contact){contactfilter=" AND (uid='"+contact+"' OR friendica_owner='"+contact+"')"}
//print('select * from news WHERE username="'+username+'" AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20'); //print('select * from news WHERE username="'+username+'" AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20');
var newsrs=tx.executeSql('select * from news WHERE username="'+username+'" AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20'); var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20');
var newsArray=[]; var newsArray=[];
var allcontacts=[]; var allcontacts=getAllContacts(database,user);
Helperjs.readData(database,"contacts",username,function(obj){allcontacts=obj});
for(var i = 0; i < newsrs.rows.length; i++) { for(var i = 0; i < newsrs.rows.length; i++) {
newsArray.push(newsrs.rows.item(i)); newsArray.push(newsrs.rows.item(i));
newsArray[i]=fetchUsersForNews(database,username,newsArray[i],allcontacts) newsArray[i].statusnet_html=Qt.atob(newsArray[i].statusnet_html);
newsArray[i].text=Qt.atob(newsArray[i].text);
newsArray[i].id=newsArray[i].status_id;
newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts);
if (newsArray[i].attachments!==null){newsArray[i].attachments=JSON.parse(Qt.atob(newsArray[i].attachments))};
} }
callback(newsArray)}); callback(newsArray)});
} }
@ -270,33 +284,21 @@ function newsfromdb(database,username,callback,contact,stop_time){
function fetchUsersForNews(database,username,news,allcontacts){//print(JSON.stringify(news)) function fetchUsersForNews(database,username,news,allcontacts){//print(JSON.stringify(news))
news.user=objFromArray(allcontacts,"id",news.uid); news.user=objFromArray(allcontacts,"id",news.uid);
if(news.in_reply_to_user_id){news.reply_user=objFromArray(allcontacts,"id",news.in_reply_to_user_id)} if(news.in_reply_to_user_id){news.reply_user=objFromArray(allcontacts,"id",news.in_reply_to_user_id)}
news.friendica_owner_object=objFromArray(allcontacts,"url",news.friendica_owner); //news.friendica_owner_object=objFromArray(allcontacts,"url",news.friendica_owner);
// Helperjs.readData(database,"contacts",username,function(userdata){ news.friendica_owner=objFromArray(allcontacts,"url",news.friendica_owner);
// news.user=userdata[0]; if (news.messagetype==0){
// //print("Fetch user"+JSON.stringify(news.user)); var friendicaArray=JSON.parse(Qt.atob(news.friendica_activities));
// },"id",news.uid); delete news.friendica_activities;
// if(news.in_reply_to_user_id){ news.friendica_activities={};
// Helperjs.readData(database,"contacts",username,function(replytodata){ //for(var j=0;j<friendicaArray.length;j++){
// news.reply_user=replytodata[0]; news.friendica_activities.like=getActivitiesUserData(allcontacts,friendicaArray[0]);
// //print("Fetch reply to"+JSON.stringify(news.reply_user)); news.friendica_activities.dislike=getActivitiesUserData(allcontacts,friendicaArray[1]);
// },"id",news.in_reply_to_user_id); news.friendica_activities.attendyes=getActivitiesUserData(allcontacts,friendicaArray[2]);
// } news.friendica_activities.attendno=getActivitiesUserData(allcontacts,friendicaArray[3]);
if (news.messagetype==0){ news.friendica_activities.attendmaybe=getActivitiesUserData(allcontacts,friendicaArray[4]);
for(var j=0;j<news.friendica_activities.length;j++) //}
{var friendicaArray=JSON.parse(Qt.atob(news.friendica_activities)); }
// print("Array: "+friendicaArray[1]); return news
news.like=getActivitiesUserData(database,username,allcontacts,friendicaArray[0]);
news.dislike=getActivitiesUserData(database,username,allcontacts,friendicaArray[1]);
news.attendyes=getActivitiesUserData(database,username,allcontacts,friendicaArray[2]);
news.attendno=getActivitiesUserData(database,username,allcontacts,friendicaArray[3]);
news.attendmaybe=getActivitiesUserData(database,username,allcontacts,friendicaArray[4]);
}
// Helperjs.readData(database,"contacts",username,function(friendica_owner_data){
// news.friendica_owner_object=friendica_owner_data[0];
// //print("Fetch friendica_owner"+JSON.stringify(news.friendica_owner));
// },"url",news.friendica_owner);
}
return news
} }
function deleteNews(login,database,newsid,messagetype,rootwindow,callback){ function deleteNews(login,database,newsid,messagetype,rootwindow,callback){
@ -401,11 +403,14 @@ function conversationfromdb(database,user,conversationId,callback){
db.transaction( function(tx) { db.transaction( function(tx) {
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversationId+'" ORDER BY created_at ASC'); var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversationId+'" ORDER BY created_at ASC');
var newsArray=[]; var newsArray=[];
var allcontacts=[]; var allcontacts=getAllContacts(database,user);
Helperjs.readData(database,"contacts",user,function(obj){allcontacts=obj});
for(var i = 0; i < newsrs.rows.length; i++) { for(var i = 0; i < newsrs.rows.length; i++) {
newsArray.push(newsrs.rows.item(i)); newsArray.push(newsrs.rows.item(i));
newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts) newsArray[i].statusnet_html=Qt.atob(newsArray[i].statusnet_html);
newsArray[i].text=Qt.atob(newsArray[i].text);
newsArray[i].id=newsArray[i].status_id;
newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts);
if (newsArray[i].attachments!==null){newsArray[i].attachments=JSON.parse(Qt.atob(newsArray[i].attachments))};
} }
callback(newsArray)}) callback(newsArray)})
} }
@ -419,19 +424,21 @@ function requestFavorites(login,database,contacts,rootwindow,callback){
callback(news,newContacts) callback(news,newContacts)
})} })}
function favoritesfromdb(database,user,callback){ //function favoritesfromdb(database,user,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); // var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { // db.transaction( function(tx) {
//print('select * from news WHERE username="'+user+'" AND favorited=1 ORDER BY status_id DESC'); // //print('select * from news WHERE username="'+user+'" AND favorited=1 ORDER BY status_id DESC');
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND favorited=1 ORDER BY status_id DESC'); // var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND favorited=1 ORDER BY status_id DESC');
var newsArray=[]; // var newsArray=[];
var allcontacts=[]; // var allcontacts=getAllContacts(database,user);
Helperjs.readData(database,"contacts",user,function(obj){allcontacts=obj}); // for(var i = 0; i < newsrs.rows.length; i++) {
for(var i = 0; i < newsrs.rows.length; i++) { // newsArray.push(newsrs.rows.item(i));
newsArray.push(newsrs.rows.item(i)); // newsArray[i].statusnet_html=Qt.atob(newsArray[i].statusnet_html);
newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts); // newsArray[i].id=newsArray[i].status_id;
callback(newsArray); // newsArray[i]=fetchUsersForNews(database,user,newsArray[i],allcontacts);
}})} // if (newsArray[i].attachments!==null){newsArray[i].attachments=JSON.parse(Qt.atob(newsArray[i].attachments))};
// callback(newsArray);
// }})}
function chatsfromdb(database,user,callback,stop_time){ function chatsfromdb(database,user,callback,stop_time){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
@ -446,25 +453,91 @@ function chatsfromdb(database,user,callback,stop_time){
conversations.push(conversationsrs.rows.item(i).statusnet_conversation_id); conversations.push(conversationsrs.rows.item(i).statusnet_conversation_id);
} }
var newsArray=[]; var newsArray=[];
var allcontacts=[]; var allcontacts=getAllContacts(database,user);
Helperjs.readData(database,"contacts",user,function(obj){allcontacts=obj});
for(var j = 0; j< conversations.length; j++) { for(var j = 0; j< conversations.length; j++) {
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversations[j] +'" ORDER BY created_at ASC'); var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversations[j] +'" ORDER BY created_at ASC');
var helpernews=newsrs.rows.item(0); var helpernews=newsrs.rows.item(0);
helpernews.newscount=newsrs.rows.length; helpernews.newscount=newsrs.rows.length;
helpernews=fetchUsersForNews(database,user,helpernews,allcontacts); helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
//var chatArray=[]; helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
// for (var k=0;k<newsrs.rows.length;k++){ helpernews.text=Qt.atob(helpernews.text);
// var helperchat=newsrs.rows.item(k); helpernews.id=helpernews.status_id;
// helperchat=fetchUsersForNews(database,user,helperchat); if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
// chatArray.push(helperchat)
//}
//helpernews.chatArray=chatArray;
newsArray.push(helpernews); newsArray.push(helpernews);
} }
callback(newsArray); callback(newsArray);
})} })}
function allchatsfromdb(database,user,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
// if (!stop_time){var stop="";
// try{var rs = tx.executeSql('select created_at from news WHERE username="'+username+'" ORDER BY created_at DESC LIMIT 1');
// stop="<="+rs.rows.item(0).created_at}catch(e){stop="<99999999999999"}}
// else{var stop="<"+stop_time}
var conversationsrs=tx.executeSql('select DISTINCT statusnet_conversation_id from news WHERE username="'+user+'" ORDER BY created_at DESC'); //+' ORDER BY created_at DESC LIMIT 20');
var conversationIds=[];
for(var i = 0; i < conversationsrs.rows.length; i++) {
conversationIds.push(conversationsrs.rows.item(i).statusnet_conversation_id);
}
var newsArray=[];
var countArray=[];
var allcontacts=getAllContacts(database,user);
for(var j = 0; j< conversationIds.length; j++) {
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversationIds[j] +'" ORDER BY created_at ASC');
var helpernews=newsrs.rows.item(0);
//helpernews.newscount=newsrs.rows.length;
helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
helpernews.text=Qt.atob(helpernews.text);
helpernews.id=helpernews.status_id;
if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
newsArray.push(helpernews);
countArray.push(newsrs.rows.length)
}
var conversationsobject=({});
conversationsobject.conversationIds=conversationIds;
conversationsobject.newsArray=newsArray;
conversationsobject.countArray=countArray;
callback(conversationsobject);
})}
function oldchatfromdb(database,user,conversationId,lastpost,allcontacts,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
// var newsArray=[];
// var countArray=[];
//var allcontacts=getAllContacts(database,user);
var newsrs=tx.executeSql('select * from news WHERE username="'+user+'" AND statusnet_conversation_id="'+conversationId +'" AND status_id<'+lastpost+' ORDER BY created_at ASC');
if(newsrs.rows.length>0){var helpernews=newsrs.rows.item(0);
var newscount=newsrs.rows.length;
helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
helpernews.text=Qt.atob(helpernews.text);
helpernews.id=helpernews.status_id;
if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
callback(helpernews,newscount);}
// var conversationobject={news:helpernews,newscount:newscount};
// return conversationobject;
})}
function getAllContacts(database,user){
var allcontacts=[];
Helperjs.readData(database,"contacts",user,function(obj){
allcontacts=obj;
for (var n in allcontacts){
allcontacts[n].name=Qt.atob(allcontacts[n].name);
allcontacts[n].description=Qt.atob(allcontacts[n].description)
}
});
return allcontacts;
}
function inArray(list, prop, val) { function inArray(list, prop, val) {
if (list.length > 0 ) { if (list.length > 0 ) {
for (var i in list) {if (list[i][prop] == val) { for (var i in list) {if (list[i][prop] == val) {

View File

@ -41,49 +41,50 @@ else{
if (msg.news[j]) { if (msg.news[j]) {
var newsitemobject=msg.news[j]; var newsitemobject=msg.news[j];
//print("Newsitem"+JSON.stringify(newsitemobject.friendica_owner+" userid: "+newsitemobject.user.id)); //print("Newsitem"+JSON.stringify(newsitemobject.friendica_owner+" userid: "+newsitemobject.user.id));
if (newsitemobject.messagetype==2){ // if (newsitemobject.messagetype==2){
newsitemobject.user={}; // newsitemobject.user={};
newsitemobject.user.profile_image=""; // newsitemobject.user.profile_image="";
newsitemobject.user.profile_image_url=""; // newsitemobject.user.profile_image_url="";
newsitemobject.user.name=""; // newsitemobject.user.name="";
} // }
var forumname="";try{if (newsitemobject.messagetype==0&&((newsitemobject.friendica_owner)!=(newsitemobject.user.url))){ var forumname="";try{if (newsitemobject.messagetype==0&&newsitemobject.hasOwnProperty('friendica_owner')&&((newsitemobject.friendica_owner.url)!=(newsitemobject.user.url))){
//print(newsitemobject.friendica_owner+" Friendica Owner "+JSON.stringify(newsitemobject)); //print(newsitemobject.friendica_owner+" Friendica Owner "+JSON.stringify(newsitemobject));
forumname=" via "+Qt.atob(newsitemobject.friendica_owner_object.name) forumname=" via "+newsitemobject.friendica_owner.name
}}catch(e){print("forum name "+e)} }}catch(e){print("forum name "+e)}
var likeText="";var dislikeText="";var attendyesText="";var attendnoText="";var attendmaybeText=""; var self={}; var likeText="";var dislikeText="";var attendyesText="";var attendnoText="";var attendmaybeText=""; var self={};
try{if (newsitemobject.messagetype==0){ try{if (newsitemobject.messagetype==0&&newsitemobject.hasOwnProperty('friendica_activities')){
if (newsitemobject.like.length>0){ if (newsitemobject.friendica_activities.like.length>0){
if (newsitemobject.like.length==1){likeText= Qt.atob(newsitemobject.like[0].name)+" "+ qsTr("likes this.")} if (newsitemobject.friendica_activities.like.length==1){likeText= newsitemobject.friendica_activities.like[0].name+" "+ qsTr("likes this.")}
else {likeText= newsitemobject.like.length+" "+ qsTr("like this.")} else {likeText= newsitemobject.friendica_activities.like.length+" "+ qsTr("like this.")}
} }
if (newsitemobject.dislike.length>0){ if (newsitemobject.friendica_activities.dislike.length>0){
if (newsitemobject.dislike.length==1){dislikeText= Qt.atob(newsitemobject.dislike[0].name)+" "+ qsTr("doesn't like this.")} if (newsitemobject.friendica_activities.dislike.length==1){dislikeText= newsitemobject.friendica_activities.dislike[0].name+" "+ qsTr("doesn't like this.")}
else {dislikeText= newsitemobject.dislike.length+" "+ qsTr("don't like this.")} else {dislikeText= newsitemobject.friendica_activities.dislike.length+" "+ qsTr("don't like this.")}
} }
if (newsitemobject.attendyes.length>0){ if (newsitemobject.friendica_activities.attendyes.length>0){
if (newsitemobject.attendyes.length==1){attendyesText= Qt.atob(newsitemobject.attendyes[0].name)+" "+ qsTr("will attend.")} if (newsitemobject.friendica_activities.attendyes.length==1){attendyesText=newsitemobject.friendica_activities.attendyes[0].name+" "+ qsTr("will attend.")}
else {attendyesText= newsitemobject.attendyes.length+" "+ qsTr("persons will attend.")} else {attendyesText= newsitemobject.friendica_activities.attendyes.length+" "+ qsTr("persons will attend.")}
} }
if (newsitemobject.attendno.length>0){ if (newsitemobject.friendica_activities.attendno.length>0){
if (newsitemobject.attendno.length==1){attendnoText= Qt.atob(newsitemobject.attendno[0].name)+" "+ qsTr("will not attend.")} if (newsitemobject.friendica_activities.attendno.length==1){attendnoText= newsitemobject.friendica_activities.attendno[0].name+" "+ qsTr("will not attend.")}
else {attendnoText= newsitemobject.attendno.length+" "+ qsTr("persons will not attend.")} else {attendnoText= newsitemobject.friendica_activities.attendno.length+" "+ qsTr("persons will not attend.")}
} }
if (newsitemobject.attendmaybe.length>0){ if (newsitemobject.friendica_activities.attendmaybe.length>0){
if (newsitemobject.attendmaybe.length==1){attendmaybeText= Qt.atob(newsitemobject.attendmaybe[0].name)+" "+ qsTr("may attend.")} if (newsitemobject.friendica_activities.attendmaybe.length==1){attendmaybeText= newsitemobject.friendica_activities.attendmaybe[0].name+" "+ qsTr("may attend.")}
else {attendmaybeText= newsitemobject.attendmaybe.length+" "+ qsTr("persons may attend.")} else {attendmaybeText= newsitemobject.friendica_activities.attendmaybe.length+" "+ qsTr("persons may attend.")}
} }
//var friendica_activities_self=JSON.parse(newsitemobject.friendica_activities_self); //var friendica_activities_self=JSON.parse(newsitemobject.friendica_activities_self);
if (newsitemobject.hasOwnProperty("friendica_activities_self")){
if (newsitemobject.friendica_activities_self.indexOf(3)!=-1){self.attending=qsTr("yes")} if (newsitemobject.friendica_activities_self.indexOf(3)!=-1){self.attending=qsTr("yes")}
if (newsitemobject.friendica_activities_self.indexOf(4)!=-1){self.attending=qsTr("no")} if (newsitemobject.friendica_activities_self.indexOf(4)!=-1){self.attending=qsTr("no")}
if (newsitemobject.friendica_activities_self.indexOf(5)!=-1){self.attending=qsTr("maybe")} if (newsitemobject.friendica_activities_self.indexOf(5)!=-1){self.attending=qsTr("maybe")}
if (newsitemobject.friendica_activities_self.indexOf(1)!=-1){self.liked=1} if (newsitemobject.friendica_activities_self.indexOf(1)!=-1){self.liked=1}
if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1} if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
}} catch(e){print("Activities "+e)} }}} 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 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=JSON.parse(Qt.atob(newsitemobject.attachments)); var attachArray=newsitemobject.attachments;
for (var image in attachArray){if(attachArray[image].mimetype=="image/gif"){ for (var image in attachArray){if(attachArray[image].mimetype=="image/gif"){
attachmentList.push(attachArray[image]) attachmentList.push(attachArray[image])
} }

View File

@ -1,5 +1,4 @@
// This file is part of Friendiqa // This file is part of Friendiqa // https://github.com/lubuwest/Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net> // Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
@ -338,50 +337,6 @@ function cleanContacts(login,database,callback){
}) })
} }
function processNews(callback){
if (contactLoadType=="news"){
if(root.news.length==0){}
else{// show news
Newsjs.storeNews(login,db,news,root,function(dbnews){
if(login.newsViewType=="Timeline"){
Newsjs.newsfromdb(db,login.username,function(dbnews){
root.newsSignal(dbnews);
newstab.newstabstatus=login.newsViewType})
}
else{
Newsjs.chatsfromdb(db,login.username,function(dbnews){
root.newsSignal(dbnews);
newstab.newstabstatus=login.newsViewType})
}
})
}
}
else if (contactLoadType=="friends"){// show friends
root.friendsSignal(login.username);
Newsjs.getCurrentContacts(login,db,function(contacts){
contactlist=contacts;
})}
else if (contactLoadType=="conversation"){
var conversationid=news[0].statusnet_conversation_id
if (!isNaN(parseInt(conversationid))){//no directmessage conversation
Newsjs.storeNews(root.login,root.db,news,root,function(){
Newsjs.conversationfromdb(db,root.login.username,conversationid, function(newsarray){
newstab.conversation=newsarray;
})
})}
else {newstab.conversation=news}//only DM conversations from database
}
else if (contactLoadType=="favorites"){//show favorited news
Newsjs.storeNews(root.login,root.db,news,root,function(){
Newsjs.favoritesfromdb(db,login.username,function(newsarray){
root.newsSignal(newsarray);
newstab.newstabstatus="Favorites";
})
})}
callback()
}
function updateContactInDB(login,database,isFriend,contact){// for newstab and friendstab function updateContactInDB(login,database,isFriend,contact){// for newstab and friendstab
var currentTime=Date.now(); var currentTime=Date.now();
var image_timestamp=0; var image_timestamp=0;
@ -393,8 +348,217 @@ function updateContactInDB(login,database,isFriend,contact){// for newstab and f
var result; var result;
result = tx.executeSql('SELECT * from contacts where username="'+login.username+'" AND url = "'+contact.url+'"'); // check for news url result = tx.executeSql('SELECT * from contacts where username="'+login.username+'" AND url = "'+contact.url+'"'); // check for news url
if(result.rows.length === 1) {// use update if(result.rows.length === 1) {// use update
result = tx.executeSql('UPDATE contacts SET id='+contact.id+', name="'+Qt.btoa(contact.name)+'", screen_name="'+contact.screen_name+'", location="'+contact.location+'",imageAge='+currentTime+', profile_image_url="'+contact.profile_image_url+'", description="'+Qt.btoa(contact.description)+'", protected="'+contact.protected+'", followers_count='+contact.followers_count+', friends_count='+contact.friends_count+', created_at="'+ Date.parse(Newsjs.cleanDate(contact.created_at))+'", favourites_count="'+contact.favorites_count+'", utc_offset="'+contact.utc_offset+'", time_zone="'+contact.time_zone+'", statuses_count='+contact.statuses_count+', following="'+contact.following+'", verified ="'+contact.verified+'", statusnet_blocking="'+contact.statusnet_blocking+'", notifications="'+contact.notifictions+'", statusnet_profile_url="'+contact.statusnet_profile_url+'", cid='+contact.cid+', network="'+contact.network+'", isFriend='+isFriend+', timestamp='+ currentTime+' where username="'+login.username+'" AND url="'+contact.url+'"'); result = tx.executeSql('UPDATE contacts SET id='+contact.id+', name="'+Qt.btoa(contact.name)+'", screen_name="'+contact.screen_name+'", location="'+contact.location+'",imageAge='+currentTime+', profile_image_url="'+contact.profile_image_url+'", description="'+Qt.btoa(contact.description)+'", protected="'+contact.protected+'", followers_count='+contact.followers_count+', friends_count='+contact.friends_count+', created_at="'+ contact.created_at+'", favourites_count="'+contact.favorites_count+'", utc_offset="'+contact.utc_offset+'", time_zone="'+contact.time_zone+'", statuses_count='+contact.statuses_count+', following="'+contact.following+'", verified ="'+contact.verified+'", statusnet_blocking="'+contact.statusnet_blocking+'", notifications="'+contact.notifictions+'", statusnet_profile_url="'+contact.statusnet_profile_url+'", cid='+contact.cid+', network="'+contact.network+'", isFriend='+isFriend+', timestamp='+ currentTime+' where username="'+login.username+'" AND url="'+contact.url+'"');
} else {// use insert } else {// use insert
result = tx.executeSql('INSERT INTO contacts VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,contact.id,Qt.btoa(contact.name),contact.screen_name,contact.location,currentTime,contact.profile_image_url, Qt.btoa(contact.description),"",contact.url,contact.protected,contact.followers_count, contact.friends_count,Date.parse(Newsjs.cleanDate(contact.created_at)),contact.favorites_count,contact.utc_offset,contact.time_zone,contact.statuses_count,contact.following,contact.verfied,contact.statusnet_blocking,contact.notifications,contact.statusnet_profile_url,contact.cid,contact.network,isFriend,image_timestamp]);} result = tx.executeSql('INSERT INTO contacts VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,contact.id,Qt.btoa(contact.name),contact.screen_name,contact.location,currentTime,contact.profile_image_url, Qt.btoa(contact.description),"",contact.url,contact.protected,contact.followers_count, contact.friends_count,contact.created_at,contact.favorites_count,contact.utc_offset,contact.time_zone,contact.statuses_count,contact.following,contact.verfied,contact.statusnet_blocking,contact.notifications,contact.statusnet_profile_url,contact.cid,contact.network,isFriend,image_timestamp]);}
}); });
} }
function processNews(api,data){
try{var newslist=JSON.parse(data);
} catch(e){
Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)};
if (typeof(newslist)=='undefined'){
Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
}
else if (newslist.hasOwnProperty('status')){
Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
} else if (!(Array.isArray(newslist))){
replytimer.restart()
} else {
var allcontacts=[];
allcontacts=Newsjs.getAllContacts(db,login.username);
if (api=="/api/direct_messages/all"){
for (var n in newslist){
newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at));
newslist[n].messagetype=1;
newslist[n].source=" Friendica";
newslist[n].status_id=newslist[n].id;
newslist[n].uid=newslist[n].sender.id;
newslist[n].statusnet_conversation_id=newslist[n].friendica_parent_uri;
newslist[n].user=cleanUser(newslist[n].sender);
newslist[n].statusnet_html=newslist[n].text;
}}
else if (api=="/api/friendica/notifications"){
for (var n in newslist){
newslist[n].created_at=Date.parse(newslist[n].date);
newslist[n].messagetype=2;
newslist[n].user=Newsjs.objFromArray(allcontacts,"url",newslist[n].url)
if (newslist[n].user==false){
newslist[n].user={"profile_image_url": newslist[n].photo,"name": newslist[n].name," url":newslist[n].url, "created_at":newslist[n].date};
newslist[n].user=cleanUser(newslist[n].user);
}
newslist[n].statusnet_html=newslist[n].msg_html;
}
} else {
var chatlist=[];
var conversationIds=[];
var commentCount=[];
for (var n in newslist){
newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at));
newslist[n].messagetype=0;
newslist[n].user=cleanUser(newslist[n].user)
if(newslist[n].in_reply_to_user_id){newslist[n].reply_user=Newsjs.objFromArray(allcontacts,"id",newslist[n].in_reply_to_user_id)}
//print (JSON.stringify(newslist[n].user))
if(newslist[n].hasOwnProperty('friendica_activities')){
for (var m in newslist[n].friendica_activities.like){
newslist[n].friendica_activities.like[m]=cleanUser(newslist[n].friendica_activities.like[m]);
}
for (var o in newslist[n].friendica_activities.dislike){
newslist[n].friendica_activities.dislike[o]=cleanUser(newslist[n].friendica_activities.dislike[o]);
}
for (var p in newslist[n].friendica_activities.attendyes){
newslist[n].friendica_activities.attendyes[p]=cleanUser(newslist[n].friendica_activities.attendyes[p]);
}
for (var q in newslist[n].friendica_activities.attendno){
newslist[n].friendica_activities.attendno[q]=cleanUser(newslist[n].friendica_activities.attendno[q]);
}
for (var r in newslist[n].friendica_activities.attendmaybe){
newslist[n].friendica_activities.attendmaybe[r]=cleanUser(newslist[n].friendica_activities.attendmaybe[r]);
}
}
if(!(newslist[n].hasOwnProperty('friendica_owner'))){
newslist[n].friendica_owner=newslist[n].user
}
var conversationindex=conversationIds.indexOf(newslist[n].statusnet_conversation_id);
//fill chatlist
if (conversationindex==-1){
chatlist.push(newslist[n]);
conversationIds.push(newslist[n].statusnet_conversation_id);
commentCount.push(1);
} else{
commentCount[conversationindex]=commentCount[conversationindex]+1;
chatlist[conversationindex]=newslist[n];
}
}
//enrich chatlist with old entries
for (var count in chatlist){ //print("chat "+JSON.stringify(chatlist[count])+" count: "+commentCount[count])
//chatlist[count].newscount=commentCount[count]
if (chatlist[count].id_str!==chatlist[count].statusnet_conversation_id){
try{
Newsjs.oldchatfromdb(db,login.username,chatlist[count].statusnet_conversation_id,chatlist[count].id,allcontacts,function(oldpost,oldcount){
chatlist[count]=oldpost;
chatlist[count].newscount=oldcount+commentCount[count];
//print("JSON "+chatlist[count].statusnet_conversation_id+" "+chatlist[count].id+JSON.stringify(oldpost))
})
}catch(e){print(e)}
}
else{chatlist[count].newscount=commentCount[count]}
}
}
if (api=="/api/conversation/show"){
newslist.reverse();
newstab.conversation=newslist
}
else if (newstab.newstabstatus==="Conversations"){
showNews(chatlist);root.news=newslist}
else {showNews(newslist);root.news=newslist};
var newstabarray=["Conversations","Favorites","Timeline","DirectMessage"];
if (newstabarray.indexOf(newstab.newstabstatus)>-1){contacttimer.start()}
}
}
function cleanUser(user){
user.created_at=Date.parse(Newsjs.cleanDate(user.created_at));
var imagehelper1=user.profile_image_url.split("?");
var imagehelper2=imagehelper1[0].substring(imagehelper1[0].lastIndexOf("/")+1,imagehelper1[0].length);
var imagehelper3=login.imagestore+"contacts/"+user.screen_name+"-"+imagehelper2
if(filesystem.fileexist(imagehelper3)){user.profile_image=imagehelper3}else {user.profile_image=""}
return user
}
function updateView(viewtype){
newsBusy.running=true;
//downloadNotice.text="xhr start "+Date.now()
switch(viewtype){
case "Conversations":
var lastnews=Newsjs.getLastNews(login,db);
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/friends_timeline");
xhr.clearParams();
xhr.setParam("since_id",lastnews);
xhr.setParam("count",50)
break;
case "Timeline":
var lastnews=Newsjs.getLastNews(login,db);
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/friends_timeline");
xhr.clearParams();
xhr.setParam("since_id",lastnews);
xhr.setParam("count",50)
break;
case "Search":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/search");
break;
case "Notifications":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/friendica/notifications");
xhr.clearParams();
break;
case "Direct Messages":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/all");
xhr.clearParams();
break;
case "Public Timeline":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/public_timeline");
xhr.clearParams();
break;
case "Favorites":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/favorites");
xhr.clearParams();
break;
default:
var lastnews=Newsjs.getLastNews(login,db);
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/friends_timeline");
xhr.clearParams();
xhr.setParam("since_id",lastnews);
xhr.setParam("count",50)
newstab.newstabstatus="Conversations";
}
xhr.get();
if (viewtype==="Conversations"){Newsjs.allchatsfromdb(db,login.username,function(temp){
newsStack.allchats=temp
})}
}
function showGroups(){
Helperjs.readData(db,"groups",login.username,function(groups){
var groupitems="";
for (var i=0;i<groups.length;i++){
groupitems=groupitems+"MenuItem{text:'"+groups[i].groupname+"'; onTriggered: Service.getGroupnews("+groups[i].gid+")}"
}
var menuString="import QtQuick.Controls 1.4; import 'qrc:/js/service.js' as Service; Menu {"+groupitems+"}";
var grouplistObject=Qt.createQmlObject(menuString,newsStack,"groupmenuOutput");
grouplistObject.popup()
})
}
function getGroupnews(list){
newstab.newstabstatus="Group news";
newsBusy.running=true;
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/lists/statuses");
xhr.clearParams();
xhr.setParam("list_id",list)
xhr.get();
}

View File

@ -43,7 +43,7 @@ Rectangle{
textFormat: Text.RichText textFormat: Text.RichText
width: parent.width width: parent.width
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: "<b>Friendiqa v0.2 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+ text: "<b>Friendiqa v0.3 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
"Profile <a href='https://freunde.ma-nic.de/profile/friendiqa'>https://freunde.ma-nic.de/profile/friendiqa</a><br>"+ "Profile <a href='https://freunde.ma-nic.de/profile/friendiqa'>https://freunde.ma-nic.de/profile/friendiqa</a><br>"+
"Sourcecode: <a href='https://github.com/LubuWest/Friendiqa'>https://github.com/LubuWest/Friendiqa</a><br>"+ "Sourcecode: <a href='https://github.com/LubuWest/Friendiqa'>https://github.com/LubuWest/Friendiqa</a><br>"+
"C++ code by <a href='https://kirgroup.com/profile/fabrixxm'>Fabio</a><br>"+ "C++ code by <a href='https://kirgroup.com/profile/fabrixxm'>Fabio</a><br>"+

View File

@ -37,7 +37,7 @@ Item {
id: contactLargeComponent id: contactLargeComponent
x:mm x:mm
y:mm y:mm
property var contact:{} property var contact:({})
property var createdAtDate: new Date(contact.created_at) property var createdAtDate: new Date(contact.created_at)
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>") property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
@ -63,7 +63,7 @@ Rectangle {
x: mm x: mm
width: root.width-6*mm //friendsTabView.width-4*mm width: root.width-6*mm //friendsTabView.width-4*mm
height: 3*mm height: 3*mm
text:Qt.atob(contact.name)+" (@"+contact.screen_name+")" text:contact.name+" (@"+contact.screen_name+")"
elide:Text.ElideRight elide:Text.ElideRight
anchors.topMargin: 0 anchors.topMargin: 0
anchors.left: photoImage.left anchors.left: photoImage.left
@ -91,7 +91,7 @@ Rectangle{
font.pixelSize: 3*mm font.pixelSize: 3*mm
textFormat:Text.RichText textFormat:Text.RichText
wrapMode: Text.Wrap wrapMode: Text.Wrap
text:"<b>"+qsTr("Description")+": </b> "+Qt.atob(contact.description)+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+ text:"<b>"+qsTr("Description")+": </b> "+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>"+ "<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+
connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale()) connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
onLinkActivated: { onLinkActivated: {
@ -123,7 +123,7 @@ Rectangle{
text: "\uf0e6" //"Messages" text: "\uf0e6" //"Messages"
onClicked:{ onClicked:{
root.currentIndex=0; root.currentIndex=0;
newstab.active=true; //newstab.active=true;
root.messageSignal(contact) ; root.messageSignal(contact) ;
contactLargeComponent.destroy(); contactLargeComponent.destroy();
} }
@ -135,7 +135,7 @@ Rectangle{
text: "\uf040" //"DM" text: "\uf040" //"DM"
onClicked:{ onClicked:{
root.currentIndex=0; root.currentIndex=0;
newstab.active=true; //newstab.active=true;
root.directmessageSignal(contact.screen_name); root.directmessageSignal(contact.screen_name);
contactLargeComponent.destroy(); contactLargeComponent.destroy();
} }

View File

@ -126,6 +126,8 @@ Rectangle {
try {friendsModel.clear()} catch(e){print(e)}; try {friendsModel.clear()} catch(e){print(e)};
Helperjs.readData(root.db,"contacts",login.username,function(friendsobject){ Helperjs.readData(root.db,"contacts",login.username,function(friendsobject){
for (var i=0;i<friendsobject.length;i++){ for (var i=0;i<friendsobject.length;i++){
friendsobject[i].description=Qt.atob(friendsobject[i].description);
friendsobject[i].name=Qt.atob(friendsobject[i].name);
if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){ if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){
friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
} }
@ -205,6 +207,8 @@ Rectangle {
try {contactsModel.clear()} catch(e){print(e)}; try {contactsModel.clear()} catch(e){print(e)};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){ Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){ for (var j=0;j<contactsobject.length;j++){
contactsobject[j].description=Qt.atob(contactsobject[j].description);
contactsobject[j].name=Qt.atob(contactsobject[j].name);
contactsModel.append({"contact":contactsobject[j]}); contactsModel.append({"contact":contactsobject[j]});
} }
},"isFriend",0,"screen_name ASC"); },"isFriend",0,"screen_name ASC");
@ -220,6 +224,8 @@ Rectangle {
try {contactsModel.clear()} catch(e){print(e)}; try {contactsModel.clear()} catch(e){print(e)};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){ Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){ for (var j=0;j<contactsobject.length;j++){
contactsobject[j].description=Qt.atob(contactsobject[j].description);
contactsobject[j].name=Qt.atob(contactsobject[j].name);
contactsModel.append({"contact":contactsobject[j]}); contactsModel.append({"contact":contactsobject[j]});
} }
},"isFriend",0,"screen_name ASC"); },"isFriend",0,"screen_name ASC");

View File

@ -88,16 +88,16 @@ TabView{
xhr.setContactlist(contactnames); xhr.setContactlist(contactnames);
xhr.setImagedir(login.imagestore); xhr.setImagedir(login.imagestore);
xhr.getlist(); xhr.getlist();
Service.processNews(function(){ // Service.processNews(function(){
root.contactLoadType=""; // root.contactLoadType="";
root.news=[]; // root.news=[];
}) // })
} }
else if (contactLoadType!=""){ // else if (contactLoadType!=""){
Service.processNews(function(){ // Service.processNews(function(){
root.contactLoadType=""; // root.contactLoadType="";
root.news=[]; // root.news=[];
})} // })}
} }
Connections{ Connections{
@ -146,7 +146,7 @@ TabView{
frameOverlap: 1 frameOverlap: 1
tab: Rectangle { tab: Rectangle {
color: styleData.selected?"sky blue":"light blue" color: styleData.selected?"sky blue":"light blue"
border.color: "light grey" //border.color: "light grey"
implicitWidth: root.width/5 implicitWidth: root.width/5
implicitHeight: 5*mm implicitHeight: 5*mm
Text { id: text Text { id: text
@ -192,11 +192,9 @@ TabView{
id: configtab id: configtab
source: (root.currentIndex==4)?"qrc:/qml/configqml/ConfigTab.qml":"" source: (root.currentIndex==4)?"qrc:/qml/configqml/ConfigTab.qml":""
} }
// Component.onCompleted: { Component.onCompleted: {
// var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+ if(osSettings.imagePickQml=="ImagePicker"){var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
// osSettings.imagePickQml+'{multiple : true; onReady: {'+ var IntentReceiverQml = component.createObject(root)
// 'if(imageUrls.length==1){root.currentIndex=0;newstab.active=true;root.uploadSignal(imageUrls)} else{'+ }
// ' root.currentIndex=2;fotostab.active=true;'+ }
// 'root.uploadSignal(imageUrls)};}}',root,"imagePicker");
// }
} }

View File

@ -34,10 +34,10 @@ Rectangle{
id: blueButton id: blueButton
width: Math.max(mainText.width+2*mm,8*mm) width: Math.max(mainText.width+2*mm,8*mm)
height: 5*mm height: 5*mm
color:"light blue" color:"light blue"//"#EFEAEA" "sky blue"
property alias fontColor: mainText.color property alias fontColor: mainText.color
border.color:"grey" // border.color:"grey"
border.width:1 // border.width:1
radius: mm radius: mm
property alias text: mainText.text property alias text: mainText.text
signal clicked signal clicked

View File

@ -0,0 +1,83 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In addition, as a special exception, the copyright holders give
// permission to link the code of portions of this program with the
// OpenSSL library under certain conditions as described in each
// individual source file, and distribute linked combinations including
// the two.
//
// You must obey the GNU General Public License in all respects for all
// of the code used other than OpenSSL. If you modify file(s) with this
// exception, you may extend this exception to your version of the
// file(s), but you are not obligated to do so. If you do not wish to do
// so, delete this exception statement from your version. If you delete
// this exception statement from all source files in the program, then
// also delete it here.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// 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.7
import QtQuick.Controls 1.2
import "qrc:/qml/genericqml"
import "qrc:/js/news.js" as Newsjs
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/service.js" as Service
Item {
id:searchComponent
onVisibleChanged: if (visible) searchText.forceActiveFocus()
// border.color: "#EEEEEE"
// border.width: 1
// color:"lightgrey"
// width:conversationView.width
// height:Math.max(replyText.contentHeight+2*mm,6*mm)
Rectangle{
color: "white"
radius:0.5*mm
anchors.left: parent.left
anchors.leftMargin:mm
anchors.top:parent.top
anchors.topMargin: 0.5*mm
width:parent.width-2*mm
height:Math.max( searchText.contentHeight,5*mm)
TextInput {
id: searchText
font.pixelSize: 3*mm
wrapMode: Text.Wrap
anchors.fill: parent
selectByMouse: true
cursorVisible: false
onEditingFinished: search(displayText)
//onHeightChanged: newsView.contentY+=4.5*mm
}
// BlueButton {
// id: sendButton
// text: "\uf002"
// anchors.left: parent.right
// anchors.leftMargin:mm
// anchors.top:parent.top
// //anchors.topMargin: 0.5*mm
// color:"white"
// onClicked: {
// var body=searchText.getText(0,searchText.length);
// search(body)
// }
// }
}
}

View File

@ -126,14 +126,19 @@ Rectangle {
xhr.clearParams(); xhr.clearParams();
xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
if (conversationModel.get(0).newsitemobject.messagetype==0){ if (conversationModel.get(0).newsitemobject.messagetype==0){
//xhr.url= login.server + "/api/statuses/update.json";
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/update");
xhr.setParam("source", "Friendiqa"); xhr.setParam("source", "Friendiqa");
xhr.url= login.server + "/api/statuses/update.json";
xhr.setParam("status", body); xhr.setParam("status", body);
xhr.setParam("in_reply_to_status_id", conversationModel.get(conversationModel.count-1).newsitemobject.status_id)} xhr.setParam("in_reply_to_status_id", conversationModel.get(conversationModel.count-1).newsitemobject.id)}
else {xhr.url= login.server + "/api/direct_messages/new.json"; else {//xhr.url= login.server + "/api/direct_messages/new.json";
xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/new");
xhr.setParam("text", body); xhr.setParam("text", body);
xhr.setParam("screen_name",conversationModel.get(conversationModel.count-1).newsitemobject.screen_name); xhr.setParam("screen_name",conversationModel.get(conversationModel.count-1).newsitemobject.screen_name);
xhr.setParam("replyto", conversationModel.get(conversationModel.count-1).newsitemobject.status_id) xhr.setParam("replyto", conversationModel.get(conversationModel.count-1).newsitemobject.id)
} }
xhr.post(); xhr.post();
} catch(e){Helperjs.showMessage("Error",e.toString(),root)} } catch(e){Helperjs.showMessage("Error",e.toString(),root)}

View File

@ -77,7 +77,7 @@ Rectangle {
font.pixelSize: 3*mm font.pixelSize: 3*mm
anchors.left: contactImage.right anchors.left: contactImage.right
anchors.margins: 1*mm anchors.margins: 1*mm
text:Qt.atob(contact.name) text:contact.name
} }
MouseArea{ MouseArea{

View File

@ -0,0 +1,51 @@
// This file is part of Friendiqa
// https://github.com/lubuwest/Friendiqa
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In addition, as a special exception, the copyright holders give
// permission to link the code of portions of this program with the
// OpenSSL library under certain conditions as described in each
// individual source file, and distribute linked combinations including
// the two.
//
// You must obey the GNU General Public License in all respects for all
// of the code used other than OpenSSL. If you modify file(s) with this
// exception, you may extend this exception to your version of the
// file(s), but you are not obligated to do so. If you do not wish to do
// so, delete this exception statement from your version. If you delete
// this exception statement from all source files in the program, then
// also delete it here.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// 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.0
Rectangle {
id:hasgtagRectangle
color: "light grey"
property alias text: hashtagText.text
radius:0.3*mm
width:hashtagText.contentWidth+mm
height:2.5* mm
Text{
id:hashtagText
font.pixelSize: 1.5*mm
anchors.centerIn: parent
anchors.margins: 0.5*mm
}
MouseArea{
anchors.fill: parent
onClicked:{search(hashtagText.text.replace("#",""))}
}
}

View File

@ -39,12 +39,11 @@ import "qrc:/js/smiley.js" as Smileyjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Flickable{ Rectangle{
color:"white"
width:root.width-5*mm width:root.width-5*mm
height:root.height-12*mm height:root.height-12*mm
contentHeight: messageColumn.height //anchors.fill: parent
boundsBehavior: Flickable.StopAtBounds
id:messageSend
property string parentId: "" property string parentId: ""
property string reply_to_user:"" property string reply_to_user:""
property alias bodyMessage: bodyField.text property alias bodyMessage: bodyField.text
@ -57,15 +56,17 @@ Flickable{
property var group_allow:login.permissions[2] property var group_allow:login.permissions[2]
property var group_deny:login.permissions[3] property var group_deny:login.permissions[3]
function attachImage(url){ function attachImage(url){ print("attachImage "+url)
var imageAttachmentObject=Qt.createQmlObject('import QtQuick 2.0; Image {id:imageAttachment'+attachImageURLs.length+'; source:"'+ var imageAttachmentObject=Qt.createQmlObject('import QtQuick 2.0; Image {id:imageAttachment'+attachImageURLs.length+'; source:"'+
url.toString()+'"; x:2*mm; width: 45*mm; height: 45*mm;fillMode: Image.PreserveAspectFit;MouseArea{anchors.fill:parent;onClicked:{attachImageURLs.splice(attachImageURLs.indexOf("'+ url.toString()+'"; x:2*mm; width: 45*mm; height: 45*mm;fillMode: Image.PreserveAspectFit;MouseArea{anchors.fill:parent;onClicked:{attachImageURLs.splice(attachImageURLs.indexOf("'+
url+'"),1); imageAttachment'+attachImageURLs.length+'.destroy()}}}',messageColumn,"attachedImage"); url+'"),1); imageAttachment'+attachImageURLs.length+'.destroy()}}}',messageColumn,"attachedImage");
} }
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";
xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/update");
xhr.clearParams(); xhr.clearParams();
xhr.setParam("source", "Friendiqa"); xhr.setParam("source", "Friendiqa");
xhr.setParam("status", status); xhr.setParam("status", status);
@ -80,17 +81,27 @@ Flickable{
} }
function dmUpdate(title,text,replyto,screen_name,attachImageURL) { function dmUpdate(title,text,replyto,screen_name,attachImageURL) {
xhr.url= login.server + "/api/direct_messages/new.json"; //xhr.url= login.server + "/api/direct_messages/new.json";
xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/new");
xhr.clearParams(); xhr.clearParams();
xhr.setParam("text", text); xhr.setParam("text", text);
xhr.setParam("screen_name", screen_name); xhr.setParam("screen_name", screen_name);
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();
} }
Column { Flickable{
anchors.fill: parent
contentHeight: messageColumn.height
boundsBehavior: Flickable.StopAtBounds
id:messageSend
Column {
id:messageColumn id:messageColumn
spacing: 0.5*mm spacing: 0.5*mm
width: parent.width width: parent.width
@ -98,7 +109,7 @@ Flickable{
id: titleField id: titleField
width: parent.width width: parent.width
placeholderText: qsTr("Title (optional)") placeholderText: qsTr("Title (optional)")
visible: messageSend.parentId === "" visible: parentId === ""
} }
Rectangle{ Rectangle{
@ -236,3 +247,4 @@ Flickable{
} }
Component.onCompleted: if(attachImageURLs.length>0){attachImage(attachImageURLs[0])} Component.onCompleted: if(attachImageURLs.length>0){attachImage(attachImageURLs[0])}
} }
}

View File

@ -31,64 +31,98 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.3
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
import "qrc:/js/news.js" as Newsjs import "qrc:/js/news.js" as Newsjs
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
//import AndroidNative 1.0
Item { Item {
Connections{ Connections{
target:newstab target:newstab
onNewstabstatusChanged:{ onNewstabstatusChanged:{
newstabstatusButton.text= qsTr(newstab.newstabstatus) newstabstatusButton.text= qsTr(newstab.newstabstatus)
// switch(newstab.newstabstatus){
// case "Timeline": newstabstatusCombo.currentIndex=1; break;
// case "Conversations":newstabstatusCombo.currentIndex=2; break;
// case "Favorites":newstabstatusCombo.currentIndex=3; break;
// case "Network":newstabstatusCombo.currentIndex=4; break;
// case "Direct Messages":newstabstatusCombo.currentIndex=5; break;
// case "Notifications":newstabstatusCombo.currentIndex=6; break;
// case "Search":newstabstatusCombo.currentIndex=7; break;
// case "Groupnews":newstabstatusCombo.currentIndex=8; break;
// }
} }
} }
Connections{ Connections{
target:xhr target:xhr
// onError:{if (data=="contact"){downloadNotice.text=root.newContacts[root.currentContact].name+"... Error!"}} onError:{
onSuccess:{replytimer.start() //wait 1 second to load new timeline Helperjs.showMessage(qsTr("Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);
}
onSuccess:{
// downloadNotice.text=downloadNotice.text+ "\n xhr finished "+Date.now();
Service.processNews(api,data);
} }
} }
Timer {id:replytimer; interval: 1000; running: false; repeat: false Timer {id:replytimer; interval: 1000; running: false; repeat: false
onTriggered: { onTriggered: {
if(newstab.newstabstatus=="Conversation"){ if(newstab.newstabstatus=="Conversation"){
showConversation(newsStack.timelineIndex-1,newsModel.get(0).newsitemobject)} showConversation(newsStack.timelineIndex-1,newsModel.get(0).newsitemobject)}
else{ else{
var onlynew=true; Service.updateView(newstab.newstabstatus)
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(rns,rnc){
root.contactLoadType="news"; root.contactLoadType="news";
root.news=rns;root.newContacts=rnc;})
} }
} }
} }
Timer {id:contacttimer; interval: 50; running: false; repeat: false
onTriggered: {
// downloadNotice.text=downloadNotice.text + "\n contactTimer start "+ Date.now()
root.newContacts=Newsjs.findNewContacts(root.news,root.contactlist);
Newsjs.storeNews(login,db,root.news,root)
}
}
function showNews(newsToShow){ function showNews(newsToShow){
try{if (newsStack.depth>1){newsStack.pop()}}catch(e){} try{if (newsStack.depth>1){newsStack.pop()}}catch(e){}
newsBusy.running=false; newsBusy.running=false;
var currentTime= new Date(); var currentTime= new Date();
downloadNotice.text=""; // downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow}; //print("appendnews "+newsStack.appendNews +JSON.stringify(newsToShow))
var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'appendnews':newsStack.appendNews};
newsWorker.sendMessage(msg); newsWorker.sendMessage(msg);
newsStack.appendNews=false
} }
function showConversation(conversationIndex,newsitemobject){ function showConversation(conversationIndex,newsitemobject){
//newsBusy.running=true; //newsBusy.running=true;
root.contactLoadType="conversation"; root.contactLoadType="conversation";
newsStack.conversationIndex= conversationIndex; newsStack.conversationIndex= conversationIndex;
//print(newsitemobject.id);
if(newsitemobject.messagetype==0){ if(newsitemobject.messagetype==0){
Newsjs.requestConversation(root.login,db,newsitemobject.status_id,root.contactlist,root,function(ns,nc){ xhr.clearParams();
root.news=ns;root.newContacts=nc; xhr.setLogin(login.username+":"+Qt.atob(login.password));
})} xhr.setUrl(login.server);
else{Newsjs.conversationfromdb(root.db,root.login.username,newsitemobject.statusnet_conversation_id, function(newsarray){ xhr.setApi("/api/conversation/show");
root.news=newsarray;root.newContacts=[]; xhr.setParam("id",newsitemobject.id)
})} xhr.get();
}
else{
xhr.clearParams();
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/conversation");
xhr.setParam("uri",newsitemobject.statusnet_conversation_id)
xhr.get();
}
} }
function showContact(contact){ function showContact(contact){
@ -98,6 +132,21 @@ Item {
} }
} }
function search(term){//print("Search "+term)
if (term!=""){
newstab.newstabstatus="Search";
newsBusy.running=true;
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/search");
xhr.clearParams();
xhr.setParam("q",term)
xhr.get();}
newsSearch.visible=false;
newsView.anchors.topMargin=7*mm
}
function onFriendsMessages(friend){ function onFriendsMessages(friend){
newstab.newstabstatus="Contact" newstab.newstabstatus="Contact"
Newsjs.newsfromdb(db,root.login.username, function(dbnews){ Newsjs.newsfromdb(db,root.login.username, function(dbnews){
@ -132,18 +181,163 @@ Item {
id: newsStack id: newsStack
anchors.fill:parent anchors.fill:parent
property int conversationIndex: 0 property int conversationIndex: 0
property bool appendNews: false
property var allchats: ({})
initialItem:Rectangle { initialItem:Rectangle {
id:newslistRectangle id:newslistRectangle
y:1 y:1
color: "white" color: "white"
// ComboBox{
// id:newstabstatusCombo
// anchors.top: parent.top
// anchors.topMargin: 0.5*mm
// width: 1/3*root.width
// height: 5*mm;
// style:
// ComboBoxStyle{
// background: Rectangle {
// color:"light blue"
// radius: 0.5*mm
// }
// label: Text {
// verticalAlignment: Text.AlignVCenter
// horizontalAlignment: Text.AlignHCenter
// text: control.currentText
// }
// }
// model: ListModel {
// id: newscomboItems
// ListElement { type: "Timeline"; text: qsTr("Timeline")}
// ListElement { type: "Conversations";text: qsTr("Conversations")}
// ListElement { type: "Favorites";text: qsTr("Favorites") }
// ListElement { type: "PublicTimeline";text: qsTr("Public timeline") }
// ListElement { type: "DirectMessages";text: qsTr("Direct Messages") }
// ListElement { type: "Notifications";text: qsTr("Notifications") }
// ListElement { type: "Search";text: qsTr("Search") }
// ListElement { type: "Groupnews"; text: qsTr("Group News") }
// ListElement { type: "Quit";text: qsTr("Quit") }
// }
// currentIndex:(login.newsViewType=="Timeline")?0:1
// onCurrentIndexChanged:{
// //onActivated:{
// print(newscomboItems.get(currentIndex).type);
// switch(newscomboItems.get(currentIndex).type){
// case "Timeline":
// newstab.newstabstatus="Timeline";
// newsModel.clear();
// try{ Newsjs.newsfromdb(root.db,root.login.username, function(dbnews){
// showNews(dbnews)
// })}catch(e){Helperjs.showMessage("Error",e,root)}
// break;
// case "Conversations":
// newsModel.clear();
// newstab.newstabstatus="Conversations";
// Newsjs.chatsfromdb(db,root.login.username,function(news){showNews(news)})
// break;
// case "Favorites":
// newstab.newstabstatus="Favorites";
// root.contactLoadType="favorites";
// Service.updateView("Favorites");
// break;
// case "PublicTimeline":
// newstab.newstabstatus="Network";
// Service.updateView("Network");
// break;
// case "DirectMessages":
// newstab.newstabstatus="DirectMessages";
// Service.updateView("DirectMessages");
// break;
// case "Notifications":
// newstab.newstabstatus="Notifications";
// Service.updateView("Notifications");
// break;
// case "Search":
// newsView.anchors.topMargin=18*mm;
// newsSearch.visible=true
// break;
// case "Groupnews":
// Service.showGroups();
// break;
// case "Quit":
// Service.cleanNews(root.db,function(){
// Service.cleanContacts(root.login,root.db,function(){
// Qt.quit()})
// })
// }
// }
// }
BlueButton{ BlueButton{
id:newstabstatusButton id:newstabstatusButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0.5*mm anchors.topMargin: 0.5*mm
text: qsTr(newstab.newstabstatus) text: qsTr(newstab.newstabstatus)
onClicked: {newstabmenu.popup()} onClicked: {newstabmenu.popup()}
Menu{id:newstabmenu
MenuItem {
text: qsTr("Timeline")
onTriggered: {
newstab.newstabstatus="Timeline";
newsModel.clear();
try{ Newsjs.newsfromdb(root.db,root.login.username, function(dbnews){
showNews(dbnews)
})}catch(e){Helperjs.showMessage("Error",e,root)}}
}
MenuItem {
text: qsTr("Conversations")
onTriggered:{
newsModel.clear();
newstab.newstabstatus="Conversations";
Newsjs.chatsfromdb(db,root.login.username,function(news){showNews(news)})
}
}
MenuItem {
text: qsTr("Favorites")
onTriggered:{
newstab.newstabstatus="Favorites";
// root.contactLoadType="favorites";
Service.updateView("Favorites")
}
}
MenuItem {
text: qsTr("Public timeline")
onTriggered:{
newstab.newstabstatus="Public Timeline";
Service.updateView("Public Timeline")
}
}
MenuItem {
text: qsTr("Direct Messages")
onTriggered:{
newstab.newstabstatus="Direct Messages";
Service.updateView("Direct Messages")
}
}
MenuItem {
text: qsTr("Notifications")
onTriggered:{
newstab.newstabstatus="Notifications";
Service.updateView("Notifications")
}
}
MenuItem {
text: qsTr("Group news")
onTriggered:Service.showGroups();
}
MenuItem {
text: qsTr("Quit")
onTriggered:{
Service.cleanNews(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
Qt.quit()})
})
}
}
}
} }
Row{ Row{
@ -152,6 +346,20 @@ Item {
anchors.topMargin: 0.5*mm anchors.topMargin: 0.5*mm
anchors.right: parent.right anchors.right: parent.right
BlueButton {
id: searchButton
text: "\uf002"
onClicked: {
if (newsSearch.visible==false){
newsView.anchors.topMargin=18*mm;
newsSearch.visible=true}
else{
newsSearch.visible=false;
newsView.anchors.topMargin=7*mm;
}
}
}
BlueButton { BlueButton {
id: newMessageButton id: newMessageButton
text: "\uf040" text: "\uf040"
@ -166,32 +374,20 @@ Item {
},"isFriend",1); },"isFriend",1);
} }
} }
BlueButton { // BlueButton {
id: quitButton // id: quitButton
text: "\uf08b" // text: "\uf08b"
onClicked: {Service.cleanNews(root.db,function(){ // onClicked: {Service.cleanNews(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){ // Service.cleanContacts(root.login,root.db,function(){
Qt.quit() }) // Qt.quit() })
})} // })}
} // }
BlueButton { BlueButton {
id: update id: update
text: "\uf021" text: "\uf021"
onClicked: { onClicked: {
newsBusy.running=true;
newstab.newstabstatus=login.newsViewType;
root.contactLoadType="news"; root.contactLoadType="news";
var onlynew=true; Service.updateView(newstab.newstabstatus)
//print("newstab "+ JSON.stringify(contactlist));
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(ns,nc){
root.news=ns;root.newContacts=nc;
if (ns.length==0){// update last 20 existing news for changes and likes
onlynew=false;
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(rns,rnc){
root.contactLoadType="news";
root.news=rns;root.newContacts=rnc;})
}
})
} }
} }
@ -211,7 +407,6 @@ Item {
onClicked:{ onClicked:{
var currentTime= new Date(); var currentTime= new Date();
var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at; var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;
print("Lastnews ID "+lastnews_id+Qt.atob(newsModel.get(newsModel.count-1).newsitemobject.statusnet_html))
if(newstab.newstabstatus=="Timeline"){ if(newstab.newstabstatus=="Timeline"){
Newsjs.newsfromdb(root.db,root.login.username, function(news){ Newsjs.newsfromdb(root.db,root.login.username, function(news){
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true}; var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
@ -227,11 +422,27 @@ Item {
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true}; var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
newsWorker.sendMessage(msg); newsWorker.sendMessage(msg);
},newsModel.get(newsModel.count-1).newsitemobject.uid,lastnews_id)} },newsModel.get(newsModel.count-1).newsitemobject.uid,lastnews_id)}
} else if (newstab.newstabstatus=="Notifications"){}
else{
newsStack.appendNews=true;
xhr.setParam("max_id",newsModel.get(newsModel.count-1).newsitemobject.id-1);
xhr.get()
}}
} }
} }
} }
Rectangle{
id: newsSearch
color: "#FFFAFA"
y:8*mm
width:root.width
height: 8*mm
visible:false
Search{
anchors.fill: parent
anchors.margins: mm
}
}
ListView { ListView {
id: newsView id: newsView
anchors.fill: parent anchors.fill: parent
@ -245,19 +456,9 @@ Item {
delegate: Newsitem{} delegate: Newsitem{}
//onContentYChanged:{if(contentY<-8*mm&&contentY>(-8*mm-1)){print("refreshing"); //onContentYChanged:{if(contentY<-8*mm&&contentY>(-8*mm-1)){print("refreshing");
onDragEnded:{if(contentY<-5*mm){//print("refreshing"); onDragEnded:{if(contentY<-5*mm){//print("refreshing");
newsBusy.running=true;
newstab.newstabstatus=login.newsViewType;
root.contactLoadType="news"; root.contactLoadType="news";
var onlynew=true; var onlynew=true;
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(ns,nc){ Service.updateView(newstab.newstabstatus)
root.news=ns;root.newContacts=nc;
if (ns.length==0){// update last 20 existing news for changes and likes
onlynew=false;
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(rns,rnc){
root.contactLoadType="news";
root.news=rns;root.newContacts=rnc;})
}
})
}} }}
} }
@ -299,47 +500,7 @@ Item {
text:"" text:""
} }
} }
Menu {
id:newstabmenu
MenuItem {
text: qsTr("Timeline")
onTriggered: {
newstab.newstabstatus="Timeline";
newsModel.clear();
try{ Newsjs.newsfromdb(root.db,root.login.username, function(dbnews){
showNews(dbnews)
})}catch(e){Helperjs.showMessage("Error",e,root)}}
}
MenuItem {
text: qsTr("Favorites")
onTriggered:{
newstab.newstabstatus="Favorites";
root.contactLoadType="favorites";
newsBusy.running=true;
Newsjs.requestFavorites(root.login,db,root.contactlist,root,function(ns,nc){
root.news=ns; root.newContacts=nc;
})
}
}
MenuItem {
text: qsTr("Conversations")
onTriggered:{
newsModel.clear();
newstab.newstabstatus="Conversations";
Newsjs.chatsfromdb(db,root.login.username,function(news){showNews(news)})
}
}
MenuItem {
text: qsTr("Notifications")
onTriggered:{
newstab.newstabstatus="Notifications";
newsBusy.running=true;
Newsjs.getNotifications(root.login,db,root,function(news){
showNews(news)}
)}
}
}
Component.onCompleted: { Component.onCompleted: {
root.messageSignal.connect(onFriendsMessages); root.messageSignal.connect(onFriendsMessages);
root.directmessageSignal.connect(onDirectMessage); root.directmessageSignal.connect(onDirectMessage);
@ -347,17 +508,10 @@ Item {
root.uploadSignal.connect(sendUrls); root.uploadSignal.connect(sendUrls);
root.sendtextSignal.connect(sendtext); root.sendtextSignal.connect(sendtext);
try{newsModel.clear()} catch(e){} try{newsModel.clear()} catch(e){}
xhr.setLogin(login.username+":"+Qt.atob(login.password));
//print("imageUrls "+JSON.stringify(imageUrls)+" newsstack.depth:"+newsStack.depth); xhr.setUrl(login.server);
//newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{attachImageURLs:[imageUrl]}})
// var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
// osSettings.imagePickQml+'{multiple : true; onReady: {'+
// 'if(imageUrls.length==1){root.currentIndex=0;newstab.active=true;root.uploadSignal(imageUrls)} else{'+
// ' root.currentIndex=2;fotostab.active=true;'+
// 'root.uploadSignal(imageUrls)};}}',newstab,"imagePicker");
//SystemDispatcher.setInitialized();
if(root.news.length>0){showNews(root.news)} if(root.news.length>0){showNews(root.news)}
else{ newstab.newstabstatus=login.newsViewType; else{ newstab.newstabstatus=login.newsViewType;
if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})} if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
else{Newsjs.chatsfromdb(db,login.username,function(dbnews){showNews(dbnews)})} else{Newsjs.chatsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
} }

View File

@ -52,6 +52,11 @@ Item {
var component = Qt.createComponent("qrc:/qml/newsqml/FriendicaActivities.qml"); var component = Qt.createComponent("qrc:/qml/newsqml/FriendicaActivities.qml");
var imagedialog = component.createObject(friendicaActivities,{"activitymembers": contacts}); var imagedialog = component.createObject(friendicaActivities,{"activitymembers": contacts});
} }
function findTags(fulltext){
return fulltext.match(/\s+[#]+[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]+/g)
}
Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"} Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"}
Rectangle{ Rectangle{
@ -72,7 +77,8 @@ Item {
height: 7*mm height: 7*mm
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked:{showContact(newsitemobject.user)} onClicked:{
showContact(newsitemobject.user)}
} }
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"} onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
} }
@ -82,7 +88,7 @@ Item {
width:parent.width width:parent.width
font.pixelSize: 1.5*mm font.pixelSize: 1.5*mm
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: Qt.atob(newsitemobject.user.name)+forumname text: newsitemobject.user.name+forumname
} }
} }
Column { Column {
@ -143,7 +149,7 @@ Item {
linkColor: "light green" linkColor: "light green"
id: itemMessage id: itemMessage
textFormat: Text.RichText textFormat: Text.RichText
text:Qt.atob(newsitemobject.statusnet_html) text:newsitemobject.statusnet_html
width: newsitem.width-8*mm-2 width: newsitem.width-8*mm-2
height: Math.min(implicitHeight,3/4*root.height) height: Math.min(implicitHeight,3/4*root.height)
wrapMode: Text.Wrap wrapMode: Text.Wrap
@ -151,6 +157,14 @@ Item {
onLinkActivated:{ onLinkActivated:{
Qt.openUrlExternally(link)} Qt.openUrlExternally(link)}
Component.onCompleted:{ Component.onCompleted:{
if (newsitemobject.messagetype==0){
var hashtags=[];
hashtags=findTags(newsitemobject.text);
var component = Qt.createComponent("qrc:/qml/newsqml/Hashtag.qml");
for (var tags in hashtags){
var hashtagQml = component.createObject(friendicaActivities,{"text":hashtags[tags].trim()});
}}
if (newsitemobject.attachmentList.length>0){ if (newsitemobject.attachmentList.length>0){
for(var attachments in newsitemobject.attachmentList){// (newsitemobject.attachmentList[attachments].url); for(var attachments in newsitemobject.attachmentList){// (newsitemobject.attachmentList[attachments].url);
var attachcomponent = Qt.createQmlObject('import QtQuick 2.0; '+ var attachcomponent = Qt.createQmlObject('import QtQuick 2.0; '+
@ -198,7 +212,7 @@ Item {
text: friendica_activities.likeText text: friendica_activities.likeText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.like)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.like)}
} }
} }
Label{color: "grey" Label{color: "grey"
@ -207,7 +221,7 @@ Item {
text: friendica_activities.dislikeText text: friendica_activities.dislikeText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.dislike)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.dislike)}
} }
} }
Label{color: "grey" Label{color: "grey"
@ -216,7 +230,7 @@ Item {
text: friendica_activities.attendyesText text: friendica_activities.attendyesText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.attendyes)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendyes)}
}} }}
Label{color: "grey" Label{color: "grey"
height:3.5*mm height:3.5*mm
@ -224,7 +238,7 @@ Item {
text: friendica_activities.attendnoText text: friendica_activities.attendnoText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.attendno)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendno)}
} }
} }
Label{color: "grey" Label{color: "grey"
@ -233,7 +247,7 @@ Item {
text: friendica_activities.attendmaybeText text: friendica_activities.attendmaybeText
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.attendmaybe)} onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendmaybe)}
} }
} }
Label{ Label{
@ -267,8 +281,8 @@ Item {
} }
} }
onClicked: { onClicked: {
if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.status_id,root);dislikeCheckbox.checked=false; model.friendica_activities.self.liked=0 } if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.id,root);dislikeCheckbox.checked=false; model.friendica_activities.self.liked=0 }
else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.status_id,root); model.friendica_activities.self.liked=1}} else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.id,root); model.friendica_activities.self.liked=1}}
} }
CheckBox{ CheckBox{
id: dislikeCheckbox id: dislikeCheckbox
@ -289,8 +303,8 @@ Item {
} }
} }
onClicked: { onClicked: {
if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.status_id,root);likeCheckbox.checked=false; model.friendica_activities.self.disliked=0} if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.id,root);likeCheckbox.checked=false; model.friendica_activities.self.disliked=0}
else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.status_id,root); model.friendica_activities.self.disliked=1}} else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.id,root); model.friendica_activities.self.disliked=1}}
} }
CheckBox { CheckBox {
@ -312,22 +326,23 @@ Item {
checked:(newsitemobject.favorited>0) checked:(newsitemobject.favorited>0)
onClicked:{ onClicked:{
if(favoritedCheckbox.checkedState==Qt.Checked){ if(favoritedCheckbox.checkedState==Qt.Checked){
Newsjs.favorite(login,true,newsitemobject.status_id,root); model.newsitemobject.favorited=1} Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
else if(favoritedCheckbox.checkedState==Qt.Unchecked){ else if(favoritedCheckbox.checkedState==Qt.Unchecked){
Newsjs.favorite(login,false,newsitemobject.status_id,root);model.newsitemobject.favorited=0} Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
} }
} }
Rectangle{ Rectangle{
width: 10*mm width: 10*mm
height: 4*mm height: 4*mm
visible:(newsitemobject.messagetype!==2)
color:"transparent" color:"transparent"
Text{ Text{
id:newsmenusymbol id:newsmenusymbol
color: "grey" color: "grey"
anchors.centerIn: parent anchors.centerIn: parent
font.pixelSize: 2*mm font.pixelSize: 2.5*mm
font.bold: true font.family:fontAwesome.name
text: "\u22EE" text: "\uf142"
} }
MouseArea{ MouseArea{
anchors.fill:parent anchors.fill:parent
@ -336,7 +351,7 @@ Item {
Rectangle{ Rectangle{
width: 10*mm width: 10*mm
height: 4*mm height: 4*mm
visible:newstab.newstabstatus!="Conversation" visible:(newsitemobject.messagetype!==2)&&(newstab.newstabstatus!="Conversation")
color:"transparent" color:"transparent"
Text{ Text{
id:conversationsymbol id:conversationsymbol
@ -365,7 +380,7 @@ Item {
onTriggered: { onTriggered: {
var directmessage=0; var directmessage=0;
if (newsitemobject.messagetype==1){ directmessage=1} if (newsitemobject.messagetype==1){ directmessage=1}
newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.status_id,"login":root.login,"directmessage":directmessage}}); newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.id,"login":root.login,"directmessage":directmessage}});
} }
} }
MenuItem { MenuItem {
@ -377,7 +392,7 @@ Item {
MenuItem { MenuItem {
text: qsTr("Repost") text: qsTr("Repost")
onTriggered: { onTriggered: {
Newsjs.retweetNews(root.login,db,newsitemobject.status_id,root,function(reply){ Newsjs.retweetNews(root.login,db,newsitemobject.id,root,function(reply){
Helperjs.showMessage("Repost",qsTr("Success!"),root) Helperjs.showMessage("Repost",qsTr("Success!"),root)
}) })
} }
@ -396,17 +411,17 @@ Item {
title: qsTr("Attending") title: qsTr("Attending")
MenuItem{ MenuItem{
text:qsTr("yes") text:qsTr("yes")
onTriggered: {Newsjs.attend(root.login,db,"yes",newsitemobject.status_id,root,function(){ onTriggered: {Newsjs.attend(root.login,db,"yes",newsitemobject.id,root,function(){
model.friendica_activities.self.attending="yes";attending="yes"}) model.friendica_activities.self.attending="yes";attending="yes"})
} }
} }
MenuItem{text:qsTr("maybe") MenuItem{text:qsTr("maybe")
onTriggered: {Newsjs.attend(root.login,db,"maybe",newsitemobject.status_id,root,function(){ onTriggered: {Newsjs.attend(root.login,db,"maybe",newsitemobject.id,root,function(){
model.friendica_activities.self.attending="maybe";attending="maybe"}) model.friendica_activities.self.attending="maybe";attending="maybe"})
} }
} }
MenuItem{text:qsTr("no") MenuItem{text:qsTr("no")
onTriggered: {Newsjs.attend(root.login,db,"no",newsitemobject.status_id,root,function(){ onTriggered: {Newsjs.attend(root.login,db,"no",newsitemobject.id,root,function(){
model.friendica_activities.self.attending="no";attending="no"})} model.friendica_activities.self.attending="no";attending="no"})}
} }
} }
@ -414,7 +429,7 @@ Item {
MenuItem { MenuItem {
text: qsTr("Delete") text: qsTr("Delete")
onTriggered: { onTriggered: {
Newsjs.deleteNews(root.login,root.db,newsitemobject.status_id,newsitemobject.messagetype,root,function(reply){ Newsjs.deleteNews(root.login,root.db,newsitemobject.id,newsitemobject.messagetype,root,function(reply){
var msg = {'deleteId': index, 'model': newsModel}; var msg = {'deleteId': index, 'model': newsModel};
newsWorker.sendMessage(msg); newsWorker.sendMessage(msg);
}) })

View File

@ -104,7 +104,7 @@ Package {
Component.onCompleted:{ Component.onCompleted:{
try {photoModel.clear()}catch (e){print(e)} try {photoModel.clear()}catch (e){print(e)}
if(foreignPicture){ if(foreignPicture){
Imagejs.newRequestFriendsPictures(login,albumlink,friend,remoteContact,remoteauth,root,function(obj){ Imagejs.newRequestFriendsPictures(login,albumlink,friend,photoStack.remoteContact,remoteauth,root,function(obj){
if (obj) { if (obj) {
for (var k=0;k<obj.length;k++){ for (var k=0;k<obj.length;k++){
photoModel.append({"imageLocation": obj[k].thumb,"photoDescription":obj[k].name,"photoLink":obj[k].link}) photoModel.append({"imageLocation": obj[k].thumb,"photoDescription":obj[k].name,"photoLink":obj[k].link})

View File

@ -17,76 +17,76 @@
<context> <context>
<name>ConfigTab</name> <name>ConfigTab</name>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="78"/> <location filename="../qml/configqml/ConfigTab.qml" line="69"/>
<location filename="../qml/configqml/ConfigTab.qml" line="362"/> <location filename="../qml/configqml/ConfigTab.qml" line="351"/>
<location filename="../qml/configqml/ConfigTab.qml" line="384"/> <location filename="../qml/configqml/ConfigTab.qml" line="374"/>
<source>User</source> <source>User</source>
<translation>Name</translation> <translation>Name</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="105"/> <location filename="../qml/configqml/ConfigTab.qml" line="96"/>
<source>Server</source> <source>Server</source>
<translation>Server</translation> <translation>Server</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="109"/> <location filename="../qml/configqml/ConfigTab.qml" line="100"/>
<source>Nickname</source> <source>Nickname</source>
<translation>Kurzname</translation> <translation>Kurzname</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="114"/> <location filename="../qml/configqml/ConfigTab.qml" line="105"/>
<source>Password</source> <source>Password</source>
<translation>Passwort</translation> <translation>Passwort</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="118"/> <location filename="../qml/configqml/ConfigTab.qml" line="109"/>
<source>Image dir.</source> <source>Image dir.</source>
<translation>Bildverz.</translation> <translation>Bildverz.</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="123"/> <location filename="../qml/configqml/ConfigTab.qml" line="114"/>
<source>Max. News</source> <source>Max. News</source>
<translation>Max. Nachr.</translation> <translation>Max. Nachr.</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="127"/> <location filename="../qml/configqml/ConfigTab.qml" line="118"/>
<source>News as</source> <source>News as</source>
<translation>Anzeige</translation> <translation>Anzeige</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="131"/> <location filename="../qml/configqml/ConfigTab.qml" line="122"/>
<source>Interval (0=None)</source> <source>Interval (0=None)</source>
<translation>Intervall (0=keins)</translation> <translation>Intervall (0=keins)</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<location filename="../qml/configqml/ConfigTab.qml" line="340"/> <location filename="../qml/configqml/ConfigTab.qml" line="328"/>
<source>Error</source> <source>Error</source>
<translation>Fehler</translation> <translation>Fehler</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<source>Nickname not registered at given server!</source> <source>Nickname not registered at given server!</source>
<translation>Name auf der Seite nicht registriert!</translation> <translation>Name auf der Seite nicht registriert!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="301"/> <location filename="../qml/configqml/ConfigTab.qml" line="289"/>
<source>Confirm</source> <source>Confirm</source>
<translation>Bestätigen</translation> <translation>Bestätigen</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="305"/> <location filename="../qml/configqml/ConfigTab.qml" line="293"/>
<source>No server given! </source> <source>No server given! </source>
<translation>Kein Server angegeben!</translation> <translation>Kein Server angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="306"/> <location filename="../qml/configqml/ConfigTab.qml" line="294"/>
<source>No nickname given! </source> <source>No nickname given! </source>
<translation>Kein Kurzname angegeben!</translation> <translation>Kein Kurzname angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="307"/> <location filename="../qml/configqml/ConfigTab.qml" line="295"/>
<source>Nickname not registered at given server! </source> <source>Nickname not registered at given server! </source>
<translation>Name auf der Seite nicht registriert!</translation> <translation>Name auf der Seite nicht registriert!</translation>
</message> </message>
@ -95,42 +95,42 @@
<translation type="vanished">Kein Nutzername angegeben!</translation> <translation type="vanished">Kein Nutzername angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="308"/> <location filename="../qml/configqml/ConfigTab.qml" line="296"/>
<source>No password given! </source> <source>No password given! </source>
<translation>Kein Passwort angegeben!</translation> <translation>Kein Passwort angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="309"/> <location filename="../qml/configqml/ConfigTab.qml" line="297"/>
<source>No image directory given!</source> <source>No image directory given!</source>
<translation>Kein Verzeichnis für Bilder angegeben!</translation> <translation>Kein Verzeichnis für Bilder angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="310"/> <location filename="../qml/configqml/ConfigTab.qml" line="298"/>
<source>No maximum news number given!</source> <source>No maximum news number given!</source>
<translation>Maximale News-Anzahl nicht angegeben!</translation> <translation>Maximale News-Anzahl nicht angegeben!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<source>Wrong password!</source> <source>Wrong password!</source>
<translation>Falsches Passwort!</translation> <translation>Falsches Passwort!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Success</source> <source>Success</source>
<translation>Bestätigt</translation> <translation>Bestätigt</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Name</source> <source>Name</source>
<translation>Name</translation> <translation>Name</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="399"/> <location filename="../qml/configqml/ConfigTab.qml" line="389"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Chronologisch</translation> <translation>Chronologisch</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="403"/> <location filename="../qml/configqml/ConfigTab.qml" line="393"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Unterhaltungen</translation> <translation>Unterhaltungen</translation>
</message> </message>
@ -189,12 +189,12 @@
<translation>Freunde</translation> <translation>Freunde</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="200"/> <location filename="../qml/contactqml/FriendsTab.qml" line="202"/>
<source>Contacts</source> <source>Contacts</source>
<translation>Kontakte</translation> <translation>Kontakte</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="253"/> <location filename="../qml/contactqml/FriendsTab.qml" line="259"/>
<source>Groups</source> <source>Groups</source>
<translation>Gruppen</translation> <translation>Gruppen</translation>
</message> </message>
@ -213,32 +213,37 @@
<context> <context>
<name>ImageUploadDialog</name> <name>ImageUploadDialog</name>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="127"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="100"/>
<source>Upload to album</source>
<translation>In Album hochladen</translation>
</message>
<message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="121"/>
<source>Album</source> <source>Album</source>
<translation>Album</translation> <translation>Album</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="132"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="126"/>
<source>Image</source> <source>Image</source>
<translation>Bild</translation> <translation>Bild</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="137"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="131"/>
<source>Description</source> <source>Description</source>
<translation>Beschreibung</translation> <translation>Beschreibung</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="236"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="229"/>
<source>Upload</source> <source>Upload</source>
<translation>Hochladen</translation> <translation>Hochladen</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source>Error</source> <source>Error</source>
<translation>Fehler</translation> <translation>Fehler</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source> No album name given</source> <source> No album name given</source>
<translation>Kein Albumname angegeben</translation> <translation>Kein Albumname angegeben</translation>
</message> </message>
@ -246,17 +251,17 @@
<context> <context>
<name>MessageSend</name> <name>MessageSend</name>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="98"/> <location filename="../qml/newsqml/MessageSend.qml" line="111"/>
<source>Title (optional)</source> <source>Title (optional)</source>
<translation>Überschrift (optional)</translation> <translation>Überschrift (optional)</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Error</source> <source>Error</source>
<translation>Fehler</translation> <translation>Fehler</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Only one attachment supported at the moment. <source>Only one attachment supported at the moment.
Remove other attachment first!</source> Remove other attachment first!</source>
<translation>Nur ein Anhang derzeit unterstützt. <translation>Nur ein Anhang derzeit unterstützt.
@ -270,30 +275,55 @@
<translation type="vanished">Lade Profilbild für </translation> <translation type="vanished">Lade Profilbild für </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="204"/> <location filename="../qml/newsqml/NewsTab.qml" line="404"/>
<source>More</source> <source>More</source>
<translation>Mehr</translation> <translation>Mehr</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="301"/> <location filename="../qml/newsqml/NewsTab.qml" line="281"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Chronologisch</translation> <translation>Chronologisch</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="310"/> <location filename="../qml/newsqml/NewsTab.qml" line="63"/>
<source>Error</source>
<translation>Fehler</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="298"/>
<source>Favorites</source> <source>Favorites</source>
<translation>Markierte News</translation> <translation>Markierte News</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="322"/> <location filename="../qml/newsqml/NewsTab.qml" line="290"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Unterhaltungen</translation> <translation>Unterhaltungen</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="330"/> <location filename="../qml/newsqml/NewsTab.qml" line="306"/>
<source>Public timeline</source>
<translation>Gemeinschaft</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="314"/>
<source>Direct Messages</source>
<translation>Direktnachrichten</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="321"/>
<source>Notifications</source> <source>Notifications</source>
<translation>Meldungen</translation> <translation>Meldungen</translation>
</message> </message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="328"/>
<source>Group news</source>
<translation>News Gruppe</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="332"/>
<source>Quit</source>
<translation>Schliessen</translation>
</message>
</context> </context>
<context> <context>
<name>Newsitem</name> <name>Newsitem</name>
@ -303,77 +333,77 @@
<translation>Teilnahme</translation> <translation>Teilnahme</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="99"/> <location filename="../qml/newsqml/Newsitem.qml" line="105"/>
<source>Source: </source> <source>Source: </source>
<translation>Quelle: </translation> <translation>Quelle: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="100"/> <location filename="../qml/newsqml/Newsitem.qml" line="106"/>
<source>Direct Message</source> <source>Direct Message</source>
<translation>Direktnachricht</translation> <translation>Direktnachricht</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="115"/> <location filename="../qml/newsqml/Newsitem.qml" line="121"/>
<source>In reply to </source> <source>In reply to </source>
<translation>Antwort an </translation> <translation>Antwort an </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="127"/> <location filename="../qml/newsqml/Newsitem.qml" line="133"/>
<source> comments</source> <source> comments</source>
<translation> Kommentare</translation> <translation> Kommentare</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="221"/> <location filename="../qml/newsqml/Newsitem.qml" line="258"/>
<source>Attending: </source> <source>Attending: </source>
<translation>Teilnahme: </translation> <translation>Teilnahme: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="343"/> <location filename="../qml/newsqml/Newsitem.qml" line="378"/>
<source>Reply</source> <source>Reply</source>
<translation>Antworten</translation> <translation>Antworten</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="351"/> <location filename="../qml/newsqml/Newsitem.qml" line="386"/>
<source>DM</source> <source>DM</source>
<translation>Direktnachricht</translation> <translation>Direktnachricht</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="357"/> <location filename="../qml/newsqml/Newsitem.qml" line="392"/>
<source>Repost</source> <source>Repost</source>
<translation>Teilen</translation> <translation>Teilen</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="360"/> <location filename="../qml/newsqml/Newsitem.qml" line="395"/>
<source>Success!</source> <source>Success!</source>
<translation>Erledigt!</translation> <translation>Erledigt!</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="365"/> <location filename="../qml/newsqml/Newsitem.qml" line="400"/>
<source>Conversation</source> <source>Conversation</source>
<translation>Unterhaltung</translation> <translation>Unterhaltung</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="376"/> <location filename="../qml/newsqml/Newsitem.qml" line="410"/>
<source>Attending</source> <source>Attending</source>
<translation>Teilnahme</translation> <translation>Teilnahme</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="378"/> <location filename="../qml/newsqml/Newsitem.qml" line="412"/>
<source>yes</source> <source>yes</source>
<translation>ja</translation> <translation>ja</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="383"/> <location filename="../qml/newsqml/Newsitem.qml" line="417"/>
<source>maybe</source> <source>maybe</source>
<translation>vielleicht</translation> <translation>vielleicht</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="388"/> <location filename="../qml/newsqml/Newsitem.qml" line="422"/>
<source>no</source> <source>no</source>
<translation>nein</translation> <translation>nein</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="395"/> <location filename="../qml/newsqml/Newsitem.qml" line="429"/>
<source>Delete</source> <source>Delete</source>
<translation>Löschen</translation> <translation>Löschen</translation>
</message> </message>
@ -394,28 +424,28 @@
<context> <context>
<name>PhotoTab</name> <name>PhotoTab</name>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="115"/> <location filename="../qml/photoqml/PhotoTab.qml" line="121"/>
<source>&apos;s images</source> <source>&apos;s images</source>
<translation>s Bilder</translation> <translation>s Bilder</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="167"/> <location filename="../qml/photoqml/PhotoTab.qml" line="178"/>
<source>All Images</source> <source>All Images</source>
<translation>Alle Bilder</translation> <translation>Alle Bilder</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="172"/> <location filename="../qml/photoqml/PhotoTab.qml" line="183"/>
<source>Only new</source> <source>Only new</source>
<translation>Nur neue</translation> <translation>Nur neue</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="186"/> <location filename="../qml/photoqml/PhotoTab.qml" line="197"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="190"/> <location filename="../qml/photoqml/PhotoTab.qml" line="201"/>
<source>Own Images</source> <source>Own Images</source>
<translation>Eigene Bilder</translation> <translation>Eigene Bilder</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="227"/> <location filename="../qml/photoqml/PhotoTab.qml" line="238"/>
<source>More</source> <source>More</source>
<translation>Mehr</translation> <translation>Mehr</translation>
</message> </message>
@ -613,32 +643,32 @@
<translation>Aktualisieren</translation> <translation>Aktualisieren</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="206"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="208"/>
<source>profile id</source> <source>profile id</source>
<translation>Profil-Nummer</translation> <translation>Profil-Nummer</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Description</source> <source>Description</source>
<translation>Beschreibung</translation> <translation>Beschreibung</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Location</source> <source>Location</source>
<translation>Ort</translation> <translation>Ort</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Posts</source> <source>Posts</source>
<translation>Beiträge</translation> <translation>Beiträge</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="230"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="233"/>
<source>URL</source> <source>URL</source>
<translation>Profilseite</translation> <translation>Profilseite</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="231"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="234"/>
<source>Created at</source> <source>Created at</source>
<translation>Erstellt</translation> <translation>Erstellt</translation>
</message> </message>
@ -714,27 +744,26 @@
<translation>Personen nehmen vielleicht teil.</translation> <translation>Personen nehmen vielleicht teil.</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="77"/> <location filename="../js/newsworker.js" line="78"/>
<source>yes</source> <source>yes</source>
<translation>ja</translation> <translation>ja</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="78"/> <location filename="../js/newsworker.js" line="79"/>
<source>no</source> <source>no</source>
<translation>nein</translation> <translation>nein</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="79"/> <location filename="../js/newsworker.js" line="80"/>
<source>maybe</source> <source>maybe</source>
<translation>vielleicht</translation> <translation>vielleicht</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/> <location filename="../js/newsworker.js" line="96"/>
<source>seconds</source> <source>seconds</source>
<translation>Sekunden</translation> <translation>Sekunden</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="96"/>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="97"/>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="98"/>
@ -744,53 +773,64 @@
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="102"/>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="103"/>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="104"/>
<location filename="../js/newsworker.js" line="105"/>
<source>ago</source> <source>ago</source>
<translation>her</translation> <translation>her</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="97"/>
<source>minute</source> <source>minute</source>
<translation>Minute</translation> <translation>Minute</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="98"/>
<source>minutes</source> <source>minutes</source>
<translation>Minuten</translation> <translation>Minuten</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="99"/>
<source>hour</source> <source>hour</source>
<translation>Stunde</translation> <translation>Stunde</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="99"/> <location filename="../js/newsworker.js" line="100"/>
<source>hours</source> <source>hours</source>
<translation>Stunden</translation> <translation>Stunden</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="100"/> <location filename="../js/newsworker.js" line="101"/>
<source>day</source> <source>day</source>
<translation>Tag</translation> <translation>Tag</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="101"/> <location filename="../js/newsworker.js" line="102"/>
<source>days</source> <source>days</source>
<translation>Tage</translation> <translation>Tage</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="103"/>
<source>month</source> <source>month</source>
<translation>Monat</translation> <translation>Monat</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="104"/>
<source>months</source> <source>months</source>
<translation>Monate</translation> <translation>Monate</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="105"/>
<source>years</source> <source>years</source>
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context>
<name>service</name>
<message>
<location filename="../js/service.js" line="360"/>
<location filename="../js/service.js" line="362"/>
<location filename="../js/service.js" line="365"/>
<source>Error</source>
<translation>Fehler</translation>
</message>
</context>
</TS> </TS>

View File

@ -17,76 +17,76 @@
<context> <context>
<name>ConfigTab</name> <name>ConfigTab</name>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="78"/> <location filename="../qml/configqml/ConfigTab.qml" line="69"/>
<location filename="../qml/configqml/ConfigTab.qml" line="362"/> <location filename="../qml/configqml/ConfigTab.qml" line="351"/>
<location filename="../qml/configqml/ConfigTab.qml" line="384"/> <location filename="../qml/configqml/ConfigTab.qml" line="374"/>
<source>User</source> <source>User</source>
<translation>Usuario</translation> <translation>Usuario</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="105"/> <location filename="../qml/configqml/ConfigTab.qml" line="96"/>
<source>Server</source> <source>Server</source>
<translation>Servidor</translation> <translation>Servidor</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="109"/> <location filename="../qml/configqml/ConfigTab.qml" line="100"/>
<source>Nickname</source> <source>Nickname</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="114"/> <location filename="../qml/configqml/ConfigTab.qml" line="105"/>
<source>Password</source> <source>Password</source>
<translation>Contraseña</translation> <translation>Contraseña</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="118"/> <location filename="../qml/configqml/ConfigTab.qml" line="109"/>
<source>Image dir.</source> <source>Image dir.</source>
<translation>Dir. de imágenes</translation> <translation>Dir. de imágenes</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="123"/> <location filename="../qml/configqml/ConfigTab.qml" line="114"/>
<source>Max. News</source> <source>Max. News</source>
<translation> Max. de noticias.</translation> <translation> Max. de noticias.</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="127"/> <location filename="../qml/configqml/ConfigTab.qml" line="118"/>
<source>News as</source> <source>News as</source>
<translation>Noticias como</translation> <translation>Noticias como</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="131"/> <location filename="../qml/configqml/ConfigTab.qml" line="122"/>
<source>Interval (0=None)</source> <source>Interval (0=None)</source>
<translation>Intervalo (0=ningún)</translation> <translation>Intervalo (0=ningún)</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<location filename="../qml/configqml/ConfigTab.qml" line="340"/> <location filename="../qml/configqml/ConfigTab.qml" line="328"/>
<source>Error</source> <source>Error</source>
<translation type="unfinished">Error</translation> <translation type="unfinished">Error</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<source>Nickname not registered at given server!</source> <source>Nickname not registered at given server!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="301"/> <location filename="../qml/configqml/ConfigTab.qml" line="289"/>
<source>Confirm</source> <source>Confirm</source>
<translation>Confirmar</translation> <translation>Confirmar</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="305"/> <location filename="../qml/configqml/ConfigTab.qml" line="293"/>
<source>No server given! </source> <source>No server given! </source>
<translation>¡Servidor no encontrado!</translation> <translation>¡Servidor no encontrado!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="306"/> <location filename="../qml/configqml/ConfigTab.qml" line="294"/>
<source>No nickname given! </source> <source>No nickname given! </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="307"/> <location filename="../qml/configqml/ConfigTab.qml" line="295"/>
<source>Nickname not registered at given server! </source> <source>Nickname not registered at given server! </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -95,42 +95,42 @@
<translation type="vanished">¡Usuario incorrecto!</translation> <translation type="vanished">¡Usuario incorrecto!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="308"/> <location filename="../qml/configqml/ConfigTab.qml" line="296"/>
<source>No password given! </source> <source>No password given! </source>
<translation>¡Contraseña incorrecta!</translation> <translation>¡Contraseña incorrecta!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="309"/> <location filename="../qml/configqml/ConfigTab.qml" line="297"/>
<source>No image directory given!</source> <source>No image directory given!</source>
<translation>¡No se ha encontrado el directorio de imágenes!</translation> <translation>¡No se ha encontrado el directorio de imágenes!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="310"/> <location filename="../qml/configqml/ConfigTab.qml" line="298"/>
<source>No maximum news number given!</source> <source>No maximum news number given!</source>
<translation>¡ máximo de noticias incorrecto!</translation> <translation>¡ máximo de noticias incorrecto!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<source>Wrong password!</source> <source>Wrong password!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Success</source> <source>Success</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="399"/> <location filename="../qml/configqml/ConfigTab.qml" line="389"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Cronología</translation> <translation>Cronología</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="403"/> <location filename="../qml/configqml/ConfigTab.qml" line="393"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Conversaciones</translation> <translation>Conversaciones</translation>
</message> </message>
@ -189,12 +189,12 @@
<translation>Amigos</translation> <translation>Amigos</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="200"/> <location filename="../qml/contactqml/FriendsTab.qml" line="202"/>
<source>Contacts</source> <source>Contacts</source>
<translation>Contactos</translation> <translation>Contactos</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="253"/> <location filename="../qml/contactqml/FriendsTab.qml" line="259"/>
<source>Groups</source> <source>Groups</source>
<translation>Grupos</translation> <translation>Grupos</translation>
</message> </message>
@ -202,32 +202,37 @@
<context> <context>
<name>ImageUploadDialog</name> <name>ImageUploadDialog</name>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="127"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="100"/>
<source>Upload to album</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="121"/>
<source>Album</source> <source>Album</source>
<translation>álbum</translation> <translation>álbum</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="132"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="126"/>
<source>Image</source> <source>Image</source>
<translation>imagen</translation> <translation>imagen</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="137"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="131"/>
<source>Description</source> <source>Description</source>
<translation>Descripción</translation> <translation>Descripción</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="236"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="229"/>
<source>Upload</source> <source>Upload</source>
<translation>Subir</translation> <translation>Subir</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source>Error</source> <source>Error</source>
<translation>Error</translation> <translation>Error</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source> No album name given</source> <source> No album name given</source>
<translation>¡Nombre del álbum no encontrado!</translation> <translation>¡Nombre del álbum no encontrado!</translation>
</message> </message>
@ -235,17 +240,17 @@
<context> <context>
<name>MessageSend</name> <name>MessageSend</name>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="98"/> <location filename="../qml/newsqml/MessageSend.qml" line="111"/>
<source>Title (optional)</source> <source>Title (optional)</source>
<translation>Título (opcional)</translation> <translation>Título (opcional)</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Error</source> <source>Error</source>
<translation>Error</translation> <translation>Error</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Only one attachment supported at the moment. <source>Only one attachment supported at the moment.
Remove other attachment first!</source> Remove other attachment first!</source>
<translation>Solo se admite adjuntar un solo archivo en este momento. <translation>Solo se admite adjuntar un solo archivo en este momento.
@ -259,30 +264,55 @@
<translation type="vanished">Descargar la imagen del perfil para </translation> <translation type="vanished">Descargar la imagen del perfil para </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="204"/> <location filename="../qml/newsqml/NewsTab.qml" line="404"/>
<source>More</source> <source>More</source>
<translation>Mas</translation> <translation>Mas</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="301"/> <location filename="../qml/newsqml/NewsTab.qml" line="281"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Cronología</translation> <translation>Cronología</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="310"/> <location filename="../qml/newsqml/NewsTab.qml" line="63"/>
<source>Error</source>
<translation type="unfinished">Error</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="298"/>
<source>Favorites</source> <source>Favorites</source>
<translation>Favoritos</translation> <translation>Favoritos</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="322"/> <location filename="../qml/newsqml/NewsTab.qml" line="290"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Conversaciones</translation> <translation>Conversaciones</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="330"/> <location filename="../qml/newsqml/NewsTab.qml" line="306"/>
<source>Public timeline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="314"/>
<source>Direct Messages</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="321"/>
<source>Notifications</source> <source>Notifications</source>
<translation>Notificaciones</translation> <translation>Notificaciones</translation>
</message> </message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="328"/>
<source>Group news</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="332"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Newsitem</name> <name>Newsitem</name>
@ -292,77 +322,77 @@
<translation>Asistiendo: </translation> <translation>Asistiendo: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="99"/> <location filename="../qml/newsqml/Newsitem.qml" line="105"/>
<source>Source: </source> <source>Source: </source>
<translation>Fuente: </translation> <translation>Fuente: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="100"/> <location filename="../qml/newsqml/Newsitem.qml" line="106"/>
<source>Direct Message</source> <source>Direct Message</source>
<translation>Mensaje directo</translation> <translation>Mensaje directo</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="115"/> <location filename="../qml/newsqml/Newsitem.qml" line="121"/>
<source>In reply to </source> <source>In reply to </source>
<translation>En respuesta a </translation> <translation>En respuesta a </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="127"/> <location filename="../qml/newsqml/Newsitem.qml" line="133"/>
<source> comments</source> <source> comments</source>
<translation> comentarios</translation> <translation> comentarios</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="221"/> <location filename="../qml/newsqml/Newsitem.qml" line="258"/>
<source>Attending: </source> <source>Attending: </source>
<translation>Asistiendo: </translation> <translation>Asistiendo: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="343"/> <location filename="../qml/newsqml/Newsitem.qml" line="378"/>
<source>Reply</source> <source>Reply</source>
<translation>Respuesta</translation> <translation>Respuesta</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="351"/> <location filename="../qml/newsqml/Newsitem.qml" line="386"/>
<source>DM</source> <source>DM</source>
<translation>Mensaje directo</translation> <translation>Mensaje directo</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="357"/> <location filename="../qml/newsqml/Newsitem.qml" line="392"/>
<source>Repost</source> <source>Repost</source>
<translation>Volver a publicar</translation> <translation>Volver a publicar</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="360"/> <location filename="../qml/newsqml/Newsitem.qml" line="395"/>
<source>Success!</source> <source>Success!</source>
<translation>éxito!</translation> <translation>éxito!</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="365"/> <location filename="../qml/newsqml/Newsitem.qml" line="400"/>
<source>Conversation</source> <source>Conversation</source>
<translation>Conversación</translation> <translation>Conversación</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="376"/> <location filename="../qml/newsqml/Newsitem.qml" line="410"/>
<source>Attending</source> <source>Attending</source>
<translation>Asistiendo</translation> <translation>Asistiendo</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="378"/> <location filename="../qml/newsqml/Newsitem.qml" line="412"/>
<source>yes</source> <source>yes</source>
<translation>si</translation> <translation>si</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="383"/> <location filename="../qml/newsqml/Newsitem.qml" line="417"/>
<source>maybe</source> <source>maybe</source>
<translation>quizás</translation> <translation>quizás</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="388"/> <location filename="../qml/newsqml/Newsitem.qml" line="422"/>
<source>no</source> <source>no</source>
<translation>no</translation> <translation>no</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="395"/> <location filename="../qml/newsqml/Newsitem.qml" line="429"/>
<source>Delete</source> <source>Delete</source>
<translation>Borrar</translation> <translation>Borrar</translation>
</message> </message>
@ -383,28 +413,28 @@
<context> <context>
<name>PhotoTab</name> <name>PhotoTab</name>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="115"/> <location filename="../qml/photoqml/PhotoTab.qml" line="121"/>
<source>&apos;s images</source> <source>&apos;s images</source>
<translation>s Imágenes</translation> <translation>s Imágenes</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="167"/> <location filename="../qml/photoqml/PhotoTab.qml" line="178"/>
<source>All Images</source> <source>All Images</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="172"/> <location filename="../qml/photoqml/PhotoTab.qml" line="183"/>
<source>Only new</source> <source>Only new</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="186"/> <location filename="../qml/photoqml/PhotoTab.qml" line="197"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="190"/> <location filename="../qml/photoqml/PhotoTab.qml" line="201"/>
<source>Own Images</source> <source>Own Images</source>
<translation>Mis imágenes</translation> <translation>Mis imágenes</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="227"/> <location filename="../qml/photoqml/PhotoTab.qml" line="238"/>
<source>More</source> <source>More</source>
<translation>Mas</translation> <translation>Mas</translation>
</message> </message>
@ -602,32 +632,32 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="206"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="208"/>
<source>profile id</source> <source>profile id</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Description</source> <source>Description</source>
<translation type="unfinished">Descripción</translation> <translation type="unfinished">Descripción</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Location</source> <source>Location</source>
<translation type="unfinished">Localización</translation> <translation type="unfinished">Localización</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Posts</source> <source>Posts</source>
<translation type="unfinished">Mensajes</translation> <translation type="unfinished">Mensajes</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="230"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="233"/>
<source>URL</source> <source>URL</source>
<translation type="unfinished">URL</translation> <translation type="unfinished">URL</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="231"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="234"/>
<source>Created at</source> <source>Created at</source>
<translation type="unfinished">Creado en</translation> <translation type="unfinished">Creado en</translation>
</message> </message>
@ -703,27 +733,26 @@
<translation>Personas que pueden asistir.</translation> <translation>Personas que pueden asistir.</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="77"/> <location filename="../js/newsworker.js" line="78"/>
<source>yes</source> <source>yes</source>
<translation>si</translation> <translation>si</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="78"/> <location filename="../js/newsworker.js" line="79"/>
<source>no</source> <source>no</source>
<translation>no</translation> <translation>no</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="79"/> <location filename="../js/newsworker.js" line="80"/>
<source>maybe</source> <source>maybe</source>
<translation>quizás</translation> <translation>quizás</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/> <location filename="../js/newsworker.js" line="96"/>
<source>seconds</source> <source>seconds</source>
<translation>Segundos</translation> <translation>Segundos</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="96"/>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="97"/>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="98"/>
@ -733,53 +762,64 @@
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="102"/>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="103"/>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="104"/>
<location filename="../js/newsworker.js" line="105"/>
<source>ago</source> <source>ago</source>
<translation>hace</translation> <translation>hace</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="97"/>
<source>minute</source> <source>minute</source>
<translation>Minuto</translation> <translation>Minuto</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="98"/>
<source>minutes</source> <source>minutes</source>
<translation>Minutos</translation> <translation>Minutos</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="99"/>
<source>hour</source> <source>hour</source>
<translation>Hora</translation> <translation>Hora</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="99"/> <location filename="../js/newsworker.js" line="100"/>
<source>hours</source> <source>hours</source>
<translation>Horas</translation> <translation>Horas</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="100"/> <location filename="../js/newsworker.js" line="101"/>
<source>day</source> <source>day</source>
<translation>Dia</translation> <translation>Dia</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="101"/> <location filename="../js/newsworker.js" line="102"/>
<source>days</source> <source>days</source>
<translation>Dias</translation> <translation>Dias</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="103"/>
<source>month</source> <source>month</source>
<translation>Mes</translation> <translation>Mes</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="104"/>
<source>months</source> <source>months</source>
<translation>Meses</translation> <translation>Meses</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="105"/>
<source>years</source> <source>years</source>
<translation>Años</translation> <translation>Años</translation>
</message> </message>
</context> </context>
<context>
<name>service</name>
<message>
<location filename="../js/service.js" line="360"/>
<location filename="../js/service.js" line="362"/>
<location filename="../js/service.js" line="365"/>
<source>Error</source>
<translation type="unfinished">Error</translation>
</message>
</context>
</TS> </TS>

View File

@ -17,76 +17,76 @@
<context> <context>
<name>ConfigTab</name> <name>ConfigTab</name>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="78"/> <location filename="../qml/configqml/ConfigTab.qml" line="69"/>
<location filename="../qml/configqml/ConfigTab.qml" line="362"/> <location filename="../qml/configqml/ConfigTab.qml" line="351"/>
<location filename="../qml/configqml/ConfigTab.qml" line="384"/> <location filename="../qml/configqml/ConfigTab.qml" line="374"/>
<source>User</source> <source>User</source>
<translation>Utente</translation> <translation>Utente</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="105"/> <location filename="../qml/configqml/ConfigTab.qml" line="96"/>
<source>Server</source> <source>Server</source>
<translation>Server</translation> <translation>Server</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="109"/> <location filename="../qml/configqml/ConfigTab.qml" line="100"/>
<source>Nickname</source> <source>Nickname</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="114"/> <location filename="../qml/configqml/ConfigTab.qml" line="105"/>
<source>Password</source> <source>Password</source>
<translation>Password</translation> <translation>Password</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="118"/> <location filename="../qml/configqml/ConfigTab.qml" line="109"/>
<source>Image dir.</source> <source>Image dir.</source>
<translation>Directory immagini</translation> <translation>Directory immagini</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="123"/> <location filename="../qml/configqml/ConfigTab.qml" line="114"/>
<source>Max. News</source> <source>Max. News</source>
<translation> Max. di notizie</translation> <translation> Max. di notizie</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="127"/> <location filename="../qml/configqml/ConfigTab.qml" line="118"/>
<source>News as</source> <source>News as</source>
<translation>News come</translation> <translation>News come</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="131"/> <location filename="../qml/configqml/ConfigTab.qml" line="122"/>
<source>Interval (0=None)</source> <source>Interval (0=None)</source>
<translation>Intervallo (0=nessuno)</translation> <translation>Intervallo (0=nessuno)</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<location filename="../qml/configqml/ConfigTab.qml" line="340"/> <location filename="../qml/configqml/ConfigTab.qml" line="328"/>
<source>Error</source> <source>Error</source>
<translation type="unfinished">Errore</translation> <translation type="unfinished">Errore</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="201"/> <location filename="../qml/configqml/ConfigTab.qml" line="188"/>
<source>Nickname not registered at given server!</source> <source>Nickname not registered at given server!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="301"/> <location filename="../qml/configqml/ConfigTab.qml" line="289"/>
<source>Confirm</source> <source>Confirm</source>
<translation>Conferma</translation> <translation>Conferma</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="305"/> <location filename="../qml/configqml/ConfigTab.qml" line="293"/>
<source>No server given! </source> <source>No server given! </source>
<translation>Nessun server inserito!</translation> <translation>Nessun server inserito!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="306"/> <location filename="../qml/configqml/ConfigTab.qml" line="294"/>
<source>No nickname given! </source> <source>No nickname given! </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="307"/> <location filename="../qml/configqml/ConfigTab.qml" line="295"/>
<source>Nickname not registered at given server! </source> <source>Nickname not registered at given server! </source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -95,42 +95,42 @@
<translation type="vanished">Nessun utente inserito!</translation> <translation type="vanished">Nessun utente inserito!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="308"/> <location filename="../qml/configqml/ConfigTab.qml" line="296"/>
<source>No password given! </source> <source>No password given! </source>
<translation>Nessuna password inserita!</translation> <translation>Nessuna password inserita!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="309"/> <location filename="../qml/configqml/ConfigTab.qml" line="297"/>
<source>No image directory given!</source> <source>No image directory given!</source>
<translation>Nessuna directory immagini inserita!</translation> <translation>Nessuna directory immagini inserita!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="310"/> <location filename="../qml/configqml/ConfigTab.qml" line="298"/>
<source>No maximum news number given!</source> <source>No maximum news number given!</source>
<translation>Nessun numero massimo di news inserito!</translation> <translation>Nessun numero massimo di news inserito!</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="316"/> <location filename="../qml/configqml/ConfigTab.qml" line="304"/>
<source>Wrong password!</source> <source>Wrong password!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Success</source> <source>Success</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="335"/> <location filename="../qml/configqml/ConfigTab.qml" line="323"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="399"/> <location filename="../qml/configqml/ConfigTab.qml" line="389"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Cronologia</translation> <translation>Cronologia</translation>
</message> </message>
<message> <message>
<location filename="../qml/configqml/ConfigTab.qml" line="403"/> <location filename="../qml/configqml/ConfigTab.qml" line="393"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Conversazioni</translation> <translation>Conversazioni</translation>
</message> </message>
@ -189,12 +189,12 @@
<translation>Amici</translation> <translation>Amici</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="200"/> <location filename="../qml/contactqml/FriendsTab.qml" line="202"/>
<source>Contacts</source> <source>Contacts</source>
<translation>Contatti</translation> <translation>Contatti</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/FriendsTab.qml" line="253"/> <location filename="../qml/contactqml/FriendsTab.qml" line="259"/>
<source>Groups</source> <source>Groups</source>
<translation>Gruppi</translation> <translation>Gruppi</translation>
</message> </message>
@ -202,32 +202,37 @@
<context> <context>
<name>ImageUploadDialog</name> <name>ImageUploadDialog</name>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="127"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="100"/>
<source>Upload to album</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="121"/>
<source>Album</source> <source>Album</source>
<translation>Album</translation> <translation>Album</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="132"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="126"/>
<source>Image</source> <source>Image</source>
<translation>Immagine</translation> <translation>Immagine</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="137"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="131"/>
<source>Description</source> <source>Description</source>
<translation>Descrizione</translation> <translation>Descrizione</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="236"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="229"/>
<source>Upload</source> <source>Upload</source>
<translation>Carica</translation> <translation>Carica</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source>Error</source> <source>Error</source>
<translation>Errore</translation> <translation>Errore</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/ImageUploadDialog.qml" line="239"/> <location filename="../qml/photoqml/ImageUploadDialog.qml" line="232"/>
<source> No album name given</source> <source> No album name given</source>
<translation>Nessun nome album inserito!</translation> <translation>Nessun nome album inserito!</translation>
</message> </message>
@ -235,17 +240,17 @@
<context> <context>
<name>MessageSend</name> <name>MessageSend</name>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="98"/> <location filename="../qml/newsqml/MessageSend.qml" line="111"/>
<source>Title (optional)</source> <source>Title (optional)</source>
<translation>Titolo (opzionale)</translation> <translation>Titolo (opzionale)</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Error</source> <source>Error</source>
<translation>Errore</translation> <translation>Errore</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/MessageSend.qml" line="180"/> <location filename="../qml/newsqml/MessageSend.qml" line="190"/>
<source>Only one attachment supported at the moment. <source>Only one attachment supported at the moment.
Remove other attachment first!</source> Remove other attachment first!</source>
<translation>Solo un allegato è attualmente supportato. <translation>Solo un allegato è attualmente supportato.
@ -259,30 +264,55 @@
<translation type="vanished">Download immagine profilo per </translation> <translation type="vanished">Download immagine profilo per </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="204"/> <location filename="../qml/newsqml/NewsTab.qml" line="404"/>
<source>More</source> <source>More</source>
<translation>Ancora</translation> <translation>Ancora</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="301"/> <location filename="../qml/newsqml/NewsTab.qml" line="281"/>
<source>Timeline</source> <source>Timeline</source>
<translation>Cronologia</translation> <translation>Cronologia</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="310"/> <location filename="../qml/newsqml/NewsTab.qml" line="63"/>
<source>Error</source>
<translation type="unfinished">Errore</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="298"/>
<source>Favorites</source> <source>Favorites</source>
<translation>Favoriti</translation> <translation>Favoriti</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="322"/> <location filename="../qml/newsqml/NewsTab.qml" line="290"/>
<source>Conversations</source> <source>Conversations</source>
<translation>Conversazioni</translation> <translation>Conversazioni</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/NewsTab.qml" line="330"/> <location filename="../qml/newsqml/NewsTab.qml" line="306"/>
<source>Public timeline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="314"/>
<source>Direct Messages</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="321"/>
<source>Notifications</source> <source>Notifications</source>
<translation>Notifiche</translation> <translation>Notifiche</translation>
</message> </message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="328"/>
<source>Group news</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/newsqml/NewsTab.qml" line="332"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Newsitem</name> <name>Newsitem</name>
@ -292,77 +322,77 @@
<translation>attendere: </translation> <translation>attendere: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="99"/> <location filename="../qml/newsqml/Newsitem.qml" line="105"/>
<source>Source: </source> <source>Source: </source>
<translation>Codice: </translation> <translation>Codice: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="100"/> <location filename="../qml/newsqml/Newsitem.qml" line="106"/>
<source>Direct Message</source> <source>Direct Message</source>
<translation>Messaggio diretto</translation> <translation>Messaggio diretto</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="115"/> <location filename="../qml/newsqml/Newsitem.qml" line="121"/>
<source>In reply to </source> <source>In reply to </source>
<translation>In risposta a </translation> <translation>In risposta a </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="127"/> <location filename="../qml/newsqml/Newsitem.qml" line="133"/>
<source> comments</source> <source> comments</source>
<translation> commenti</translation> <translation> commenti</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="221"/> <location filename="../qml/newsqml/Newsitem.qml" line="258"/>
<source>Attending: </source> <source>Attending: </source>
<translation>Attendi: </translation> <translation>Attendi: </translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="343"/> <location filename="../qml/newsqml/Newsitem.qml" line="378"/>
<source>Reply</source> <source>Reply</source>
<translation>Risposta</translation> <translation>Risposta</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="351"/> <location filename="../qml/newsqml/Newsitem.qml" line="386"/>
<source>DM</source> <source>DM</source>
<translation>Messaggio diretto</translation> <translation>Messaggio diretto</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="357"/> <location filename="../qml/newsqml/Newsitem.qml" line="392"/>
<source>Repost</source> <source>Repost</source>
<translation>Condividi</translation> <translation>Condividi</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="360"/> <location filename="../qml/newsqml/Newsitem.qml" line="395"/>
<source>Success!</source> <source>Success!</source>
<translation>Ha funzionato!</translation> <translation>Ha funzionato!</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="365"/> <location filename="../qml/newsqml/Newsitem.qml" line="400"/>
<source>Conversation</source> <source>Conversation</source>
<translation>Conversazione</translation> <translation>Conversazione</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="376"/> <location filename="../qml/newsqml/Newsitem.qml" line="410"/>
<source>Attending</source> <source>Attending</source>
<translation>Attendi</translation> <translation>Attendi</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="378"/> <location filename="../qml/newsqml/Newsitem.qml" line="412"/>
<source>yes</source> <source>yes</source>
<translation>si</translation> <translation>si</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="383"/> <location filename="../qml/newsqml/Newsitem.qml" line="417"/>
<source>maybe</source> <source>maybe</source>
<translation>potrebbe</translation> <translation>potrebbe</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="388"/> <location filename="../qml/newsqml/Newsitem.qml" line="422"/>
<source>no</source> <source>no</source>
<translation>no</translation> <translation>no</translation>
</message> </message>
<message> <message>
<location filename="../qml/newsqml/Newsitem.qml" line="395"/> <location filename="../qml/newsqml/Newsitem.qml" line="429"/>
<source>Delete</source> <source>Delete</source>
<translation>Cancella</translation> <translation>Cancella</translation>
</message> </message>
@ -383,28 +413,28 @@
<context> <context>
<name>PhotoTab</name> <name>PhotoTab</name>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="115"/> <location filename="../qml/photoqml/PhotoTab.qml" line="121"/>
<source>&apos;s images</source> <source>&apos;s images</source>
<translation> Immagini</translation> <translation> Immagini</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="167"/> <location filename="../qml/photoqml/PhotoTab.qml" line="178"/>
<source>All Images</source> <source>All Images</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="172"/> <location filename="../qml/photoqml/PhotoTab.qml" line="183"/>
<source>Only new</source> <source>Only new</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="186"/> <location filename="../qml/photoqml/PhotoTab.qml" line="197"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="190"/> <location filename="../qml/photoqml/PhotoTab.qml" line="201"/>
<source>Own Images</source> <source>Own Images</source>
<translation>Mie immagini</translation> <translation>Mie immagini</translation>
</message> </message>
<message> <message>
<location filename="../qml/photoqml/PhotoTab.qml" line="227"/> <location filename="../qml/photoqml/PhotoTab.qml" line="238"/>
<source>More</source> <source>More</source>
<translation>Ancora</translation> <translation>Ancora</translation>
</message> </message>
@ -602,32 +632,32 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="206"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="208"/>
<source>profile id</source> <source>profile id</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Description</source> <source>Description</source>
<translation type="unfinished">Descrizione</translation> <translation type="unfinished">Descrizione</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Location</source> <source>Location</source>
<translation type="unfinished">Località</translation> <translation type="unfinished">Località</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="229"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="232"/>
<source>Posts</source> <source>Posts</source>
<translation type="unfinished">Messaggi</translation> <translation type="unfinished">Messaggi</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="230"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="233"/>
<source>URL</source> <source>URL</source>
<translation type="unfinished">URL</translation> <translation type="unfinished">URL</translation>
</message> </message>
<message> <message>
<location filename="../qml/contactqml/ProfileComponent.qml" line="231"/> <location filename="../qml/contactqml/ProfileComponent.qml" line="234"/>
<source>Created at</source> <source>Created at</source>
<translation type="unfinished">Creato il</translation> <translation type="unfinished">Creato il</translation>
</message> </message>
@ -703,27 +733,26 @@
<translation>Persone che possono attendere.</translation> <translation>Persone che possono attendere.</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="77"/> <location filename="../js/newsworker.js" line="78"/>
<source>yes</source> <source>yes</source>
<translation>si</translation> <translation>si</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="78"/> <location filename="../js/newsworker.js" line="79"/>
<source>no</source> <source>no</source>
<translation>no</translation> <translation>no</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="79"/> <location filename="../js/newsworker.js" line="80"/>
<source>maybe</source> <source>maybe</source>
<translation>potrebbe</translation> <translation>potrebbe</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/> <location filename="../js/newsworker.js" line="96"/>
<source>seconds</source> <source>seconds</source>
<translation>secondi</translation> <translation>secondi</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="95"/>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="96"/>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="97"/>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="98"/>
@ -733,53 +762,64 @@
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="102"/>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="103"/>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="104"/>
<location filename="../js/newsworker.js" line="105"/>
<source>ago</source> <source>ago</source>
<translation>fa</translation> <translation>fa</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="96"/> <location filename="../js/newsworker.js" line="97"/>
<source>minute</source> <source>minute</source>
<translation>minuti</translation> <translation>minuti</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="97"/> <location filename="../js/newsworker.js" line="98"/>
<source>minutes</source> <source>minutes</source>
<translation>minuti</translation> <translation>minuti</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="98"/> <location filename="../js/newsworker.js" line="99"/>
<source>hour</source> <source>hour</source>
<translation>ora</translation> <translation>ora</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="99"/> <location filename="../js/newsworker.js" line="100"/>
<source>hours</source> <source>hours</source>
<translation>ore</translation> <translation>ore</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="100"/> <location filename="../js/newsworker.js" line="101"/>
<source>day</source> <source>day</source>
<translation>giorno</translation> <translation>giorno</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="101"/> <location filename="../js/newsworker.js" line="102"/>
<source>days</source> <source>days</source>
<translation>giorni</translation> <translation>giorni</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="102"/> <location filename="../js/newsworker.js" line="103"/>
<source>month</source> <source>month</source>
<translation>mese</translation> <translation>mese</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="103"/> <location filename="../js/newsworker.js" line="104"/>
<source>months</source> <source>months</source>
<translation>mesi</translation> <translation>mesi</translation>
</message> </message>
<message> <message>
<location filename="../js/newsworker.js" line="104"/> <location filename="../js/newsworker.js" line="105"/>
<source>years</source> <source>years</source>
<translation>anni</translation> <translation>anni</translation>
</message> </message>
</context> </context>
<context>
<name>service</name>
<message>
<location filename="../js/service.js" line="360"/>
<location filename="../js/service.js" line="362"/>
<location filename="../js/service.js" line="365"/>
<source>Error</source>
<translation type="unfinished">Errore</translation>
</message>
</context>
</TS> </TS>