v0.6.4 contact search

This commit is contained in:
LubuWest 2022-03-01 21:59:21 +01:00
parent 66e5c33b00
commit 5032c78de1
57 changed files with 2218 additions and 2252 deletions

View file

@ -1,4 +1,16 @@
## v0.6.4
* Search for new contacts (hashtags, names)
* Filter contacts
* many new emojis
* Replaced Favorite button with Reply button due to buggy Favourite API
* View newsitem on website (works only in coversation view)
* Rebuild contacts handling due to buggy Contacts API
* Removed permissions for new messages due to buggy Contacts API
* Sync all accounts in background (not only active)
## v0.6.3
* Dark theme

View file

@ -18,7 +18,7 @@ Currently supported:
* Search for news
* Click on hashtag in newsitem starts search for news with that word
* Only first photo attachment in post is shown, click for more images and fullscreen image
* Click on video or youtube video shows video fullscreen
* Click on video shows video fullscreen
* For news containing urls ending with mp3, mp4, avi, webm, ogg or to a Peertube instance: media can be played in the app
* Open links in external browser
* Click on contact photo for contact details and last news
@ -26,11 +26,11 @@ Currently supported:
* Click on post text opens conversation
* Deletion, Reposting, Answering of Posts
* Expand truncated news items
* Liking, disliking, favoriting
* Liking, disliking
* Attending for event posts
* Update fetches new posts (up to last 50) since last in local DB
* More shows older posts from local DB
* Create new Message with images or direct messages, Contact/Group access rights (can be stored), smileys
* Create new Message with images or direct messages,smileys
* Send image from Android gallery
* Send text or urls from other apps to Friendiqa
* Native Android image dialog
@ -48,13 +48,14 @@ Currently supported:
* Tabs for own profiles, friends, other contacts and groups
* Show profile(s) of user and change profile picture
* List of all known contacts with locally downloaded pictures
* Follow or unfoolow contacts
* Follow or unfollow contacts
* Search for new contacts according to topic
* Show follow requests; approve, deny, ignore requests
* Additional information, last messages and other functionality shown in news tab
* Show public and private pictures of contact (screenscraping of contact's website, works only with certain theme)
* Show public and private events of contact
* Show members of groups
* Open website of contact or connect page (for other contacts)
* Open website of contact
* Clean other contacts with no news
ToDo:
@ -66,8 +67,8 @@ ToDo:
Currently supported:
* Download public own images to local directory
* Upload public picture to album with descriptions, send from gallery
* Download public own images to local directory (API is currently broken)
* Upload public picture to album with descriptions, send from gallery (API is currently broken)
* Delete own pictures and albums on client and server
* Change name or album of existing picture
* Show albums in grid, show images in album in grid and fullscreen

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.6.3" android:versionCode="29" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.6.4" android:versionCode="30" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
@ -22,7 +22,7 @@
android:logo="@drawable/friendiqa">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
android:name="androidnative.friendiqa.FriendiqaActivity"
android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleInstance" android:taskAffinity="">
android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleTask" android:taskAffinity="">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>

View file

@ -13,7 +13,7 @@
TEMPLATE = app
TARGET = friendiqa
CONFIG += release
QT += qml quick gui widgets androidextras sql webview #webengine
QT += core core-private qml quick gui widgets sql androidextras #webengine webview
include(androidnative.pri/androidnative.pri)
@ -64,6 +64,7 @@ HEADERS += \
common/alarm.h
DISTFILES += \
android/gradle.properties \
qml/calendarqml/*.qml \
android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \
@ -72,6 +73,7 @@ DISTFILES += \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew.bat \
qml/configqml/ConfigAppearancePage.qml \
translations/*.ts \
translations/*.qm \
qml/*.qml \
@ -86,3 +88,6 @@ DISTFILES += \
ANDROID_EXTRA_LIBS = $$PWD/android/arm/libcrypto_1_1.so $$PWD/android/arm/libssl_1_1.so $$PWD/android/arm64/libcrypto_1_1.so $$PWD/android/arm64/libssl_1_1.so
#ANDROID_ABIS = arm64-v8a
#android: include(/home/pankraz/git/android_openssl/openssl.pri)
android: include(/home/pankraz/android-sdk/android_openssl/openssl.pri)

View file

@ -75,7 +75,7 @@ ApplicationWindow{
function onLoginChanged(login){
if(login==""){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")}
else{//rootstackView.push(rootstack)
else{
if (login.newsViewType!="" || login.newsViewType!=null){newstab.newstabstatus=login.newsViewType;}
Newsjs.getCurrentContacts(login,db,function(contacts){
contactlist=contacts})}
@ -117,7 +117,7 @@ ApplicationWindow{
}
function showContact(contact){ //print(JSON.stringify(contact));
function showContact(contact){
rootstackView.push("qrc:/qml/newsqml/ContactPage.qml",{"contact": contact})
}
@ -182,7 +182,7 @@ ApplicationWindow{
footer:ToolBar{id:roottoolbar
background: Rectangle{
anchors.fill: parent
color: Material.backgroundDimColor//"#EEEEEE"//"#F8F8F8"
color: Material.backgroundDimColor
}
TabBar {
@ -224,18 +224,6 @@ ApplicationWindow{
}
}
// states: State {
// name: "fullscreen";
// PropertyChanges { target: bar; height:0 }
// PropertyChanges { target: rootstack; height:parent.height }
// }
// transitions: Transition {
// PropertyAnimation { properties: "height";
// easing.type: Easing.InOutQuad
// duration: 1000
// }
// }
StackView{id:rootstackView
width:root.width
height: root.height
@ -250,6 +238,7 @@ ApplicationWindow{
property string newstabstatus
property var conversation:[]
source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
//onDoubleClicked:{newstypeSignal("refresh")}
}
Loader{
id: friendstab

View file

@ -1,9 +1,3 @@
# TEMPLATE = app
# TARGET = friendiqa
# CONFIG += release
# QT += qml quick gui widgets sql webview dbus webengine
cmake_minimum_required(VERSION 3.1.0)
project(friendiqa VERSION 0.6 LANGUAGES CXX)
@ -19,9 +13,7 @@ if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
find_package(Qt5 COMPONENTS Widgets Quick Sql DBus WebView REQUIRED) #QuickWidgets
#Webview Webengine
find_package(Qt5 COMPONENTS Widgets Quick Sql DBus REQUIRED)
set(MOC_SOURCES common/uploadableimage.h
common/xhr.h
@ -37,7 +29,7 @@ set(SOURCES common/friendiqa.cpp
common/remoteauthasyncimageprovider.cpp
common/updatenews.cpp
common/alarmlinux.cpp)
include_directories(common)
add_executable(friendiqa ${SOURCES} ${MOC_SOURCES} application.qrc)
@ -46,52 +38,8 @@ target_link_libraries(friendiqa Qt::Core)
target_link_libraries(friendiqa Qt::Widgets)
target_link_libraries(friendiqa Qt::Quick)
target_link_libraries(friendiqa Qt::Sql)
target_link_libraries(friendiqa Qt::WebView)
target_link_libraries(friendiqa Qt::DBus)
#target_link_libraries(friendiqa Qt::QuickWidgets)
# target_link_libraries(friendiqa Qt::Webengine)
# qt5_use_modules(friendiqa Core Widgets Quick Sql DBus)
install(TARGETS friendiqa DESTINATION bin)
#RESOURCES = application.qrc
# OTHER_FILES += qml/friendiqa.qml \
# translations/*.ts \
# qml/*.qml
# qml/newsqml/*.qml
# qml/contactqml/*.qml
# qml/photoqml/*.qml
# qml/configqml/*.qml
# js/*.js
#TRANSLATIONS += translations/friendiqa-de.ts \
# translations/friendiqa-es.ts \
# translations/friendiqa-it.ts
# HEADERS += \
# common/uploadableimage.h \
# common/xhr.h \
# common/filesystem.h \
# common/remoteauthasyncimageprovider.h \
# common/updatenews.h \
# common/alarm.h
#DISTFILES += \
# qml/calendarqml/*.qml \
# translations/*.ts \
# translations/*.qm \
# qml/*.qml \
# qml/newsqml/*.qml \
# qml/contactqml/*.qml \
# qml/photoqml/*.qml \
# qml/configqml/*.qml \
# js/*.js \
# target.path=/usr/bin
# desktop.path = /usr/share/applications
# desktop.files = images/de.ma-nic.Friendiqa.desktop
# icon.path = /usr/share/icons/hicolor/scalable/apps
# icon.files = images/Friendiqa.svg
# INSTALLS+=target desktop icon
install(TARGETS friendiqa DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES images/de.manic.Friendiqa.desktop DESTINATION share/applications)
install(FILES images/de.manic.Friendiqa.svg DESTINATION share/icons/hicolor/scalable/apps)

View file

@ -13,7 +13,6 @@
<file>qml/newsqml/NewsVideo.qml</file>
<file>qml/newsqml/ContactPage.qml</file>
<file>qml/newsqml/NewsVideoLarge.qml</file>
<file>qml/newsqml/NewsYplayer.qml</file>
<file>qml/newsqml/SmileyDialog.qml</file>
<file>qml/contactqml/FriendsTab.qml</file>
<file>qml/contactqml/GroupComponent.qml</file>
@ -35,7 +34,6 @@
<file>qml/calendarqml/CalendarTab.qml</file>
<file>qml/calendarqml/CalendarDay.qml</file>
<file>qml/calendarqml/EventList.qml</file>
<file>qml/configqml/RegisterPage.qml</file>
<file>qml/configqml/AccountPage.qml</file>
<file>qml/configqml/SyncConfig.qml</file>
<file>qml/configqml/SyncComponent.qml</file>
@ -252,5 +250,7 @@
<file>images/Friendica_monochrome.png</file>
<file>qml/configqml/ConfigAppearancePage.qml</file>
<file>qml/configqml/ConfigStartPage.qml</file>
<file>qml/contactqml/ContactsSearchPage.qml</file>
<file>images/Friendiqa.ico</file>
</qresource>
</RCC>

View file

@ -154,10 +154,8 @@ bool FILESYSTEM::isAutostart() {
QFileInfo check_file(QDir::homePath() + "/.config/autostart/friendiqa.desktop");
if (check_file.exists() && check_file.isFile()) {
qDebug()<<"autostart "<<true;
return true;
}
qDebug()<<"autostart "<<false;
return false;
}

View file

@ -74,6 +74,7 @@ int main(int argc, char *argv[]) {
UPDATENEWS* updatenews= UPDATENEWS::instance();
updatenews->setDatabase();
updatenews->login();
updatenews->setSyncAll(true);
updatenews->startsync();
//app.connect (updatenews,SIGNAL(quitapp()),&app,SLOT(quit()));
@ -86,6 +87,7 @@ int main(int argc, char *argv[]) {
QQmlApplicationEngine view;
//QQuickView view;
//view.setResizeMode(QQuickView::SizeRootObjectToView);
app.setWindowIcon(QIcon(":/images/Friendiqa.ico"));
QTranslator qtTranslator;
qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
app.installTranslator(&qtTranslator);
@ -108,6 +110,7 @@ int main(int argc, char *argv[]) {
qmlRegisterType<QSystemTrayIcon>("QSystemTrayIcon", 1, 0, "QSystemTrayIcon");
qRegisterMetaType<QSystemTrayIcon::ActivationReason>("ActivationReason");
view.rootContext()->setContextProperty("iconTray", QIcon(":/images/Friendica_monochrome.png"));
view.rootContext()->setContextProperty("iconTrayAvailable", QSystemTrayIcon::isSystemTrayAvailable());
view.load(QUrl("qrc:/qml/friendiqa.qml"));
//view.show();

View file

@ -32,7 +32,7 @@
#include "updatenews.h"
#include <QHttpPart>
#include <QTextCodec>
//#include <QTextCodec>
#include <QUrlQuery>
#include <QList>
#include <QDataStream>
@ -68,6 +68,10 @@ void UPDATENEWS::setUrl(QString url)
}
}
void UPDATENEWS::setSyncAll(bool syncAll)
{
m_syncAll=syncAll;
}
void UPDATENEWS::setDatabase()
{
@ -75,7 +79,6 @@ void UPDATENEWS::setDatabase()
QString db_url=qe.offlineStorageDatabaseFilePath("Friendiqa");
m_db = QSqlDatabase::addDatabase("QSQLITE");
m_db.setDatabaseName(QUrl("file://"+db_url+".sqlite").toLocalFile());
//qDebug() << db_url;
if (!m_db.open())
{
@ -86,26 +89,8 @@ void UPDATENEWS::setDatabase()
void UPDATENEWS::login()
{
QSqlQuery query("SELECT * FROM config WHERE isActive=0",m_db);
while (query.next())
{
username = query.value(1).toString();
QByteArray bpassword=query.value(2).toByteArray();
QString password=QByteArray::fromBase64(bpassword);
m_login=username+":"+password ;
xhr.setLogin(m_login);
m_url=query.value(0).toString();
xhr.setUrl(m_url);
m_imagedir=query.value(3).toString();
xhr.setImagedir(m_imagedir);
QString isActive=query.value(7).toString();
}
//m_updateInterval=query.value(5).toInt();
QSqlQuery syncquery("SELECT * FROM globaloptions",m_db);
// QSqlQuery delquery("DELETE FROM globaloptions WHERE k='sync_interval'",m_db);
// delquery.exec();
m_updateInterval=0;
syncindex=0;
synclist.clear();
@ -132,39 +117,61 @@ void UPDATENEWS::login()
if(!(synctimequery3.exec())) {qDebug() << " synctimequery3 " << synctimequery3.lastError();}
}
QSqlQuery query("SELECT * FROM config ORDER BY isActive ASC, username ASC",m_db);
query.last();
usernamelength=query.at()+1;
if (query.isActive()&&(usernameindex<usernamelength))
{ query.seek(usernameindex);
username = query.value(1).toString();
QByteArray bpassword=query.value(2).toByteArray();
QString password=QByteArray::fromBase64(bpassword);
m_login=username+":"+password ;
xhr.setLogin(m_login);
m_url=query.value(0).toString();
xhr.setUrl(m_url);
m_imagedir=query.value(3).toString();
xhr.setImagedir(m_imagedir);
QString isActive=query.value(7).toString();
}
}
void UPDATENEWS::startsync()
{ qDebug()<<"Friendiqa start syncing "<<syncindex <<" of "<<synclist.length(); //<< "Type "<<synclist[syncindex];
//QObject::connect(&xhr,SIGNAL(success(QByteArray,QString)),this,SLOT(store(QByteArray,QString)));
//QObject::connect(&xhr,SIGNAL(error(QString,QString,QString,int)),this,SLOT(showError(QString,QString,QString,int)));
if (syncindex<synclist.length()){
if (synclist[syncindex]=="sync_Timeline"){
timeline();
} else if (synclist[syncindex]=="sync_Replies") {
replies();
} else if (synclist[syncindex]=="sync_DirectMessages") {
directmessages();
} else if (synclist[syncindex]=="sync_Notifications") {
notifications();
} else if (synclist[syncindex]=="sync_FriendRequests") {
friendrequests();
}else if (synclist[syncindex]=="sync_Events") {
events();
}
} else if (syncindex==synclist.length()) {
m_api="";
if(m_updateInterval!=0){
syncindex=0;
synclist.clear();
m_db.close();
m_db.removeDatabase(m_db.connectionName());
QObject::disconnect(&xhr,SIGNAL(error(QString,QString,QString,int)),this,SLOT(showError(QString,QString,QString,int)));
emit quitapp();
alarm.setAlarm(m_updateInterval);
m_updateInterval=0;
}
}
{ //qDebug()<<"Friendiqa start syncing "<<syncindex <<" of "<<synclist.length() << " m_login "<<m_login;
if (syncindex<synclist.length()){
if (synclist[syncindex]=="sync_Timeline"){
timeline();
} else if (synclist[syncindex]=="sync_Replies") {
replies();
} else if (synclist[syncindex]=="sync_DirectMessages") {
directmessages();
} else if (synclist[syncindex]=="sync_Notifications") {
notifications();
} else if (synclist[syncindex]=="sync_FriendRequests") {
friendrequests();
}else if (synclist[syncindex]=="sync_Events") {
events();
}
} else if ((syncindex==synclist.length())&&(!(usernameindex<usernamelength-1))) {
m_api="";
if(m_updateInterval!=0){
syncindex=0;
usernameindex=0;
synclist.clear();
m_db.close();
m_db.removeDatabase(m_db.connectionName());
QObject::disconnect(&xhr,SIGNAL(error(QString,QString,QString,int)),this,SLOT(showError(QString,QString,QString,int)));
emit quitapp();
alarm.setAlarm(m_updateInterval);
m_updateInterval=0;
}
}
else{
usernameindex+=1;
login();
startsync();
}
}
@ -229,7 +236,7 @@ void UPDATENEWS::directmessages()
void UPDATENEWS::notifications()
{
m_api="/api/friendica/notifications";
m_api="/api/friendica/notification";
xhr.clearParams();
xhr.setUrl(m_url);
xhr.setApi(m_api);
@ -282,14 +289,14 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
for (int i=0; i < news.array().count();i++){
QJsonValue newsitem=news[i];
try{
if (apiname=="/api/friendica/notifications"){
if (apiname=="/api/friendica/notification"){
QSqlQuery testquery("SELECT status_id FROM news WHERE status_id=" + QString::number(newsitem["id"].toInt()) + " AND messagetype=2 AND username='"+ username +"'",m_db);
if (testquery.first()) {continue;}
}
QSqlQuery query(m_db);
query.prepare("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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
"geo,favorited,uid,statusnet_html,statusnet_conversation_id,friendica_activities,friendica_activities_self,attachments,friendica_owner) "
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
query.bindValue(0,username);
query.bindValue(1,"0");
query.bindValue(2, newsitem["text"].toString().toUtf8().toBase64());
@ -303,10 +310,11 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
query.bindValue(8,newsitem["geo"]);
query.bindValue( 9, newsitem["favorited"].toInt());
query.bindValue(10, newsitem["user"]["id"].toInt());
if (newsitem["friendica_title"]!="") {
QString friendicaHtml="<b>" + newsitem["friendica_title"].toString() +"</b><br><br>"+newsitem["friendica_html"].toString();
query.bindValue(11, friendicaHtml.toUtf8().toBase64());}
else{query.bindValue(11, newsitem["friendica_html"].toString().toUtf8().toBase64());}
//if (newsitem["friendica_title"]!="") {
// QString friendicaHtml="<b>" + newsitem["friendica_title"].toString() +"</b><br><br>"+newsitem["friendica_html"].toString();
// query.bindValue(11, friendicaHtml.toUtf8().toBase64());}
//else{
query.bindValue(11, newsitem["friendica_html"].toString().toUtf8().toBase64());//}
if (newsitem["statusnet_conversation_id"].isDouble()){
query.bindValue(12, newsitem["statusnet_conversation_id"].toInt());
}else{query.bindValue(12, newsitem["statusnet_conversation_id"].toString());}
@ -351,14 +359,14 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
if (apiname == "/api/direct_messages/all"){
query.bindValue(1,"1");
query.bindValue(5,"Friendica");
query.bindValue(6,newsitem["id"].toString().toInt());
query.bindValue(6,newsitem["id"].toInt());
if(newsitem["recipient"]["id"]!=QJsonValue::Null){ query.bindValue(7,newsitem["recipient"]["id"].toInt());}
query.bindValue(10, newsitem["sender_id"].toInt());
query.bindValue(11, newsitem["text"].toString().toUtf8().toBase64());
if(newsitem["friendica_parent_uri"]!=QJsonValue::Null){ query.bindValue(12,newsitem["friendica_parent_uri"]);}
query.bindValue(16, newsitem["sender"]["url"]);
}
if (apiname == "/api/friendica/notifications"){
if (apiname == "/api/friendica/notification"){
query.bindValue(1,"2");
query.bindValue(3,QDateTime::fromString(newsitem["date"].toString(),"yyyy-MM-dd hh:mm:ss").toMSecsSinceEpoch());
query.bindValue(5,"Friendica");
@ -387,7 +395,7 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
alarm.notify("DirectMessage: "+newsitem["sender"]["name"].toString(),newsitem["text"].toString(),2);
}
}
if (apiname=="/api/friendica/notifications"){
if (apiname=="/api/friendica/notification"){
if(notifylist.contains("notify_Notifications")){
alarm.notify("Notification: "+newsitem["name"].toString(),newsitem["text"].toString(),3);
}
@ -403,7 +411,7 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
startImagedownload("contactlist");
} else {
if(m_updateInterval!=0){
if((m_updateInterval!=0) && m_syncAll){
syncindex+=1;
startsync();
}
@ -411,9 +419,12 @@ void UPDATENEWS::store(QByteArray serverreply,QString apiname)
}
else {
qDebug()<< "Friendiqa updatenews error " << serverreply;
emit this->error(m_api,QTextCodec::codecForName("utf-8")->toUnicode(serverreply));
syncindex+=1;
startsync();
//emit this->error(m_api,QTextCodec::codecForName("utf-8")->toUnicode(serverreply));
emit this->error(m_api,QString(serverreply));
if(m_syncAll){
syncindex+=1;
startsync();
}
}
}
@ -428,10 +439,11 @@ void UPDATENEWS::updateImageLocation(QString downloadtype,QString imageurl, QStr
testquery.first();
QSqlQuery query("UPDATE contacts SET profile_image='"+ filename +"' WHERE profile_image_url ='"+imageurl+ "' AND username = '" +username+"'",m_db);
if(!(query.exec())) {qDebug()<< "updateImagelocation " << query.lastError();}
//qDebug()<< "index " << index << " " << newcontactnames.length()-1 << " " << m_syncAll;
if (index==(newcontactnames.length()-1)){
newcontactnames.clear();
newcontactimagelinks.clear();
if(m_updateInterval!=0){
if((m_updateInterval!=0) && m_syncAll){
syncindex+=1;
startsync();
}
@ -445,7 +457,7 @@ void UPDATENEWS::updateImageLocation(QString downloadtype,QString imageurl, QStr
if (index==(newcontactnames.length()-1)){
newcontactnames.clear();
newcontactimagelinks.clear();
if(m_updateInterval!=0){
if((m_updateInterval!=0) && m_syncAll){
syncindex+=1;
startsync();
}
@ -537,10 +549,10 @@ void UPDATENEWS::updateContacts(QList<QJsonValue> contacts){
QSqlQuery testquery("SELECT url FROM contacts WHERE username='"+ username +"' AND url='" + contact["url"].toString() +"'",m_db);
if (testquery.first()){
query.prepare("UPDATE contacts SET id=?, name=?, screen_name=?, location=?,imageAge=?,"
"profile_image_url=?, description=?, protected=?, followers_count=?,"
"friends_count=?, created_at=?, favourites_count=?, utc_offset=?, time_zone=?, statuses_count=?,"
"following=?, verified=?, statusnet_blocking=?, notifications=?, statusnet_profile_url=?, cid=?, network=?, timestamp=? "
" WHERE username='"+ username +"' AND url='" + contact["url"].toString() +"'");
"profile_image_url=?, description=?, protected=?, followers_count=?,"
"friends_count=?, created_at=?, favourites_count=?, utc_offset=?, time_zone=?, statuses_count=?,"
"following=?, verified=?, statusnet_blocking=?, notifications=?, statusnet_profile_url=?, cid=?, network=?, timestamp=? "
" WHERE username='"+ username +"' AND url='" + contact["url"].toString() +"'");
query.bindValue(0, contact["id"].toInt());
query.bindValue(1, contact["name"].toString().toUtf8().toBase64());
query.bindValue(2, contact["screen_name"]);
@ -573,10 +585,10 @@ void UPDATENEWS::updateContacts(QList<QJsonValue> contacts){
else{
query.prepare("INSERT INTO contacts (username, id, name, screen_name, location,imageAge,"
"profile_image_url, description, profile_image, url, protected, followers_count,"
"friends_count, created_at, favourites_count, utc_offset, time_zone, statuses_count,"
"following, verified, statusnet_blocking, notifications, statusnet_profile_url, cid, network, isFriend, timestamp)"
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
"profile_image_url, description, profile_image, url, protected, followers_count,"
"friends_count, created_at, favourites_count, utc_offset, time_zone, statuses_count,"
"following, verified, statusnet_blocking, notifications, statusnet_profile_url, cid, network, isFriend, timestamp)"
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
query.bindValue(0,username);
query.bindValue(1, contact["id"].toInt());
@ -628,6 +640,7 @@ void UPDATENEWS::storeFriendrequests(QByteArray serverreply,QString apiname)
QSqlQuery imagequery("SELECT avatar FROM friendshiprequests",m_db);
QList<QString> imageurls;
while (imagequery.next()){
imageurls.append(imagequery.value(0).toString());
}
@ -639,10 +652,10 @@ void UPDATENEWS::storeFriendrequests(QByteArray serverreply,QString apiname)
QSqlQuery query(m_db);
if (testquery.first()){
query.prepare("UPDATE friendshiprequests SET id=?, usernamef=?, acct=?, display_name=?,locked=?,"
"bot=?, discoverable=?, groupf=?, created_at=?,"
"note=?, avatar=?, header=?, header_static=?, followers_count=?,"
"following_count=?, statuses_count=?, last_status_at=?, emojis=?, fields=? "
" WHERE username='"+ username +"' AND url='" + friendrequestitem["url"].toString() +"'");
"bot=?, discoverable=?, groupf=?, created_at=?,"
"note=?, avatar=?, header=?, header_static=?, followers_count=?,"
"following_count=?, statuses_count=?, last_status_at=?, emojis=?, fields=? "
" WHERE username='"+ username +"' AND url='" + friendrequestitem["url"].toString() +"'");
query.bindValue(0, friendrequestitem["id"].toInt());
query.bindValue(1, friendrequestitem["username"]);
@ -667,9 +680,9 @@ void UPDATENEWS::storeFriendrequests(QByteArray serverreply,QString apiname)
else{
query.prepare("INSERT INTO friendshiprequests (username, id, usernamef, acct, display_name, locked,"
" created_at, followers_count, following_count, statuses_count, note, url, avatar, avatar_static, "
"header, header_static, emojis, moved, fields, bot, groupf, discoverable, last_status_at) "
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
" created_at, followers_count, following_count, statuses_count, note, url, avatar, avatar_static, "
"header, header_static, emojis, moved, fields, bot, groupf, discoverable, last_status_at) "
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
query.bindValue(0, username);
query.bindValue(1, friendrequestitem["id"].toInt());
query.bindValue(2, friendrequestitem["username"].toString());
@ -710,13 +723,12 @@ void UPDATENEWS::storeFriendrequests(QByteArray serverreply,QString apiname)
newcontactimagelinks.append(friendrequestitem["avatar"].toString());
newcontactnames.append(friendrequestitem["username"].toString());
}
}
if (newcontactimagelinks.length()>0){
//qDebug() << "start Friendrequests imagedownload";
startImagedownload("friendrequests");
}else{
if(m_updateInterval!=0){
if((m_updateInterval!=0) && m_syncAll){
syncindex+=1;
startsync();
}
@ -769,7 +781,7 @@ void UPDATENEWS::storeEvents(QByteArray serverreply,QString apiname)
alarm.notify("Event: "+ QDateTime::fromMSecsSinceEpoch(eventnotifyquery.value(0).toLongLong()).toString("dd.MM.yyyy hh:mm"),eventnotifyquery.value(1).toString(),1);
}
}
if(m_updateInterval!=0){
if((m_updateInterval!=0) && m_syncAll){
syncindex+=1;
startsync();
}
@ -795,7 +807,7 @@ void UPDATENEWS::showError(QString data, QString url,QString api, int code )
//qDebug() << "showerror " << api << " data " << data;
emit this->error(api,data);
if (api!=m_api || xhr.downloadtype()!=""){} else{
if(m_updateInterval!=0){
if((m_updateInterval!=0) && m_syncAll){
syncindex+=1;
startsync();
}

View file

@ -61,6 +61,7 @@ signals:
public slots:
void setUrl(QString url);
void setSyncAll(bool syncAll);
void setDatabase();
void login();
void timeline();
@ -84,7 +85,10 @@ private:
QString m_imagedir;
QString m_login;
QString username;
bool m_syncAll;
int syncindex;
int usernameindex;
int usernamelength;
QSqlDatabase m_db;
QList<QString> synclist;
QList <QString> notifylist;

View file

@ -32,10 +32,11 @@
#include "xhr.h"
#include <QHttpPart>
#include <QTextCodec>
//#include <QTextCodec>
#include <QUrlQuery>
#include <QList>
#include <QDataStream>
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include "uploadableimage.h"
@ -223,7 +224,7 @@ void XHR::getlist()
XHR::setUrl(m_filelist.at(dlindex));}
else {
XHR::setUrl(m_filelist.at(dlindex));}
qDebug() << "start download" << m_url;
//qDebug() << "start download" << m_url;
XHR::download();
} else {dlindex=0;m_downloadtype="";m_contactlist.clear();m_filelist.clear();}
}
@ -291,7 +292,6 @@ void XHR::onReplySuccess()
void XHR::onRequestFinished()
{
qDebug()<<"download requestFinished ";
// Save the file here
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") {
@ -359,5 +359,6 @@ void XHR::onSSLError(const QList<QSslError> &errors)
QString XHR::bufferToString()
{
return QTextCodec::codecForName("utf-8")->toUnicode(buffer);
//return QTextCodec::codecForName("utf-8")->toUnicode(buffer);
return QString(buffer);
}

View file

@ -37,7 +37,7 @@
#include <QNetworkRequest>
#include <QObject>
#include <QJsonObject>
#include <QNetworkConfiguration>
//#include <QNetworkConfiguration>
class XHR : public QObject
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -2,7 +2,7 @@
Version=1.0
Type=Application
Exec=friendiqa %u
Icon=Friendiqa.svg
Icon=de.manic.Friendiqa.svg
Terminal=false
Name=Friendiqa
GenericName=Social Media

View file

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -62,11 +62,13 @@ function friendicaPostRequest(login,api,data,method,rootwindow,callback) {
try{ if (xhrequest.responseText!=""){
callback(xhrequest.responseText)
}else{//print("API:\n" +api+" NO RESPONSE");
showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow)
//showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow)
callback(xhrequest.responseText)
}
}
catch (e){print("API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText);showMessage("Error", "API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText,rootwindow)}
catch (e){
print("API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText);
showMessage("Error", "API:\n" + api+" "+e+"\n Return:"+xhrequest.responseText,rootwindow)}
}
}
xhrequest.open(method, login.server+api,true,login.username,Qt.atob(login.password));

View file

@ -34,51 +34,77 @@
.import "qrc:/js/helper.js" as Helperjs
function requestFriends(login,database,rootwindow,callback){
// return array of friends
// return array of friends
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
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){
var friends=JSON.parse(obj);
for (var i=0;i<friends.length;i++){
friends[i].created_at=Date.parse(cleanDate(friends[i].created_at));
friends[i].isFriend=1
}
//try{requestProfile(login,friends,rootwindow,function(friends_profile){callback(friends_profile)})}
//catch(e){
callback(friends)//}
var result = tx.executeSql('UPDATE contacts SET isFriend=0 where username="'+login.username+'"'); // clean old friends
var result2 = tx.executeSql('DELETE from groups where username="'+login.username+'"'); // clean old groups
})
// /api/statuses/friends not working in Friendica 2/2022 , switching to api/v1/lists and download of all list members
// Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){
var allfriends=[];
Helperjs.friendicaRequest(login,"/api/v1/lists",rootwindow,function(listsobj){
var lists=JSON.parse(listsobj)
for (var list in lists){
Helperjs.friendicaRequest(login,"/api/v1/lists/"+lists[list].id+"/accounts?limit=0", rootwindow,function (obj){
var friends=JSON.parse(obj);
var memberarray=[];
for (var i=0;i<friends.length;i++){
if (friends[i].note!=null){
friends[i].description=friends[i].note;}
else{friends[i].description=""}
friends[i].name=friends[i].display_name;
friends[i].screen_name=friends[i].acct;
friends[i].location="";
friends[i].profile_image=friends[i].avatar_static;
friends[i].profile_image_url=friends[i].avatar;
friends[i].protected=false;
friends[i].friends_count=friends[i].following_count;
friends[i].created_at=Date.parse(friends[i].created_at);
friends[i].favorites_count=0;
friends[i].utc_offset=0;
friends[i].isFriend=1
friends[i].cid=0
friends[i].following=true
memberarray.push(parseInt(friends[i].id))
}
//requestGroups() not working with Friendica 02/2022
db.transaction( function(tx) {
var result3 = tx.executeSql('INSERT INTO groups VALUES (?,?,?,?)', [login.username,lists[list].title,lists[list].id,JSON.stringify(memberarray)])
})
callback(friends)
})};
});
}
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]);
Helperjs.friendicaRequest(login,"/api/friendica/group_show",rootwindow, function (obj){
var groups=JSON.parse(obj);
var groups=JSON.parse(obj);
db.transaction( function(tx) {
var result = tx.executeSql('DELETE from groups where username="'+login.username+'"'); // clean old groups
for (var i=0;i<groups.length;i++){
var memberarray=[]; for (var user in groups[i].user){memberarray.push(parseInt(groups[i].user[user].id))}
//print("Members: "+groups[i].user)
var result2 = tx.executeSql('INSERT INTO groups VALUES (?,?,?,?)', [login.username,groups[i].name,groups[i].gid,JSON.stringify(memberarray)])}
callback()
var result = tx.executeSql('DELETE from groups where username="'+login.username+'"'); // clean old groups
for (var i=0;i<groups.length;i++){
var memberarray=[]; for (var user in groups[i].user){memberarray.push(parseInt(groups[i].user[user].id))}
//print("Members: "+groups[i].user)
var result2 = tx.executeSql('INSERT INTO groups VALUES (?,?,?,?)', [login.username,groups[i].name,groups[i].gid,JSON.stringify(memberarray)])}
callback()
});
})}
})}
function listFriends(login,database,callback,filter){
function listFriends(login,database,callback,filter,isFriend=0){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var filtertext='';
//try {filtertext=' AND screen_name like "' + filter+'%"'}catch(e){}
var filtertext=new RegExp(".*"+filter.toLowerCase()+".*")
// if (filter){filtertext=' AND (screen_name like "' + filter+'%" OR name like "' + Qt.btoa(filter)+'%")'}
if (filter!=null){var filtertext=new RegExp(".*"+filter.toLowerCase()+".*")}else{var filtertext=new RegExp(".*")}
db.transaction( function(tx) {
//var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend>0'+filtertext);
var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend>0');
var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend>'+isFriend+' ORDER BY screen_name');
// check for friends
var contactlist=[];
for (var i=0;i<result.rows.length;i++){
var contact=result.rows.item(i)
contact.name=Qt.atob(contact.name);
if (contact.screen_name==null){contact.screen_name=""}
if(filtertext.test(contact.name.toLowerCase())|| filtertext.test(contact.screen_name.toLowerCase())){
contactlist.push(contact)}
}
@ -108,7 +134,7 @@ function storeHashtags(login,database,newstext,rootwindow){
for (var tag in hashtags){
db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from hashtags where username="'+login.username+'" AND tag = "'+Qt.btoa(tag)+'"'); // check for tag
if(result.rows.length === 1) {// use update
if(result.rows.length > 0) {// use update
result = tx.executeSql('UPDATE hashtags SET tag="'+'", date='+curDate+', ownership=0 where username="'+login.username+'" AND tag="'+Qt.btoa(hashtags[tag])+'"');
} else {// use insert
result = tx.executeSql('INSERT INTO hashtags (username,tag,date,statuses,ownership) VALUES (?,?,?,?,?)', [login.username,Qt.btoa(hashtags[tag]),curDate,"[]",0])
@ -122,20 +148,20 @@ function deleteGroup(login,database,rootwindow,group, callback){
Helperjs.friendicaPostRequest(login,"/api/friendica/group_delete?gid="+group.gid+"&name="+group.groupname,"","POST",rootwindow, function (obj){
var deletereturn=JSON.parse(obj);
if(deletereturn.success){
db.transaction( function(tx) {
var result = tx.executeSql('DELETE from groups where username="'+login.username+'" AND groupname="'+group.name+'"'); // delete group
callback()
});
}})}
db.transaction( function(tx) {
var result = tx.executeSql('DELETE from groups where username="'+login.username+'" AND groupname="'+group.name+'"'); // delete group
callback()
});
}})}
function getLastNews(login,database,callback){
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){lastnewsid=0};
callback(lastnewsid)
})
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){lastnewsid=0};
callback(lastnewsid)
})
}
@ -163,15 +189,15 @@ function getCurrentContacts(login,database,callback){
db.transaction( function(tx) {
var result = tx.executeSql('SELECT url from contacts WHERE username="'+login.username+'" AND isFriend=1'); // check for friends
for (var i=0;i<result.rows.length;i++){
contactlist.push(result.rows.item(i).url )
//print(result.rows.item(i).url)
}
var lastDate=Date.now()-604800000;// 7 days old
//print('SELECT url from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge>'+lastDate);
var result2 = tx.executeSql('SELECT url from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge > '+lastDate);
for (var j=0;j<result2.rows.length;j++){
contactlist.push(result2.rows.item(j).url )
}
contactlist.push(result.rows.item(i).url )
//print(result.rows.item(i).url)
}
var lastDate=Date.now()-604800000;// 7 days old
//print('SELECT url from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge>'+lastDate);
var result2 = tx.executeSql('SELECT url from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge > '+lastDate);
for (var j=0;j<result2.rows.length;j++){
contactlist.push(result2.rows.item(j).url )
}
})
callback(contactlist)
}
@ -183,7 +209,7 @@ function findNewContacts(news,contacts){
if(contacts.indexOf(url)==-1 && !(inArray(newContacts,"url",url))){
news[i].user.isFriend=0;
newContacts.push(news[i].user);
}
}
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++){
var like_url=news[i].friendica_activities.like[j].url;
@ -192,47 +218,48 @@ function findNewContacts(news,contacts){
newContacts.push(news[i].friendica_activities.like[j]);
}
}
}
if (news[i].hasOwnProperty('friendica_activities') && 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++){
var dislike_url=news[i].friendica_activities.dislike[k].url;
if(contacts.indexOf(dislike_url)==-1 && !(inArray(newContacts,"url",dislike_url))){
news[i].friendica_activities.dislike[k].isFriend=0;
newContacts.push(news[i].friendica_activities.dislike[k]);
newContacts.push(news[i].friendica_activities.dislike[k]);
}
}
}
}
if(news[i].hasOwnProperty('friendica_author')){
var owner_url=news[i].friendica_author.url;
if(contacts.indexOf(owner_url)==-1 && !(inArray(newContacts,"url",owner_url))){
news[i].friendica_author.isFriend=0;
newContacts.push(news[i].friendica_author);
}
}
if(news[i].hasOwnProperty('friendica_author')){
var owner_url=news[i].friendica_author.url;
if(contacts.indexOf(owner_url)==-1 && !(inArray(newContacts,"url",owner_url))){
news[i].friendica_author.isFriend=0;
newContacts.push(news[i].friendica_author);
}
}
}
return newContacts
}
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]);
for (var i=0;i<news.length;i++){
//print('store news data for ' + login.username+news[i].messagetype+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_author.url);
//var ausdruck=news[i];
var likearray=[];var dislikearray=[];var attendyesarray=[];var attendnoarray=[];var attendmaybearray=[];
if(news[i].hasOwnProperty('friendica_activities')){
for (var user in news[i].friendica_activities.like){likearray.push(news[i].friendica_activities.like[user].url)}
for (var user in news[i].friendica_activities.dislike){dislikearray.push(news[i].friendica_activities.dislike[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)}
for (var user in news[i].friendica_activities.like){likearray.push(news[i].friendica_activities.like[user].url)}
for (var user in news[i].friendica_activities.dislike){dislikearray.push(news[i].friendica_activities.dislike[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 attachments="";if (news[i].attachments){attachments=Qt.btoa(JSON.stringify(news[i].attachments))}
if (news[i].friendica_title!="") {news[i].statusnet_html="<b>"+news[i].friendica_title +"</b><br><br>"+news[i].friendica_html;}
else{news[i].statusnet_html=news[i].friendica_html}
//if (news[i].friendica_title!="") {news[i].statusnet_html="<b>"+news[i].friendica_title +"</b><br><br>"+news[i].friendica_html;}
//else{
news[i].statusnet_html=news[i].friendica_html//}
db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+news[i].id+'" AND messagetype='+news[i].messagetype); // check for news id
@ -241,20 +268,20 @@ function storeNews(login,database,news,rootwindow){
result = tx.executeSql('UPDATE news SET username="'+login.username+'", messagetype='+news[i].messagetype+', 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].statusnet_html)+'", statusnet_conversation_id="'+news[i].statusnet_conversation_id+'",friendica_activities="'+Qt.btoa(JSON.stringify(friendica_activities))+'",attachments="'+attachments+'",friendica_owner="'+news[i].friendica_author.url+'" where username="'+login.username+'" AND status_id="'+news[i].status_id+'" AND messagetype=0');
} 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,news[i].messagetype,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_author.url])}})
}
}
}
function getActivitiesUserData(allcontacts,userUrlArray){//print(JSON.stringify(userUrlArray));
var helpArray=[];
for (var i=0;i<userUrlArray.length;i++){
helpArray.push(objFromArray(allcontacts,"url",userUrlArray[i]));
helpArray.push(objFromArray(allcontacts,"url",userUrlArray[i]));
}
return helpArray
}
function newsfromdb(database,login,messagetype,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]);
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');
@ -262,10 +289,10 @@ function newsfromdb(database,login,messagetype,callback,contact,stop_time){
if (!stop_time){var stop="";
try{var rs = tx.executeSql('select created_at from news WHERE username="'+login.username+'" AND messagetype="'+messagetype+'" 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}
var contactfilter="";if(contact){contactfilter=" AND (uid='"+contact+"' OR friendica_owner='"+contact+"')"}
if (messagetype=="0"){messagetype="0,5"}
if (messagetype=="0"){messagetype="0,5"}
//print('select * from news WHERE username="'+login.username+'" AND messagetype IN ( '+messagetype+' ) AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20');
var newsrs=tx.executeSql('select * from news WHERE username="'+login.username+'" AND messagetype IN ( '+messagetype+' ) AND created_at'+stop+contactfilter+' ORDER BY created_at DESC LIMIT 20');
var newsArray=[];
@ -280,7 +307,7 @@ function newsfromdb(database,login,messagetype,callback,contact,stop_time){
newsArray[i]=fetchUsersForNews(database,login.username,newsArray[i],allcontacts);
if (newsArray[i].attachments!="" && newsArray[i].attachments!==null){newsArray[i].attachments=JSON.parse(Qt.atob(newsArray[i].attachments))};
}
callback(newsArray,lastid)});
callback(newsArray,lastid)});
}
@ -290,16 +317,16 @@ function fetchUsersForNews(database,username,news,allcontacts){//print("fetchuse
//news.friendica_owner_object=objFromArray(allcontacts,"url",news.friendica_owner);
news.friendica_author=objFromArray(allcontacts,"url",news.friendica_author);
if (news.messagetype==0){
var friendicaArray=JSON.parse(Qt.atob(news.friendica_activities));
var friendicaArray=JSON.parse(Qt.atob(news.friendica_activities));
delete news.friendica_activities;
news.friendica_activities={};
//for(var j=0;j<friendicaArray.length;j++){
news.friendica_activities.like=getActivitiesUserData(allcontacts,friendicaArray[0]);
news.friendica_activities.dislike=getActivitiesUserData(allcontacts,friendicaArray[1]);
news.friendica_activities.attendyes=getActivitiesUserData(allcontacts,friendicaArray[2]);
news.friendica_activities.attendno=getActivitiesUserData(allcontacts,friendicaArray[3]);
news.friendica_activities.attendmaybe=getActivitiesUserData(allcontacts,friendicaArray[4]);
//}
//for(var j=0;j<friendicaArray.length;j++){
news.friendica_activities.like=getActivitiesUserData(allcontacts,friendicaArray[0]);
news.friendica_activities.dislike=getActivitiesUserData(allcontacts,friendicaArray[1]);
news.friendica_activities.attendyes=getActivitiesUserData(allcontacts,friendicaArray[2]);
news.friendica_activities.attendno=getActivitiesUserData(allcontacts,friendicaArray[3]);
news.friendica_activities.attendmaybe=getActivitiesUserData(allcontacts,friendicaArray[4]);
//}
}
return news
}
@ -311,31 +338,31 @@ function deleteNews(login,database,newsid,messagetype,rootwindow,callback){
else if (messagetype==2){ api="/api/friendica/notifications/seen?id="}
Helperjs.friendicaPostRequest(login,api+newsid,"","POST", rootwindow,function (obj){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {var result = tx.executeSql('DELETE from news where username="'+login.username+'" AND messagetype='+messagetype+' AND status_id ='+newsid); // delete news id
callback(obj)
});
})}
db.transaction( function(tx) {var result = tx.executeSql('DELETE from news where username="'+login.username+'" AND messagetype='+messagetype+' AND status_id ='+newsid); // delete news id
callback(obj)
});
})}
function retweetNews(login,database,newsid,rootwindow,callback){
Helperjs.friendicaPostRequest(login,"/api/statuses/retweet?id="+newsid,"","POST", rootwindow,function (obj){
var answer=JSON.parse(obj);
if(answer.hasOwnProperty('status'))//('error' in answer.status)
{Helperjs.showMessage("Repost",answer.status.code,rootwindow);}
{Helperjs.showMessage("Repost",answer.status.code,rootwindow);}
else{Helperjs.showMessage("Repost",answer.text,rootwindow)}
})
}
function favorite(login,favorited,newsid,rootwindow){
// toggle favorites
if(favorited){ Helperjs.friendicaPostRequest(login,"/api/favorites/create?id="+newsid,"","POST", rootwindow,function (obj){
})}
// toggle favorites
if(favorited){ Helperjs.friendicaPostRequest(login,"/api/favorites/create?id="+newsid,"","POST", rootwindow,function (obj){
})}
else {Helperjs.friendicaPostRequest(login,"/api/favorites/destroy?id="+newsid,"","POST",rootwindow,function (obj){
})}
})}
}
function likerequest(login,database,verb,newsid,rootwindow){
Helperjs.friendicaPostRequest(login,"/api/friendica/activity/"+verb+"?id="+newsid, "","POST",rootwindow,function (obj){
if (obj=='"ok"'){
if (obj=='"ok"'){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var currentActivities_rs=tx.executeSql('select friendica_activities_self from news WHERE username="'+login.username+'" AND status_id='+newsid) ;
@ -351,8 +378,8 @@ function likerequest(login,database,verb,newsid,rootwindow){
if (verb=="undislike"){ if (currentActivities.indexOf(2)!=-1){currentActivities.splice(currentActivities.indexOf(2),1)}}
//print(JSON.stringify(currentActivities));
var result = tx.executeSql('UPDATE news SET friendica_activities_self ="'+JSON.stringify(currentActivities)+'" where username="'+login.username+'" AND status_id ='+newsid);
})}
else{}})
})}
else{}})
}
function like(login,database,toggle,verb,newsid,rootwindow){
@ -361,14 +388,14 @@ function like(login,database,toggle,verb,newsid,rootwindow){
if(verb=="dislike"&& toggle==1){likerequest(login,database,"dislike",newsid,rootwindow);
}
if(toggle==0){
likerequest(login,database,"un"+verb,newsid,rootwindow);}
likerequest(login,database,"un"+verb,newsid,rootwindow);}
}
function attend(login,database,attend,newsid,rootwindow,callback){
Helperjs.friendicaPostRequest(login,"/api/friendica/activity/attend"+attend+"?id="+newsid, "","POST",rootwindow,function (obj){
//print("attend: "+attend+obj);
if (obj=='"ok"')
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
//print("attend: "+attend+obj);
if (obj=='"ok"')
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var currentActivities_rs=tx.executeSql('select friendica_activities_self from news WHERE username="'+login.username+'" AND status_id='+newsid) ;
var currentActivities=JSON.parse(currentActivities_rs.rows.item(0).friendica_activities_self);
@ -376,30 +403,30 @@ function attend(login,database,attend,newsid,rootwindow,callback){
currentActivities.push(3);
if (currentActivities.indexOf(4)!=-1){currentActivities.splice(currentActivities.indexOf(4),1)}
if (currentActivities.indexOf(5)!=-1){currentActivities.splice(currentActivities.indexOf(5),1)}
//print(JSON.stringify(currentActivities));
}
if ((attend=="no")&&(currentActivities.indexOf(4)==-1)){
//print(JSON.stringify(currentActivities));
}
if ((attend=="no")&&(currentActivities.indexOf(4)==-1)){
currentActivities.push(4);
if (currentActivities.indexOf(3)!=-1){currentActivities.splice(currentActivities.indexOf(3),1)}
if (currentActivities.indexOf(5)!=-1){currentActivities.splice(currentActivities.indexOf(5),1)}
}
if ((attend=="maybe")&&(currentActivities.indexOf(5)==-1)){
}
if ((attend=="maybe")&&(currentActivities.indexOf(5)==-1)){
currentActivities.push(5);
if (currentActivities.indexOf(3)!=-1){currentActivities.splice(currentActivities.indexOf(3),1)}
if (currentActivities.indexOf(4)!=-1){currentActivities.splice(currentActivities.indexOf(4),1)}
}
}
var result = tx.executeSql('UPDATE news SET friendica_activities_self ="'+JSON.stringify(currentActivities)+'" where username="'+login.username+'" AND status_id ='+newsid);
callback();
})})}
var result = tx.executeSql('UPDATE news SET friendica_activities_self ="'+JSON.stringify(currentActivities)+'" where username="'+login.username+'" AND status_id ='+newsid);
callback();
})})}
function requestConversation(login,database,newsid,contacts,rootwindow,callback){
Helperjs.friendicaRequest(login,"/api/conversation/show?id="+newsid,rootwindow, function (obj){
var news=JSON.parse(obj);
var newContacts=findNewContacts(news,contacts);
// storeNews(login,database,news,rootwindow,callback)
callback(news,newContacts)
})}
var news=JSON.parse(obj);
var newContacts=findNewContacts(news,contacts);
// storeNews(login,database,news,rootwindow,callback)
callback(news,newContacts)
})}
//function conversationfromdb(database,user,conversationId,callback){
// var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
@ -420,120 +447,127 @@ function requestConversation(login,database,newsid,contacts,rootwindow,callback)
function requestFavorites(login,database,contacts,rootwindow,callback){
Helperjs.friendicaRequest(login,"/api/favorites",rootwindow, function (obj){
//print(obj+JSON.stringify(obj));
var news=JSON.parse(obj);
var newContacts=findNewContacts(news,contacts);
// storeNews(login,database,news,rootwindow,callback)
callback(news,newContacts)
})}
//print(obj+JSON.stringify(obj));
var news=JSON.parse(obj);
var newContacts=findNewContacts(news,contacts);
// storeNews(login,database,news,rootwindow,callback)
callback(news,newContacts)
})}
function chatsfromdb(database,login,messagetype,callback,stop_time){
function chatsfromdb(database,login,messagetype,currentconversations,callback,stop_id){
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="'+login.username+'" AND messagetype="'+messagetype+'" ORDER BY created_at DESC LIMIT 1');
stop="<="+rs.rows.item(0).created_at}catch(e){stop="<99999999999999"}}
else{var stop="<"+stop_time}
if (messagetype=="1"){messagetype="1,5"}
var conversationsrs=tx.executeSql('select DISTINCT statusnet_conversation_id from news WHERE username="'+login.username+'" AND created_at'+stop+' AND messagetype IN ( "'+messagetype+'" ) ORDER BY created_at DESC LIMIT 20'); //+' ORDER BY created_at DESC LIMIT 20');
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1');
try{var lastid=result.rows.item(0).status_id;}catch(e){var lastid=0};
var conversations=[];
for(var i = 0; i < conversationsrs.rows.length; i++) {
conversations.push(conversationsrs.rows.item(i).statusnet_conversation_id);
}
var newsArray=[];
var allcontacts=getAllContacts(database,login.username);
if (!stop_id){var stop="";
try{var rs = tx.executeSql('select status_id from news WHERE username="'+login.username+'" AND messagetype="'+messagetype+'" ORDER BY status_id DESC LIMIT 1');
stop="<="+rs.rows.item(0).status_id}catch(e){stop="<99999999999999"}}
else{var stop="<"+stop_id}
if (messagetype=="1"){messagetype="1,5"}
let conversationfilter="";
if (currentconversations.length>0){conversationfilter="AND statusnet_conversation_id NOT IN ("+currentconversations.toString()+") "}
for(var j = 0; j< conversations.length; j++) {
var newsrs=tx.executeSql('select * from news WHERE username="'+login.username+'" AND statusnet_conversation_id="'+conversations[j] +'" AND messagetype="'+messagetype+'" ORDER BY created_at ASC');
//print(JSON.stringify(newsrs.rows.item(0))+JSON.stringify(newsrs.rows.item(1)))
var helpernews=newsrs.rows.item(0);
helpernews=cleanhelpernews(database,login.username,helpernews,allcontacts)
helpernews.currentconversation=[];
for (var h = 0;h<newsrs.rows.length;h++){
var helpernews2=newsrs.rows.item(h);
if(helpernews.id!=helpernews2.status_id){
helpernews2.newscount=0;
helpernews2=cleanhelpernews(database,login.username,helpernews2,allcontacts)
helpernews.currentconversation.push(helpernews2)
}
var conversationsrs=tx.executeSql('select DISTINCT statusnet_conversation_id from news WHERE username="'+login.username+'" AND status_id'+stop+' AND messagetype IN ( "'+messagetype+'" ) '+ conversationfilter +'ORDER BY created_at DESC LIMIT 20'); //+' ORDER BY created_at DESC LIMIT 20');
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1');
try{var lastid=result.rows.item(0).status_id;}catch(e){var lastid=0};
var conversations=[];
for(var i = 0; i < conversationsrs.rows.length; i++) {
conversations.push(conversationsrs.rows.item(i).statusnet_conversation_id);
}
var newsArray=[];
var allcontacts=getAllContacts(database,login.username);
helpernews.newscount=newsrs.rows.length;
newsArray.push(helpernews);
}
callback(newsArray,lastid);
})}
for(var j = 0; j< conversations.length; j++) {
var newsrs=tx.executeSql('select * from news WHERE username="'+login.username+'" AND statusnet_conversation_id="'+conversations[j] +'" AND messagetype="'+messagetype+'" ORDER BY created_at ASC');
//print(JSON.stringify(newsrs.rows.item(0))+JSON.stringify(newsrs.rows.item(1)))
var helpernews=newsrs.rows.item(0);
helpernews=cleanhelpernews(database,login.username,helpernews,allcontacts)
helpernews.currentconversation=[];
for (var h = 0;h<newsrs.rows.length;h++){
var helpernews2=newsrs.rows.item(h);
if(helpernews.id!=helpernews2.status_id){
helpernews2.newscount=0;
helpernews2=cleanhelpernews(database,login.username,helpernews2,allcontacts)
helpernews.currentconversation.push(helpernews2)
}
}
helpernews.newscount=newsrs.rows.length;
newsArray.push(helpernews);
}
callback(newsArray,lastid);
})}
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);
var helpernews=cleanhelpernews(database,user,helpernews,allcontacts)
helpernews.currentconversation=[];
for (var h = 0;h<newsrs.rows.length;h++){
var helpernews2=newsrs.rows.item(h);
if(helpernews.id!=helpernews2.status_id){
helpernews2.newscount=0;
helpernews2=cleanhelpernews(database,user,helpernews2,allcontacts)
helpernews.currentconversation.push(helpernews2)
}
// 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);
var helpernews=cleanhelpernews(database,user,helpernews,allcontacts)
helpernews.currentconversation=[];
for (var h = 0;h<newsrs.rows.length;h++){
var helpernews2=newsrs.rows.item(h);
if(helpernews.id!=helpernews2.status_id){
helpernews2.newscount=0;
helpernews2=cleanhelpernews(database,user,helpernews2,allcontacts)
helpernews.currentconversation.push(helpernews2)
}
}
newsArray.push(helpernews);
countArray.push(newsrs.rows.length)
}
var conversationsobject=({});
newsArray.push(helpernews);
countArray.push(newsrs.rows.length)
}
var conversationsobject=({});
conversationsobject.conversationIds=conversationIds;
conversationsobject.newsArray=newsArray;
conversationsobject.countArray=countArray;
callback(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 helpernews=cleanhelpernews(database,user,helpernews,allcontacts)
helpernews.currentconversation=[];
for (var h = 0;h<newsrs.rows.length;h++){
var helpernews2=newsrs.rows.item(h);
if(helpernews.id!=helpernews2.status_id){
helpernews2.newscount=0;
helpernews2=cleanhelpernews(database,user,helpernews2,allcontacts)
helpernews.currentconversation.push(helpernews2)
}
// 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');
let conversation=[];
var helpernews={currentconversation:conversation}
if(newsrs.rows.length>0){
//helpernews=newsrs.rows.item(0);
//helpernews=cleanhelpernews(database,user,helpernews,allcontacts)
//helpernews.currentconversation=[];
for (var h = 0;h<newsrs.rows.length;h++){
var helpernews2=newsrs.rows.item(h);
if(helpernews.id!=helpernews2.status_id){
helpernews2.newscount=0;
helpernews2=cleanhelpernews(database,user,helpernews2,allcontacts)
//print(" helpernews "+JSON.stringify(helpernews.currentconversation))
helpernews.currentconversation.push(helpernews2)
}
var newscount=newsrs.rows.length;
callback(helpernews,newscount);}
// var conversationobject={news:helpernews,newscount:newscount};
// return conversationobject;
})}
}
}
var newscount=newsrs.rows.length;
callback(helpernews,newscount);
// var conversationobject={news:helpernews,newscount:newscount};
// return conversationobject;
})
}
function cleanhelpernews(database,user,helpernews,allcontacts){
helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
@ -582,5 +616,5 @@ function cleanDate(date){
}
function findTags(fulltext){
return fulltext.match(/\s+[#]+[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]+/g)
return fulltext.match(/\s+[#]+[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]+/g)
}

View file

@ -50,76 +50,57 @@ function beautify(newsitemobject,msg){
var 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(4)!=-1){self.attending=qsTr("no")}
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(2)!=-1){self.disliked=1}
}
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(5)!=-1){self.attending=qsTr("maybe")}
if (newsitemobject.friendica_activities_self.indexOf(1)!=-1){self.liked=1}
if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
}
var friendica_activities={self:self}
var imageAttachmentList=[];
var videoAttachmentList=[];
var videoformats=["mp4", "avi", "webm","ogg","mp3"]
try{if(newsitemobject.attachments){
var attachArray=newsitemobject.attachments;
for (var image in attachArray){
var attachhelper={mimetype:attachArray[image].mimetype}
var attachhelperstring="<img" //Qt.btoa(attachArray[image].url)
var helperstringposition=newsitemobject.statusnet_html.indexOf(attachhelperstring);
// if (helperstringposition>-1){attachhelper.url=newsitemobject.statusnet_html.substring(newsitemobject.statusnet_html.lastIndexOf("http",helperstringposition),helperstringposition+attachhelperstring.length);
// if (attachArray[image].mimetype=="image/jpeg"){attachhelper.url=attachhelper.url+".jpg"}
// else if (attachArray[image].mimetype=="image/gif"){attachhelper.url=attachhelper.url+".gif"}
// else if (attachArray[image].mimetype=="image/png"){attachhelper.url=attachhelper.url+".png"}
// }
// else {
var attachArray=newsitemobject.attachments;
for (var image in attachArray){
var attachhelper={mimetype:attachArray[image].mimetype}
var attachhelperstring="<img"
var helperstringposition=newsitemobject.statusnet_html.indexOf(attachhelperstring);
attachhelper.url=attachArray[image].url
// }
if (helperstringposition>-1){var removeme=newsitemobject.statusnet_html.substring(helperstringposition,newsitemobject.statusnet_html.indexOf('">',helperstringposition)+2);}
//print("Attachhelper "+attachhelper.url)
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(removeme,"")
//newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url.substring(0,attachhelper.url.length-4)+".jpeg","")
//newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url.substring(0,attachhelper.url.length-4),"")
imageAttachmentList.push(attachhelper)
if (helperstringposition>-1){var removeme=newsitemobject.statusnet_html.substring(helperstringposition,newsitemobject.statusnet_html.indexOf('">',helperstringposition)+2);}
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(removeme,"")
imageAttachmentList.push(attachhelper)
}
}
}
}catch(e){print("attachment "+e)}
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(/class=\"attachment-image\"/g,"width=\"600\" ");
for (var format in videoformats){
if (newsitemobject.text.indexOf("."+videoformats[format])>-1){
var videohelper={mimetype:"video/"+videoformats[format]}
var videotext=newsitemobject.text;
while (videotext.indexOf("."+videoformats[format])>-1){
var videohelperstringposition=videotext.indexOf("."+videoformats[format]);
videohelper.url=videotext.substring(videotext.lastIndexOf("http",videohelperstringposition),videohelperstringposition+4);
videotext=videotext.substring(videohelperstringposition+4,videotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=videohelper.url)){videoAttachmentList.push(videohelper)}
}
}
var videohelper={mimetype:"video/"+videoformats[format]}
var videotext=newsitemobject.text;
while (videotext.indexOf("."+videoformats[format])>-1){
var videohelperstringposition=videotext.indexOf("."+videoformats[format]);
videohelper.url=videotext.substring(videotext.lastIndexOf("http",videohelperstringposition),videohelperstringposition+4);
videotext=videotext.substring(videohelperstringposition+4,videotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=videohelper.url)){videoAttachmentList.push(videohelper)}
}
}
}
if (newsitemobject.text.indexOf("/videos/watch/")>-1){
var ptvideohelper={mimetype:"video/mp4"}
var ptvideotext=newsitemobject.text;
while (ptvideotext.indexOf("/videos/watch/")>-1){
var ptvideohelperstringposition=ptvideotext.indexOf("/videos/watch/");
var ptposend=findend(ptvideotext,ptvideohelperstringposition);
if(ptposend==-1){ptposend=ptvideotext.length};
ptvideohelper.url=ptvideotext.substring(ptvideotext.lastIndexOf("http",ptvideohelperstringposition),ptposend)+"-480.mp4";
ptvideohelper.url=ptvideohelper.url.replace("/videos/watch","/static/webseed");
ptvideotext=ptvideotext.substring(ptposend,ptvideotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ptvideohelper.url)){videoAttachmentList.push(ptvideohelper)}
}
}
if (newsitemobject.text.indexOf("youtube.com/watch?v")>-1){
var yttext=newsitemobject.text;
while (yttext.indexOf("youtube.com/watch?v")>-1){
var ythelperstringposition=yttext.indexOf("watch?v=");
var ytposend=findend(yttext,ythelperstringposition);
var ythelper={mimetype:"video/youtube"}
ythelper.url=yttext.substring(ythelperstringposition+8,ytposend);
yttext=yttext.substring(ytposend,yttext.length);
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ythelper.url)){videoAttachmentList.push(ythelper)}
}
var ptvideohelper={mimetype:"video/mp4"}
var ptvideotext=newsitemobject.text;
while (ptvideotext.indexOf("/videos/watch/")>-1){
var ptvideohelperstringposition=ptvideotext.indexOf("/videos/watch/");
var ptposend=findend(ptvideotext,ptvideohelperstringposition);
if(ptposend==-1){ptposend=ptvideotext.length};
ptvideohelper.url=ptvideotext.substring(ptvideotext.lastIndexOf("http",ptvideohelperstringposition),ptposend)+"-480.mp4";
ptvideohelper.url=ptvideohelper.url.replace("/videos/watch","/static/webseed");
ptvideotext=ptvideotext.substring(ptposend,ptvideotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ptvideohelper.url)){videoAttachmentList.push(ptvideohelper)}
}
}
newsitemobject.videoAttachmentList=videoAttachmentList;
newsitemobject.imageAttachmentList=imageAttachmentList;
if ((msg.options.hasOwnProperty("hide_nsfw"))&&(msg.options.hide_nsfw==1)&&(newsitemobject.text.indexOf("#nsfw")>-1)){
@ -132,48 +113,42 @@ function beautify(newsitemobject,msg){
return newsitemobject;
}
WorkerScript.onMessage = function(msg) {
if(msg.deleteId!==undefined)
if(msg.deleteId!==undefined)
{msg.model.remove(msg.deleteId);
msg.model.sync()
}
else{
if(msg.method=="refresh" || msg.method=="contact" ||(msg.method=="conversation"&&msg.news.length>0)){msg.model.clear()};
msg.model.sync()
//for (var j=0;j<msg.news.length;j++){
for (var j in msg.news){
let data=({})
if (msg.news[j]) {
var newsitemobject=msg.news[j];
newsitemobject=beautify(newsitemobject,msg);
if (newsitemobject.hasOwnProperty("currentconversation")&&(newsitemobject.currentconversation.length>0)){
newsitemobject.lastcomment=beautify(newsitemobject.currentconversation[newsitemobject.currentconversation.length-1],msg);
newsitemobject.lastcomment.indent=1
}
if (msg.method=="conversation"){
if (j==0){newsitemobject.indent=0}else{
for (var k=msg.model.count-1;k>-1;k--){
if (newsitemobject.in_reply_to_status_id==msg.model.get(k).newsitemobject.id){
newsitemobject.indent=(msg.model.get(k).newsitemobject.indent||0)+1;
if (newsitemobject.indent>6){newsitemobject.indent=6};
}
}
}}
data=({"newsitemobject": newsitemobject})
}
if(msg.method=="append") {
msg.model.insert(j, data)}
else{
msg.model.append(data)
}
}
//if (j==msg.news.length){
msg.model.sync()
//}
}
}
else{
if(msg.method=="refresh" || msg.method=="contact" ||(msg.method=="conversation"&&msg.news.length>0)){msg.model.clear()};
msg.model.sync()
for (var j in msg.news){
let data=({});
if (typeof(msg.news[j])=='object') {
var newsitemobject=msg.news[j];
newsitemobject=beautify(newsitemobject,msg);
if (!(typeof(newsitemobject.currentconversation)=='undefined') && (newsitemobject.currentconversation.length>0)){
newsitemobject.lastcomment=beautify(newsitemobject.currentconversation[newsitemobject.currentconversation.length-1],msg);
newsitemobject.lastcomment.indent=1
newsitemobject.lastcomment.isLastComment=true
}
if (msg.method=="conversation"){
if (j==0){newsitemobject.indent=0}else{
for (var k=msg.model.count-1;k>-1;k--){
if (newsitemobject.in_reply_to_status_id==msg.model.get(k).newsitemobject.id){
newsitemobject.indent=(msg.model.get(k).newsitemobject.indent||0)+1;
if (newsitemobject.indent>6){newsitemobject.indent=6};
}
}
}}
data=({"newsitemobject": newsitemobject})
}
if(msg.method=="append") {
msg.model.insert(j, data)}
else{
msg.model.append(data)
}
}
msg.model.sync()
}
}

View file

@ -45,7 +45,7 @@ function initDatabase(database) { // initialize the database object
tx.executeSql('CREATE TABLE IF NOT EXISTS config(server TEXT, username TEXT, password TEXT, imagestore TEXT, maxnews INT, timerInterval INT, newsViewType TEXT,isActive INT, permissions TEXT,maxContactAge INT,APIVersion TEXT,layout TEXT, addons TEXT)');
tx.executeSql('CREATE TABLE IF NOT EXISTS news(username TEXT, messagetype INT, text TEXT, created_at INT, in_reply_to_status_id INT, source TEXT, status_id INT, in_reply_to_user_id INT, geo TEXT,favorited TEXT, uid INT, statusnet_html TEXT, statusnet_conversation_id TEXT,friendica_activities TEXT, friendica_activities_self TEXT, attachments TEXT, friendica_owner TEXT)');
tx.executeSql('CREATE TABLE IF NOT EXISTS contacts(username TEXT, id INT, name TEXT, screen_name TEXT, location TEXT,imageAge INT, profile_image_url TEXT, description TEXT, profile_image BLOB, url TEXT, protected TEXT, followers_count INT, friends_count INT, created_at INT, favourites_count TEXT, utc_offset TEXT, time_zone TEXT, statuses_count INT, following TEXT, verified TEXT, statusnet_blocking TEXT, notifications TEXT, statusnet_profile_url TEXT, cid INT, network TEXT, isFriend INT, timestamp INT)');
// tx.executeSql('CREATE INDEX IF NOT EXISTS contact_id ON contacts(id)');
// tx.executeSql('CREATE INDEX IF NOT EXISTS contact_id ON contacts(id)');
tx.executeSql('CREATE TABLE IF NOT EXISTS profiles(username TEXT, id INT, profiledata TEXT)');
tx.executeSql('CREATE TABLE IF NOT EXISTS groups(username TEXT, groupname TEXT, gid INT, members TEXT)');
tx.executeSql('CREATE TABLE IF NOT EXISTS events(username TEXT, id INT, start INT, end INT, allday INT, title TEXT, j INT, d TEXT, isFirst INT, uid INT, cid INT, uri TEXT, created INT, edited INT, desc TEXT, location TEXT, type TEXT, nofinish TEXT, adjust INT, ignore INT, permissions TEXT, guid INT, itemid INT, plink TEXT, authorName TEXT, authorAvatar TEXT, authorLink TEXT, html TEXT)');
@ -59,99 +59,99 @@ function initDatabase(database) { // initialize the database object
function cleanPermissions(oldperms){
var newperms=oldperms.replace("<","");newperms=newperms.replace(">","");newperms="["+newperms+"]";
var newpermArray=JSON.parse(newperms);
return (newpermArray)
return (newpermArray)
}
function getEvents(database,login,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]);
Helperjs.friendicaWebRequest(login.server+"/cal/"+login.username+"/json",rootwindow,function(obj){
//Helperjs.friendicaRemoteAuthRequest(login,login.server+"/cal/"+login.username+"/json",login.server+"/profile/"+login.username,rootwindow,function(obj){
var events = JSON.parse(obj);
db.transaction( function(tx) {
for (var i=0;i<events.length;i++){
var permissions=[];
permissions.push(cleanPermissions(events[i].item.allow_cid));
permissions.push(cleanPermissions(events[i].item.allow_gid));
permissions.push(cleanPermissions(events[i].item.deny_cid));
permissions.push(cleanPermissions(events[i].item.deny_gid));
var result = tx.executeSql('SELECT * from events where username="'+login.username+'" AND id = '+events[i].id); // check for news id
if(result.rows.length === 1) {// use update
result = tx.executeSql('UPDATE events SET username="'+login.username+'", start="'+Date.parse(events[i].start)+'", end="'+Date.parse(events[i].end)+'", allday="'+Number(events[i].allday)+'", title="'+events[i].title+'", j="'+events[i].j+'", d="'+events[i].d+ '", isFirst="'+Number(events[i].isFirst)+'", uid="'+events[i].item.uid+'", cid="'+events[i].item.cid+'", uri="'+events[i].item.uri+'", created="'+ Date.parse(events[i].item.created)+'", edited="'+ Date.parse(events[i].item.edited)+'", desc="'+events[i].item.desc+'", location="'+events[i].item.location+'", type="'+events[i].item.type+'", nofinish="'+events[i].item.nofinish+'", adjust ="'+events[i].item.adjust+'", ignore="'+events[i].item.ignore+'", permissions="'+ JSON.stringify(permissions)+'", guid="'+events[i].item.guid+'", itemid="'+events[i].item.itemid+ '", plink="'+events[i].item.plink+ '", authorName="'+events[i].item["author-name"]+ '", authorAvatar="'+events[i].item["author-avatar"]+ '", authorLink="'+events[i].item["author-link"]+ '", html="'+Qt.btoa(events[i].html)+'" where username="'+login.username+'" AND id='+events[i].id);
} else {// use insert
result = tx.executeSql('INSERT INTO events (username,id,start,end,allday,title,j,d,isFirst,uid,cid,uri,created,edited,desc,location,type,nofinish,adjust,ignore,permissions,guid,itemid,plink,authorName,authorAvatar,authorLink,html) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username, events[i].id, Date.parse(events[i].start), Date.parse(events[i].end), events[i].allday, events[i].title, events[i].j, events[i].d, events[i].isFirst, events[i].item.uid, events[i].item.cid, events[i].item.uri, Date.parse(events[i].item.created), Date.parse(events[i].item.edited), events[i].item.desc, events[i].item.location, events[i].item.type, events[i].item.nofinish, events[i].item.adjust, events[i].item.ignore, JSON.stringify(permissions), events[i].item.guid, events[i].item.itemid, events[i].item.plink, events[i].item["author-name"], events[i].item["author-avatar"], events[i].item["author-link"], Qt.btoa(events[i].html)])}
callback()
}
})})}
//Helperjs.friendicaRemoteAuthRequest(login,login.server+"/cal/"+login.username+"/json",login.server+"/profile/"+login.username,rootwindow,function(obj){
var events = JSON.parse(obj);
db.transaction( function(tx) {
for (var i=0;i<events.length;i++){
var permissions=[];
permissions.push(cleanPermissions(events[i].item.allow_cid));
permissions.push(cleanPermissions(events[i].item.allow_gid));
permissions.push(cleanPermissions(events[i].item.deny_cid));
permissions.push(cleanPermissions(events[i].item.deny_gid));
var result = tx.executeSql('SELECT * from events where username="'+login.username+'" AND id = '+events[i].id); // check for news id
if(result.rows.length === 1) {// use update
result = tx.executeSql('UPDATE events SET username="'+login.username+'", start="'+Date.parse(events[i].start)+'", end="'+Date.parse(events[i].end)+'", allday="'+Number(events[i].allday)+'", title="'+events[i].title+'", j="'+events[i].j+'", d="'+events[i].d+ '", isFirst="'+Number(events[i].isFirst)+'", uid="'+events[i].item.uid+'", cid="'+events[i].item.cid+'", uri="'+events[i].item.uri+'", created="'+ Date.parse(events[i].item.created)+'", edited="'+ Date.parse(events[i].item.edited)+'", desc="'+events[i].item.desc+'", location="'+events[i].item.location+'", type="'+events[i].item.type+'", nofinish="'+events[i].item.nofinish+'", adjust ="'+events[i].item.adjust+'", ignore="'+events[i].item.ignore+'", permissions="'+ JSON.stringify(permissions)+'", guid="'+events[i].item.guid+'", itemid="'+events[i].item.itemid+ '", plink="'+events[i].item.plink+ '", authorName="'+events[i].item["author-name"]+ '", authorAvatar="'+events[i].item["author-avatar"]+ '", authorLink="'+events[i].item["author-link"]+ '", html="'+Qt.btoa(events[i].html)+'" where username="'+login.username+'" AND id='+events[i].id);
} else {// use insert
result = tx.executeSql('INSERT INTO events (username,id,start,end,allday,title,j,d,isFirst,uid,cid,uri,created,edited,desc,location,type,nofinish,adjust,ignore,permissions,guid,itemid,plink,authorName,authorAvatar,authorLink,html) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username, events[i].id, Date.parse(events[i].start), Date.parse(events[i].end), events[i].allday, events[i].title, events[i].j, events[i].d, events[i].isFirst, events[i].item.uid, events[i].item.cid, events[i].item.uri, Date.parse(events[i].item.created), Date.parse(events[i].item.edited), events[i].item.desc, events[i].item.location, events[i].item.type, events[i].item.nofinish, events[i].item.adjust, events[i].item.ignore, JSON.stringify(permissions), events[i].item.guid, events[i].item.itemid, events[i].item.plink, events[i].item["author-name"], events[i].item["author-avatar"], events[i].item["author-link"], Qt.btoa(events[i].html)])}
callback()
}
})})}
function newscount(database, callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var newscountrs = tx.executeSql('SELECT COUNT(*) from news');
var newscount = newscountrs.rows.item(0)["COUNT(*)"];
callback(newscount)
db.transaction( function(tx) {
var newscountrs = tx.executeSql('SELECT COUNT(*) from news');
var newscount = newscountrs.rows.item(0)["COUNT(*)"];
callback(newscount)
})
}
function eventsfromdb(database, username,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 allcontacts=[];
allcontacts=Newsjs.getAllContacts(root.db,login.username);
db.transaction( function(tx) {
var eventrs=tx.executeSql('select * from events WHERE username="'+username+'" ORDER BY start ASC');
var eventArray=[];
var dayArray=[];
for(var i = 0; i < eventrs.rows.length; i++) {
eventArray.push(eventrs.rows.item(i));
if (eventArray[i].cid!=0){eventArray[i]["eventOwner"]=Newsjs.objFromArray(allcontacts,"cid",eventArray[i].cid);}
else{eventArray[i]["eventOwner"]=Newsjs.objFromArray(allcontacts,"isFriend",2);}
var startday=Math.floor((eventArray[i].start-new Date(eventArray[i].start).getTimezoneOffset() * 60 * 1000)/86400000);
var endday=Math.floor((eventArray[i].end-1-new Date(eventArray[i].end).getTimezoneOffset() * 60 * 1000)/86400000);if (endday<startday){endday=startday}
eventArray[i]["startday"]=startday;eventArray[i]["endday"]=endday;
dayArray.push(startday);
if (endday>startday){
for (var j=startday+1;j<endday+1;j++){dayArray.push(j)}
var eventrs=tx.executeSql('select * from events WHERE username="'+username+'" ORDER BY start ASC');
var eventArray=[];
var dayArray=[];
for(var i = 0; i < eventrs.rows.length; i++) {
eventArray.push(eventrs.rows.item(i));
if (eventArray[i].cid!=0){eventArray[i]["eventOwner"]=Newsjs.objFromArray(allcontacts,"cid",eventArray[i].cid);}
else{eventArray[i]["eventOwner"]=Newsjs.objFromArray(allcontacts,"isFriend",2);}
var startday=Math.floor((eventArray[i].start-new Date(eventArray[i].start).getTimezoneOffset() * 60 * 1000)/86400000);
var endday=Math.floor((eventArray[i].end-1-new Date(eventArray[i].end).getTimezoneOffset() * 60 * 1000)/86400000);if (endday<startday){endday=startday}
eventArray[i]["startday"]=startday;eventArray[i]["endday"]=endday;
dayArray.push(startday);
if (endday>startday){
for (var j=startday+1;j<endday+1;j++){dayArray.push(j)}
}
}
}
callback(eventArray,dayArray)});
callback(eventArray,dayArray)});
}
function requestFriendsEvents(login,friend,rootwindow,callback){
// get calendar JSON object of contact without user and password
// get calendar JSON object of contact without user and password
Helperjs.friendicaWebRequest(friend.replace("profile","cal")+"/json",rootwindow,function(calhtml){
//print(calhtml);
var eventarray=[];var eventdays=[];
var events=JSON.parse(calhtml);
for (var i=0;i<events.length;i++){
var permissions=[];
permissions.push(cleanPermissions(events[i].item.allow_cid));
permissions.push(cleanPermissions(events[i].item.allow_gid));
permissions.push(cleanPermissions(events[i].item.deny_cid));
permissions.push(cleanPermissions(events[i].item.deny_gid));
var event ={}
event.start=Date.parse(events[i].start);event.end=Date.parse(events[i].end);
event.allday=events[i].allday; event.title=events[i].title; event.j=events[i].j;
event.d=events[i].d; event.isFirst=events[i].isFirst; event.uid=events[i].item.uid;
event.cid=events[i].item.cid; event.uri=events[i].item.uri;
event.created=Date.parse(events[i].item.created); event.edited=Date.parse(events[i].item.edited);
event.desc=events[i].item.desc; event.location=events[i].item.location; event.type=events[i].item.type;
event.nofinish=events[i].item.nofinish; event.adjust =events[i].item.adjust; event.ignore=events[i].item.ignore;
event.permissions=JSON.stringify(permissions); event.guid=events[i].item.guid;
event.itemid=events[i].item.itemid; event.plink=events[i].plink; event.authorName=events[i].item["author-name"];
event.authorAvatar=events[i].item["author-avatar"]; event. authorLink=events[i].item["author-link"];
event.html=Qt.btoa(events[i].html);
eventarray.push(event);
// var offsetTime = new Date().getTimezoneOffset() * 60 * 1000;print(new Date(event.start).toLocaleString()+"Zeitverschiebung:"+offsetTime)
// var time = event.start - offsetTime;
eventdays.push(Math.floor(event.start/(24*60*60*1000)))
}
//print(JSON.stringify(eventarray));
callback(eventarray,eventdays)
})
//print(calhtml);
var eventarray=[];var eventdays=[];
var events=JSON.parse(calhtml);
for (var i=0;i<events.length;i++){
var permissions=[];
permissions.push(cleanPermissions(events[i].item.allow_cid));
permissions.push(cleanPermissions(events[i].item.allow_gid));
permissions.push(cleanPermissions(events[i].item.deny_cid));
permissions.push(cleanPermissions(events[i].item.deny_gid));
var event ={}
event.start=Date.parse(events[i].start);event.end=Date.parse(events[i].end);
event.allday=events[i].allday; event.title=events[i].title; event.j=events[i].j;
event.d=events[i].d; event.isFirst=events[i].isFirst; event.uid=events[i].item.uid;
event.cid=events[i].item.cid; event.uri=events[i].item.uri;
event.created=Date.parse(events[i].item.created); event.edited=Date.parse(events[i].item.edited);
event.desc=events[i].item.desc; event.location=events[i].item.location; event.type=events[i].item.type;
event.nofinish=events[i].item.nofinish; event.adjust =events[i].item.adjust; event.ignore=events[i].item.ignore;
event.permissions=JSON.stringify(permissions); event.guid=events[i].item.guid;
event.itemid=events[i].item.itemid; event.plink=events[i].plink; event.authorName=events[i].item["author-name"];
event.authorAvatar=events[i].item["author-avatar"]; event. authorLink=events[i].item["author-link"];
event.html=Qt.btoa(events[i].html);
eventarray.push(event);
// var offsetTime = new Date().getTimezoneOffset() * 60 * 1000;print(new Date(event.start).toLocaleString()+"Zeitverschiebung:"+offsetTime)
// var time = event.start - offsetTime;
eventdays.push(Math.floor(event.start/(24*60*60*1000)))
}
//print(JSON.stringify(eventarray));
callback(eventarray,eventdays)
})
}
function newRequestFriendsEvents(login,friend,rootwindow,callback){
// get calendar JSON object of contact with remoteAuth or without user and password
// get calendar JSON object of contact with remoteAuth or without user and password
if(friend.isFriend==1){
Helperjs.friendicaRemoteAuthRequest(login,friend.url.replace("profile","cal")+"/json",friend.url,rootwindow,function(calhtml){
getEventsFromHtml(calhtml,rootwindow,callback)})
@ -185,8 +185,8 @@ function getEventsFromHtml(calhtml,rootwindow,callback){
event.authorAvatar=events[i].item["author-avatar"]; event. authorLink=events[i].item["author-link"];
event.html=Qt.btoa(events[i].html);
eventarray.push(event);
// var offsetTime = new Date().getTimezoneOffset() * 60 * 1000;print(new Date(event.start).toLocaleString()+"Zeitverschiebung:"+offsetTime)
// var time = event.start - offsetTime;
// var offsetTime = new Date().getTimezoneOffset() * 60 * 1000;print(new Date(event.start).toLocaleString()+"Zeitverschiebung:"+offsetTime)
// var time = event.start - offsetTime;
eventdays.push(Math.floor(event.start/(24*60*60*1000)))
}
//print(JSON.stringify(eventarray));
@ -194,61 +194,60 @@ function getEventsFromHtml(calhtml,rootwindow,callback){
}
function savePermissions(database,obj) { // stores config to DB
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var permissions=JSON.stringify(obj)
db.transaction( function(tx) {
var result = tx.executeSql( 'UPDATE config SET permissions="'+permissions+'" WHERE username="'+obj.username +'"');
})
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var permissions=JSON.stringify(obj)
db.transaction( function(tx) {
var result = tx.executeSql( 'UPDATE config SET permissions="'+permissions+'" WHERE username="'+obj.username +'"');
})
}
function storeConfig(database,obj) { // stores config to DB
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
//print(JSON.stringify(obj));
var result = tx.executeSql('SELECT * from config WHERE username="'+obj.username+'"');
if(result.rows.length === 1) {// use update
var result2 = tx.executeSql('UPDATE config SET server="'+obj.server+'",password="'+obj.password+'", imagestore="'+obj.imagestore+'", maxnews=0, timerInterval=0, newsViewType="'+obj.newsViewType+'", isActive=0 WHERE username="'+obj.username +'"');
var result3 = tx.executeSql('UPDATE config SET isActive=1 WHERE username !="'+obj.username +'"');
} else {// use insert print('... does not exists, create it')
var result2 = tx.executeSql('INSERT INTO config VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)', [obj.server, obj.username, obj.password, obj.imagestore, 0, 0,obj.newsViewType,0,"[[],[],[],[]]",0,"","",""]);
var result3 = tx.executeSql('UPDATE config SET isActive=1 WHERE username !="'+obj.username +'"');
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
//print(JSON.stringify(obj));
var result = tx.executeSql('SELECT * from config WHERE username="'+obj.username+'"');
if(result.rows.length === 1) {// use update
var result2 = tx.executeSql('UPDATE config SET server="'+obj.server+'",password="'+obj.password+'", imagestore="'+obj.imagestore+'", maxnews="'+obj.accountId+'", timerInterval=0, newsViewType="'+obj.newsViewType+'", isActive=0 WHERE username="'+obj.username +'"');
var result3 = tx.executeSql('UPDATE config SET isActive=1 WHERE username !="'+obj.username +'"');
} else {// use insert print('... does not exists, create it')
var result2 = tx.executeSql('INSERT INTO config VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)', [obj.server, obj.username, obj.password, obj.imagestore, obj.accountId, 0,obj.newsViewType,0,"[[],[],[],[]]",0,"","",""]);
var result3 = tx.executeSql('UPDATE config SET isActive=1 WHERE username !="'+obj.username +'"');
}
})}
function showServerConfig(url,rootwindow,callback){//print(url);
Helperjs.friendicaWebRequest(url+"/api/statusnet/config",rootwindow, function (obj){
var serverconfig = JSON.parse(obj);
var serverConfigString="import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:'Server';standardButtons: StandardButton.Ok;text: 'Name: "+serverconfig.site.name+"\nLanguage: "+serverconfig.site.language+
"\nEmail: "+serverconfig.site.email+"\nTimezone: "+serverconfig.site.timezone+"\nClosed: "+serverconfig.site.closed+
"\nText limit: "+serverconfig.site.textlimit+"\nShort Url length: "+serverconfig.site.shorturllength+
"\nFriendica version: "+serverconfig.site.friendica.FRIENDICA_VERSION+"\nDFRN version: "+serverconfig.site.friendica.DFRN_PROTOCOL_VERSION +
"\nDB Update version: "+serverconfig.site.friendica.DB_UPDATE_VERSION+"'}";
callback(serverConfigString)
})}
function checkLogin(login,rootwindow,callback){
// check server with given credentials
try {Helperjs.friendicaRequest(login,"/api/account/verify_credentials",rootwindow, function (obj){
var account = JSON.parse(obj);
callback(account)
})}
catch(e){}
}
function showServerConfig(url,rootwindow,callback){
Helperjs.friendicaWebRequest(url+"/api/statusnet/config",rootwindow, function (obj){
var serverconfig = JSON.parse(obj);
var serverConfigString="import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:'Server';standardButtons: StandardButton.Ok;text: 'Name: "+serverconfig.site.name+"\nLanguage: "+serverconfig.site.language+
"\nEmail: "+serverconfig.site.email+"\nTimezone: "+serverconfig.site.timezone+"\nClosed: "+serverconfig.site.closed+
"\nText limit: "+serverconfig.site.textlimit+"\nShort Url length: "+serverconfig.site.shorturllength+
"\nFriendica version: "+serverconfig.site.friendica.FRIENDICA_VERSION+"\nDFRN version: "+serverconfig.site.friendica.DFRN_PROTOCOL_VERSION +
"\nDB Update version: "+serverconfig.site.friendica.DB_UPDATE_VERSION+"'}";
callback(serverConfigString)
})}
//function checkLogin(login,rootwindow,callback){
// // check server with given credentials
// try {Helperjs.friendicaRequest(login,"/api/account/verify_credentials",rootwindow, function (obj){
// var account = JSON.parse(obj);
// callback(account)
// })}
// catch(e){}
//}
function requestProfile(login,database,rootwindow,callback){
// return profile data
// return profile data
Helperjs.friendicaRequest(login,"/api/friendica/profile/show", rootwindow,function (obj){
var profiledata=JSON.parse(obj);
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
for (var i=0;i<profiledata.profiles.length;i++){
//print('store profile data for '+JSON.stringify(profiledata.profiles[i]));
db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from profiles where username="'+login.username+'" AND id = '+profiledata.profiles[i].profile_id); // check for profile id
if(result.rows.length === 1) {// use update
result = tx.executeSql('UPDATE profiles SET profiledata="'+ Qt.btoa(JSON.stringify(profiledata.profiles[i]))+'" WHERE username="'+login.username+'" AND id='+parseInt(profiledata.profiles[i].profile_id));
} else {// use insert
result = tx.executeSql('INSERT INTO profiles (username,id,profiledata) VALUES (?,?,?)', [login.username,profiledata.profiles[i].profile_id,Qt.btoa(JSON.stringify(profiledata.profiles[i]))])}
});
var result = tx.executeSql('SELECT * from profiles where username="'+login.username+'" AND id = '+profiledata.profiles[i].profile_id); // check for profile id
if(result.rows.length === 1) {// use update
result = tx.executeSql('UPDATE profiles SET profiledata="'+ Qt.btoa(JSON.stringify(profiledata.profiles[i]))+'" WHERE username="'+login.username+'" AND id='+parseInt(profiledata.profiles[i].profile_id));
} else {// use insert
result = tx.executeSql('INSERT INTO profiles (username,id,profiledata) VALUES (?,?,?)', [login.username,profiledata.profiles[i].profile_id,Qt.btoa(JSON.stringify(profiledata.profiles[i]))])}
});
}
var profile=profiledata.friendica_owner;
profile.isFriend=2;
@ -258,22 +257,22 @@ function requestProfile(login,database,rootwindow,callback){
}
function getServerConfig(database,login,rootwindow,callback){
// check server with given credentials
try {Helperjs.friendicaRequest(login,"/api/statusnet/config",rootwindow, function (obj){
var serverconfig = JSON.parse(obj);
var serverconfigString="import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:'Server';standardButtons: StandardButton.Ok;text: 'SUCCESS! \nName: "+serverconfig.site.name+"\nLanguage: "+serverconfig.site.language+
"\nEmail: "+serverconfig.site.email+"\nTimezone: "+serverconfig.site.timezone+"\nClosed: "+serverconfig.site.closed+
"\nText limit: "+serverconfig.site.textlimit+"\nShort Url length: "+serverconfig.site.shorturllength+
"\nFriendica version: "+serverconfig.site.friendica.FRIENDICA_VERSION+"\nDFRN version: "+serverconfig.site.friendica.DFRN_PROTOCOL_VERSION +
"\nDB Update version: "+serverconfig.site.friendica.DB_UPDATE_VERSION+"'}";
// check server with given credentials
try {Helperjs.friendicaRequest(login,"/api/statusnet/config",rootwindow, function (obj){
var serverconfig = JSON.parse(obj);
var serverconfigString="import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:'Server';standardButtons: StandardButton.Ok;text: 'SUCCESS! \nName: "+serverconfig.site.name+"\nLanguage: "+serverconfig.site.language+
"\nEmail: "+serverconfig.site.email+"\nTimezone: "+serverconfig.site.timezone+"\nClosed: "+serverconfig.site.closed+
"\nText limit: "+serverconfig.site.textlimit+"\nShort Url length: "+serverconfig.site.shorturllength+
"\nFriendica version: "+serverconfig.site.friendica.FRIENDICA_VERSION+"\nDFRN version: "+serverconfig.site.friendica.DFRN_PROTOCOL_VERSION +
"\nDB Update version: "+serverconfig.site.friendica.DB_UPDATE_VERSION+"'}";
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var result = tx.executeSql('UPDATE config SET APIVersion="'+ serverconfig.site.friendica.FRIENDICA_VERSION+'" WHERE username="'+login.username +'"')})
callback(serverconfigString);
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var result = tx.executeSql('UPDATE config SET APIVersion="'+ serverconfig.site.friendica.FRIENDICA_VERSION+'" WHERE username="'+login.username +'"')})
callback(serverconfigString);
})}
catch (e){callback (e);
}}
}}
function readConfig(database,callback,filter,filtervalue) { // reads config
if (filter){var where = " WHERE "+ filter +" = '" + filtervalue+"'"} else { var where=""}
@ -283,16 +282,16 @@ function readConfig(database,callback,filter,filtervalue) { // reads config
var tables = tx.executeSql("SELECT * FROM sqlite_master WHERE type='table'");
if (tables.rows.length==0){print("no database");callback("")} else {
var rs = tx.executeSql('select * from config'+where);
var rsArray=[];
if (rs.rows.length>0){
for(var i = 0; i < rs.rows.length; i++) {
rsArray.push(rs.rows.item(i))
}
var rsObject={server:rsArray[0].server,username:rsArray[0].username, password:rsArray[0].password,imagestore:rsArray[0].imagestore,isActive:rsArray[0].isActive, newsViewType:rsArray[0].newsViewType,permissions:JSON.parse(rsArray[0].permissions),maxContactAge:rsArray[0].maxContactAge,APIVersion:rsArray[0].APIVersion,addons:rsArray[0].addons};
if (rsObject.newsViewType!="" && rsObject.newsViewType!=null){updateNewsviewtype(database,rsObject.newsViewType)}
} else {var rsObject=""}
callback(rsObject)}}
var rs = tx.executeSql('select * from config'+where);
var rsArray=[];
if (rs.rows.length>0){
for(var i = 0; i < rs.rows.length; i++) {
rsArray.push(rs.rows.item(i))
}
var rsObject={server:rsArray[0].server,username:rsArray[0].username, password:rsArray[0].password,imagestore:rsArray[0].imagestore,isActive:rsArray[0].isActive, newsViewType:rsArray[0].newsViewType,accountId:rsArray[0].maxnews,permissions:JSON.parse(rsArray[0].permissions),maxContactAge:rsArray[0].maxContactAge,APIVersion:rsArray[0].APIVersion,addons:rsArray[0].addons};
if (rsObject.newsViewType!="" && rsObject.newsViewType!=null &&!typeof(rsObject.newsViewType)=='undefined'){updateNewsviewtype(database,rsObject.newsViewType)}
} else {var rsObject=""}
callback(rsObject)}}
)
}
@ -315,9 +314,9 @@ function readAllLogins(database,callback) { // reads config
}
function readActiveConfig(database){
var obj="";
readConfig(database,function(config){obj=config},"isActive", 0);
return obj;
var obj="";
readConfig(database,function(config){obj=config},"isActive", 0);
return obj;
}
function setDefaultOptions(database){
@ -332,7 +331,7 @@ function readGlobaloptions(database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var go=({});
db.transaction( function(tx) {
var rs = tx.executeSql('select * from globaloptions');
var rs = tx.executeSql('select * from globaloptions');
for (var r=0; r<rs.rows.length; r++){
go[rs.rows.item(r).k]=rs.rows.item(r).v
}
@ -341,7 +340,7 @@ function readGlobaloptions(database,callback){
}
function readGO(database){
var obj;
var obj;
readGlobaloptions(database,function(go){obj=go});
return obj
}
@ -353,11 +352,11 @@ function updateglobaloptions(database,key,value){
if(result.rows.length > 0) {// use update
result = tx.executeSql('UPDATE globaloptions SET v="'+value+'" WHERE k="'+key+'"')
} else {// use insert
result = tx.executeSql('INSERT INTO globaloptions (k,v) VALUES (?,?)', [key,value])
result = tx.executeSql('INSERT INTO globaloptions (k,v) VALUES (?,?)', [key,value])
}
})
root.globaloptions[key]=value;
}
}
function deleteConfig(database,userobj,callback) { // delete user data from DB
if (userobj){var where = " WHERE username='"+ userobj.username+"' and server='"+userobj.server+"'";} else { return "no user selected!";}
@ -370,7 +369,7 @@ function deleteConfig(database,userobj,callback) { // delete user data from DB
var rs4 = tx.executeSql("delete from imageData WHERE username='"+ userobj.username+"'");
var rs5 = tx.executeSql("delete from groups WHERE username='"+ userobj.username+"'");
var rs5 = tx.executeSql("delete from events WHERE username='"+ userobj.username+"'");
callback();
callback();
})
}
@ -386,33 +385,31 @@ function updateNewsviewtype(database, newsViewtype){
function cleanNews(database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var maxnewsrs = tx.executeSql("SELECT v FROM globaloptions WHERE k='max_news'");
var maxnews=1000; if(maxnewsrs.rows.length>0){ maxnews=maxnewsrs.rows.item(0).v};
for (var i=0; i<6;i++){
if (i!=0){var maxnewsa=maxnews/5}else{maxnewsa=maxnews}
var newscountrs = tx.executeSql('SELECT COUNT(*) from news WHERE messagetype='+i);
var newscount = 0;
if (newscountrs.rows.length>0){newscount=newscountrs.rows.item(0)["COUNT(*)"]};//print(i+" "+maxnewsa+" newscount "+newscount)
if (newscount>maxnewsa){
var lastvalidtimers= tx.executeSql('SELECT DISTINCT created_at FROM news WHERE messagetype='+i+' ORDER BY created_at ASC LIMIT ' +(newscount-maxnewsa));
var lastvalidtime=lastvalidtimers.rows.item(newscount-maxnewsa-1).created_at;
var deleters = tx.executeSql('DELETE from news WHERE messagetype='+i+' AND created_at<='+lastvalidtime)}
}
callback()
})
}
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var maxnewsrs = tx.executeSql("SELECT v FROM globaloptions WHERE k='max_news'");
var maxnews=1000; if(maxnewsrs.rows.length>0){ maxnews=maxnewsrs.rows.item(0).v};
for (var i=0; i<6;i++){
if (i!=0){var maxnewsa=maxnews/5}else{maxnewsa=maxnews}
var newscountrs = tx.executeSql('SELECT COUNT(*) from news WHERE messagetype='+i);
var newscount = 0;
if (newscountrs.rows.length>0){newscount=newscountrs.rows.item(0)["COUNT(*)"]};
if (newscount>maxnewsa){
var lastvalidtimers= tx.executeSql('SELECT DISTINCT created_at FROM news WHERE messagetype='+i+' ORDER BY created_at ASC LIMIT ' +(newscount-maxnewsa));
var lastvalidtime=lastvalidtimers.rows.item(newscount-maxnewsa-1).created_at;
var deleters = tx.executeSql('DELETE from news WHERE messagetype='+i+' AND created_at<='+lastvalidtime)}
}
callback()
})
}
function cleanContacts(login,database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var oldestnewsrs= tx.executeSql('SELECT created_at FROM news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY created_at ASC LIMIT 1');
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);
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++){//print("rm "+result.rows.item(i).profile_image)
for (var i=0;i<result.rows.length;i++){
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+'"');
}
@ -421,59 +418,64 @@ function cleanContacts(login,database,callback){
}
function cleanHashtags(database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var tagcountrs = tx.executeSql('SELECT COUNT(*) from hashtags');
var tagcount = 0;
if (tagcountrs.rows.length>0){tagcount=tagcountrs.rows.item(0)["COUNT(*)"]};
if (tagcount>50){
var lastvaliddaters= tx.executeSql('SELECT DISTINCT date FROM hashtags ORDER BY date ASC LIMIT ' +(tagcount-50));
var lastvaliddate=lastvaliddaters.rows.item(tagcount-49).date;
var deleters = tx.executeSql('DELETE from hashtags WHERE date<='+lastvaliddate)}
callback()
})
}
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var tagcountrs = tx.executeSql('SELECT COUNT(*) from hashtags');
var tagcount = 0;
if (tagcountrs.rows.length>0){tagcount=tagcountrs.rows.item(0)["COUNT(*)"]};
if (tagcount>50){
var lastvaliddaters= tx.executeSql('SELECT DISTINCT date FROM hashtags ORDER BY date ASC LIMIT ' +(tagcount-50));
var lastvaliddate=lastvaliddaters.rows.item(tagcount-49).date;
var deleters = tx.executeSql('DELETE from hashtags WHERE date<='+lastvaliddate)}
callback()
})
}
function updateContactInDB(login,database,isFriend,contact){// for newstab and friendstab
var currentTime=Date.now();
var image_timestamp=0;
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var imagename_helper=[];
imagename_helper=contact.profile_image_url.split('?');//print("substring: "+JSON.stringify(imagename_helper)+imagename_helper[0].substring(imagename_helper[0].lastIndexOf("/")+1, imagename_helper[0].length))
try {parseInt(image_timestamp=imagename_helper[1].substring(imagename_helper[1].indexOf("ts=")+3,imagename_helper[1].length))} catch(e){};
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) {
var imagename_helper=[];
imagename_helper=contact.profile_image_url.split('?');
try {parseInt(image_timestamp=imagename_helper[1].substring(imagename_helper[1].indexOf("ts=")+3,imagename_helper[1].length))} catch(e){};
var result;
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
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
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]);}
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){newsBusy.running=false;};
try{var newslist=JSON.parse(data)} catch(e){print("processnews "+e+ " api "+ api + " data "+data);newsBusy.running=false;};
if (api=="/api/users/show"){
var usermessages=[];
usermessages.push(newslist.status);
newslist=usermessages;
}
if (data==""){}
if (data==""){newsBusy.running=false}
else if (typeof(newslist)=='undefined'){
Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
}
Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
}
else if (newslist.hasOwnProperty('status')){
Helperjs.showMessage(qsTr("JSON status 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" || api=="/api/direct_messages/conversation"){
if (!(Array.isArray(newslist)) && (typeof(newslist)==='object')){//answers return object, not array
newslist=[];newslist.push(JSON.parse(data));
}
if (api=="/api/direct_messages/all" || api=="/api/direct_messages/conversation" ||api=="/api/direct_messages/new"){
for (var n in newslist){
newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at));
try{newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at));}catch(e){
newslist[n].created_at=Date.parse(newslist[n].created_at)
}
newslist[n].messagetype=1;
newslist[n].source=" Friendica";
newslist[n].status_id=newslist[n].id;
@ -486,7 +488,7 @@ function processNews(api,data){
newslist[n].in_reply_to_user_id=newslist[n].recipient_id
if(newslist[n].in_reply_to_user_id){newslist[n].reply_user=Newsjs.objFromArray(allcontacts,"id",newslist[n].in_reply_to_user_id)}
}}
else if (api=="/api/friendica/notifications"){
else if (api=="/api/friendica/notification"){
for (var n in newslist){
newslist[n].created_at=Date.parse(newslist[n].date);
newslist[n].messagetype=2;
@ -502,38 +504,42 @@ function processNews(api,data){
}
}
else {//if(api!="/api/statuses/user_timeline"){
var chatlist=[];
var chatlistclean=[];
var conversationIds=[];
var commentCount=[];
for (var n in newslist){
if (newslist[n]!=null){
newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at));
newslist[n].messagetype=5;
newslist[n].status_id=newslist[n].id;
if (api=="/api/statuses/replies"){newslist[n].messagetype=3}else{newslist[n].messagetype=0;}
newslist[n].friendica_author=cleanUser(newslist[n].friendica_author);
newslist[n].user=cleanUser(newslist[n].user);
if (newslist[n].friendica_title!="") {newslist[n].statusnet_html="<b>"+newslist[n].friendica_title +"</b><br><br>"+newslist[n].friendica_html;}
else{newslist[n].statusnet_html=newslist[n].friendica_html}
//if (newslist[n].friendica_title!="") {newslist[n].statusnet_html="<b>"+newslist[n].friendica_title +"</b><br><br>"+newslist[n].friendica_html;}
//else{ //friendica_title also included in html
newslist[n].statusnet_html=newslist[n].friendica_html
//}
if(newslist[n].in_reply_to_user_id){newslist[n].reply_user=Newsjs.objFromArray(allcontacts,"id",newslist[n].in_reply_to_user_id)}
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]);
}
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]);
}
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]);
}
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]);
}
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]);
}
newslist[n].friendica_activities.attendmaybe[r]=cleanUser(newslist[n].friendica_activities.attendmaybe[r]);
}
}
if(!(newslist[n].hasOwnProperty('friendica_author'))){
newslist[n].friendica_author=newslist[n].user
@ -542,29 +548,50 @@ function processNews(api,data){
//fill chatlist
if (conversationindex==-1){
chatlist.push(newslist[n]);
let conversation=[];conversation.push(newslist[n]);
let firstmessage={currentconversation:conversation};
chatlist.push(firstmessage);
conversationIds.push(newslist[n].statusnet_conversation_id);
commentCount.push(1);
} else{
commentCount[conversationindex]=commentCount[conversationindex]+1;
chatlist[conversationindex]=newslist[n];
chatlist[conversationindex].currentconversation.push(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)}
if ((newstab.newstabstatus=="Conversations")&&!(api=="/api/conversation/show"|| api=="/api/direct_messages/conversation")){
//enrich chatlist with old entries
for (var count in chatlist){
chatlist[count].currentconversation.reverse();
if (chatlist[count].currentconversation[0].id_str!==chatlist[count].currentconversation[0].statusnet_conversation_id){
try{
Newsjs.oldchatfromdb(db,login.username,chatlist[count].currentconversation[0].statusnet_conversation_id,chatlist[count].currentconversation[0].id,allcontacts,function(oldpost,oldcount){
let completeChat=oldpost.currentconversation.concat(chatlist[count].currentconversation);
let newChat=completeChat[0];
newChat.currentconversation=[];
for (let c in completeChat){
if (completeChat[c].status_id!=newChat.status_id){
newChat["currentconversation"].push(completeChat[c])
}
}
newChat.newscount=oldcount+commentCount[count];
chatlistclean.push(newChat);
})
}catch(e){print(e)}
}
else{
let newChat=chatlist[count].currentconversation[0];
newChat["currentconversation"]=[];
for (let c in chatlist[count].currentconversation){
if (chatlist[count].currentconversation[c].status_id!=newChat.status_id){
newChat["currentconversation"].push(chatlist[count].currentconversation[c])
}
}
newChat.newscount=commentCount[count];
chatlistclean.push(newChat);
}
}
else{chatlist[count].newscount=commentCount[count]}
}
}
@ -575,8 +602,8 @@ function processNews(api,data){
else if (api=="/api/statuses/user_timeline" || api=="/api/users/show"){
root.contactposts=newslist
}
else if ((api!="/api/direct_messages/all")&&(api!="/api/friendica/notifications")&&(newstab.newstabstatus==="Conversations")){
showNews(chatlist);root.news=newslist
else if ((api!="/api/direct_messages/all")&&(api!="/api/friendica/notification")&&(api!="/api/direct_messages/new")&&(newstab.newstabstatus==="Conversations")){
showNews(chatlistclean);root.news=newslist
}
else {
showNews(newslist);root.news=newslist
@ -585,7 +612,6 @@ function processNews(api,data){
var newstabarray=["Conversations","Favorites","Timeline","DirectMessage","Replies"];
if (newstabarray.indexOf(newstab.newstabstatus)>-1){contacttimer.start()}
}
}
@ -603,70 +629,70 @@ function updateView(viewtype){
//newsBusy.running=true;
//downloadNotice.text="xhr start "+Date.now()
switch(viewtype){
case "Conversations":
Newsjs.getLastNews(login,db,function(lastnews){
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,function(lastnews){
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":
case "Conversations":
Newsjs.getLastNews(login,db,function(lastnews){
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.setApi("/api/statuses/friends_timeline");
xhr.clearParams();
break;
case "Direct Messages":
xhr.setParam("since_id",lastnews);
xhr.setParam("count",50)});
break;
case "Timeline":
var lastnews=Newsjs.getLastNews(login,db,function(lastnews){
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/all");
xhr.setApi("/api/statuses/friends_timeline");
xhr.clearParams();
break;
case "Public Timeline":
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/notification");
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;
case "Replies":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/replies");
xhr.clearParams();
break;
default:
Newsjs.getLastNews(login,db,function(lastnews){
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/public_timeline");
xhr.setApi("/api/statuses/friends_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;
case "Replies":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/statuses/replies");
xhr.clearParams();
break;
default:
Newsjs.getLastNews(login,db,function(lastnews){
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.setParam("since_id",lastnews);
xhr.setParam("count",50)
newstab.newstabstatus="Conversations";
});
}
xhr.get();
@ -682,12 +708,12 @@ function updateView(viewtype){
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 2.12; import 'qrc:/js/service.js' as Service; Menu {"+groupitems+"}";
var grouplistObject=Qt.createQmlObject(menuString,newsStack,"groupmenuOutput");
grouplistObject.popup()
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 2.12; import 'qrc:/js/service.js' as Service; Menu {"+groupitems+"}";
var grouplistObject=Qt.createQmlObject(menuString,newsStack,"groupmenuOutput");
grouplistObject.popup()
})
}

View file

@ -31,50 +31,100 @@
var html=[//Smileys
'\u263A',
'\u2639',
'\u263B',
//Weather
'\u2600',
'\u2601',
'\u263C',
'\u2614',
'\u2602',
'\u2603',
'\u2604',
'\u26C4',
'\u26C5',
'\u26C8',
//Leisure
'\u2615',
'\u26BD',
'\u26BE',
'\u26F1',
'\u26F2',
'\u26F3',
'\u26F4',
'\u26F5',
'\u26F7',
'\u26F8',
'\u26F9',
'\u26FA',
'\u26FD',
//Hand
'\u261C',
'\u261D',
'\u261E',
'\u261F',
'\u2620',
'\u2622',
'\u2623',
//Religion
'\u2626',
'\u262A',
'\u262C',
'\u262E',
'\u262F',
'\u26EA',
'\u26E9'
'\u263A',
'\ud83d\ude00',
'\ud83d\ude02',
'\ud83d\ude06',
'\ud83d\ude07',
'\ud83d\ude08',
'\ud83d\ude09',
'\ud83d\ude0B',
'\ud83d\ude0D',
'\ud83d\ude0E',
'\ud83d\ude0F',
'\ud83d\ude10',
'\ud83d\ude15',
'\ud83d\ude18',
'\ud83d\ude1B',
'\ud83d\ude1C',
'\ud83d\ude1D',
'\ud83d\ude1E',
'\ud83d\ude1F',
'\ud83d\ude20',
'\ud83d\ude21',
'\ud83d\ude22',
'\ud83d\ude23',
'\ud83d\ude24',
'\ud83d\ude26',
'\ud83d\ude27',
'\ud83d\ude2C',
'\ud83d\ude2D',
'\ud83d\ude2E',
'\ud83d\ude2F',
'\ud83d\ude31',
'\ud83d\ude32',
'\ud83d\ude33',
'\ud83d\ude31',
'\ud83d\ude32',
'\ud83d\ude33',
'\ud83d\ude34',
'\ud83d\ude37',
'\ud83d\ude41',
'\ud83d\ude42',
'\ud83d\ude43',
'\ud83d\ude44',
'\ud83d\ude45',
'\ud83d\ude46',
'\ud83d\ude47',
'\ud83d\ude4B',
'\ud83d\ude4C',
'\ud83d\ude4D',
'\ud83d\ude4E',
'\ud83d\ude4F',
'\ud83e\udd2F',
'\u2639',
'\u263B',
//Weather
'\u2600',
'\u2601',
'\u263C',
'\u2614',
'\u2602',
'\u2603',
'\u2604',
'\u26C4',
'\u26C5',
'\u26C8',
//Leisure
'\u2615',
'\u26BD',
'\u26BE',
'\u26F1',
'\u26F2',
'\u26F3',
'\u26F4',
'\u26F5',
'\u26F7',
'\u26F8',
'\u26F9',
'\u26FA',
'\u26FD',
//Hand
'\u261C',
'\u261D',
'\u261E',
'\u261F',
'\u2620',
'\u2622',
'\u2623',
//Religion
'\u2626',
'\u262A',
'\u262C',
'\u262E',
'\u262F',
'\u26EA',
'\u26E9'
]
var core=[

View file

@ -106,7 +106,7 @@ Rectangle {
id:leftDrawer
property var newstabstatus: newstab.newstabstatus
visible: wideScreen&&rootstackView.depth<2
width: visible?osSettings.systemFontSize*15:0
width: visible?root.fontFactor*osSettings.systemFontSize*15:0
height: root.height-bar.height
}
@ -126,6 +126,7 @@ Rectangle {
calBusy.running=true;
updatenews.setDatabase();
updatenews.login();
updatenews.setSyncAll(false);
updatenews.events();
// Service.getEvents(db,login, calendartab,function(){
// showEvents("")

View file

@ -281,7 +281,7 @@ Page{
font.pointSize: osSettings.bigFontSize
onClicked:{
accountBusy.running=true;//servername.displayText
var userconfig={server: servername.displayText, username: username.text, password:Qt.btoa(password.text), imagestore:imagestoredir, maxnews:"",interval: ""};
var userconfig={server: servername.displayText, username: username.text, password:Qt.btoa(password.text), imagestore:imagestoredir,interval: ""};
var errormessage="";
if (servername.text==""){errormessage=qsTr("No server given! ")}
else if (username.text==""){errormessage+=qsTr("No nickname given! ")}
@ -305,6 +305,7 @@ Page{
filesystem.Directory=imagestoredir //userconfig.imagestore;
filesystem.makeDir("contacts");
filesystem.makeDir("albums");
userconfig.accountId=credentials.id
Service.storeConfig(db,userconfig);
Service.readConfig(db,function(userconfig){
Helperjs.readData(db,"config","",function(storedUsers){

View file

@ -35,9 +35,6 @@ import QtQuick.Controls.Material 2.12
import "qrc:/qml/genericqml"
Page{
//color:"white"
// width:infoBoxText.contentWidth
// height:infoBoxText.contentHeight
Text{id:infoBoxText
anchors.top:closeButton.bottom
anchors.topMargin: mm
@ -46,7 +43,7 @@ Page{
font.pointSize: osSettings.systemFontSize
color:Material.primaryTextColor
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: "<b>Friendiqa v0.6.3 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
text: "<b>Friendiqa v0.6.4 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
"Website <a href='https://friendiqa.ma-nic.de'>https://friendiqa.ma-nic.de</a><br>"+
"Sourcecode: <a href='https://git.friendi.ca/LubuWest/Friendiqa'>https://git.friendi.ca/LubuWest/Friendiqa</a><br>"+
"Privacy Policy: <a href='https://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md'>http://git.friendi.ca/lubuwest/Friendiqa/src/branch/master/PrivacyPolicy.md</a><br>"+

View file

@ -1,57 +0,0 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2020 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.9
import QtQuick.Controls 2.12
import QtWebView 1.1
import "qrc:/qml/genericqml"
Rectangle{
color:"white"
property alias url:htmlview.url
WebView {id:htmlview;
height:parent.height-7*mm
width:parent.width
y:7*mm
}
Button{
id:closeButton
height: 3*root.fontFactor*osSettings.bigFontSize
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
font.pointSize: osSettings.bigFontSize
onClicked:{root.pop()}
}
}

View file

@ -1,177 +0,0 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2020 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
import QtQuick.Controls 2.12
import "qrc:/qml/genericqml"
Item {
id: contactLargeComponent
x:mm
y:mm
property var contact:({})
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>")
Rectangle {
id: wrapper
width:root.width-2*mm //friendsTabView.width;
height:root.height-20*mm// friendsTabView.height-15*mm
border.color: "grey"
color:"white"
radius: 0.5*mm
Image {
id: photoImage
x:mm
y:mm
width: 15*mm
height:15*mm
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
}
Label {
id: namelabel
x: mm
width: root.width-6*mm //friendsTabView.width-4*mm
height: 3*mm
text:contact.name+" (@"+contact.screen_name+")"
elide:Text.ElideRight
anchors.topMargin: 0
anchors.left: photoImage.left
color: "#303030"
font.pixelSize: 4*mm
anchors.top: photoImage.bottom
}
Rectangle{
id: detailsrectangle
anchors.top: namelabel.bottom
anchors.topMargin: 2*mm
ScrollView{
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
//frameVisible: true
id:namelabelflickable
width: root.width-10*mm
height:root.height-50*mm
x: mm
clip:true
Text{
id:namelabeltext
width: namelabelflickable.width
height: implicitHeight
font.pixelSize: 3*mm
textFormat:Text.RichText
wrapMode: Text.Wrap
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>"+
connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
onLinkActivated: {
Qt.openUrlExternally(link)}
}
}
Row{
anchors.top: namelabelflickable.bottom
anchors.topMargin: 2*mm
x: mm
spacing:4
MButton{
id:photobutton
height: 6*mm
width: 8*mm
text: "\uf03e" // "Photos"
visible:(contact.network=="dfrn")
onClicked:{
fotostab.phototabstatus="Contact";
root.currentIndex=2;
fotostab.active=true;
root.fotoSignal(contact) ;
contactLargeComponent.destroy();
}
}
MButton{
id:messagebutton
height: 6*mm
width: 8*mm
text: "\uf0e6" //"Messages"
onClicked:{
root.currentIndex=0;
//newstab.active=true;
root.messageSignal(contact) ;
contactLargeComponent.destroy();
}
}
MButton{
id:dmbutton
visible: (contact.following=="true")
height: 6*mm
width: 8*mm
text: "\uf040" //"DM"
onClicked:{
root.currentIndex=0;
root.directmessageSignal(contact.screen_name);
contactLargeComponent.destroy();
}
}
MButton{
id:eventbutton
visible:(contact.network=="dfrn")
height: 6*mm
width: 8*mm
text:"\uf073" //Events
onClicked:{
root.currentIndex=3;
calendartab.active=true;
calendartab.calendartabstatus="Friend"
root.eventSignal(contact);
contactLargeComponent.destroy();
}
}
MButton{
id: closeButton
height: 6*mm
width: 8*mm
text: "\uf057" //"close"
onClicked:{contactLargeComponent.destroy();
}
}
}
}
}
}

View file

@ -31,11 +31,12 @@
import QtQuick 2.11
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11
import QtQuick.LocalStorage 2.0
import "qrc:/js/helper.js" as Helperjs
//import "qrc:/js/news.js" as Newsjs
import "qrc:/js/service.js" as Service
import "qrc:/js/news.js" as Newsjs
import "qrc:/qml/contactqml"
import "qrc:/qml/genericqml"
@ -44,14 +45,16 @@ Item{
Layout.fillWidth:true
Layout.fillHeight: true
function showContacts(contact){
try {contactsModel.clear()} catch(e){print(e)};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
try {contactsModel.clear()} catch(e){};
Newsjs.listFriends(login,db,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){
contactsobject[j].description=Qt.atob(contactsobject[j].description);
contactsobject[j].name=Qt.atob(contactsobject[j].name);
if(Helperjs.getCount(db,login,"contacts","screen_name",contactsobject[j].screen_name)>1){
contactsobject[j].screen_name=contactsobject[j].screen_name+"+"+contactsobject[j].cid
}
contactsModel.append({"contact":contactsobject[j]});
}
},"isFriend",0,"screen_name ASC");
},searchText.text,-1);
}
MButton {
id: cleanButton
@ -61,17 +64,40 @@ Item{
anchors.right: parent.right
onClicked: {
Service.cleanContacts(root.login,root.db,function(){
try {contactsModel.clear()} catch(e){print(e)};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
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]});
}
},"isFriend",0,"screen_name ASC");
showContacts()
// try {contactsModel.clear()} catch(e){print(e)};
// Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
// 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]});
// }
// },"isFriend",0,"screen_name ASC");
})
}
}
Rectangle {
id:searchComponent
x: mm; y:mm
color: Material.backgroundColor
radius:0.5*mm
width: 10*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
TextField {
id: searchText
color: Material.primaryTextColor
focus: true
font.pointSize: osSettings.systemFontSize
wrapMode: Text.Wrap
anchors.fill:parent
selectByMouse: true
cursorVisible: false
placeholderText: "\uf0b0"
onTextChanged: {showContacts(root.login.username)}
}
}
ListView {
id: contactsView
x:mm

View file

@ -0,0 +1,169 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2020 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.11
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11
import QtQuick.LocalStorage 2.0
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/service.js" as Service
import "qrc:/js/news.js" as Newsjs
import "qrc:/qml/contactqml"
import "qrc:/qml/genericqml"
Page{
id: contactsSearchPage
function search(term){
contactSearchBusy.running=true;
try {contactsSearchModel.clear()} catch(e){};
xhr.clearParams();
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/v1/accounts/search");
xhr.setParam("q",term);
xhr.setParam("limit",99)
xhr.get();
}
Connections{
target:xhr
function onError(data,url,api,code){
if (data !="contactlist"){Helperjs.showMessage(qsTr("Network Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root);}
contactSearchBusy.running=false;
}
function onSuccess(data,api){
if (api=="/api/v1/accounts/search" && data!=""){
try{var searchlist = JSON.parse(data);}catch(e){print("Error "+e)}
contactSearchBusy.running=false;
if (Array.isArray(searchlist)){
searchlist.sort(function(a,b){
if (a.group > b.group) {
return -1;
}
if (a.group < b.group) {
return 1;
}
return 0
})
for (let i=0;i<searchlist.length;i++){
if (searchlist[i].id!="0"){
if (searchlist[i].note!=null){
searchlist[i].description=searchlist[i].note;}
else{searchlist[i].description=""}
searchlist[i].name=(searchlist[i].display_name);
searchlist[i].screen_name=searchlist[i].username;
searchlist[i].location="";
searchlist[i].profile_image=""
searchlist[i].profile_image_url=searchlist[i].avatar;
searchlist[i].curIndex=contactsSearchModel.count;
let contactType="";
if (searchlist[i].group){contactType=qsTr("Forum")}
//else if (contactlist[i].bot){contactType=qsTr("Bot")}
else{contactType=qsTr("Person")}
contactsSearchModel.append({"contact":searchlist[i],"contactType":contactType});
}
}
}
}
}
}
MButton {
id: closeButton
anchors.top: parent.top
anchors.topMargin: 0.5*root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right
anchors.rightMargin: 1*mm
width: 2*root.fontFactor*osSettings.bigFontSize;
text: "\uf057"
onClicked: {
rootstackView.pop()
}
}
Search{
y:0.5*root.fontFactor*osSettings.bigFontSize;
x:1.5*root.fontFactor*osSettings.systemFontSize;
width:root.width-(7*root.fontFactor*osSettings.systemFontSize+mm);
height: 2.5*root.fontFactor*osSettings.systemFontSize;
color:Material.dialogColor
selfdestroying:false
}
BusyIndicator{
id: contactSearchBusy
anchors.centerIn:parent
width:10*mm
height: 10*mm
running: false
}
Component {
id: sectionHeading
Rectangle {
width: contactsSearchView.width
height: childrenRect.height
color: Material.backgroundColor
required property string section
Text {
color: Material.secondaryTextColor
text: parent.section
font.bold: true
font.pointSize: osSettings.bigFontSize
}
}
}
ListView {
id: contactsSearchView
x:mm
y:4*root.fontFactor*osSettings.bigFontSize;
width:root.width-2*mm
height: root.height-7*root.fontFactor*osSettings.bigFontSize;
spacing: 2
clip: true
function processContactSelection(contactobject){contactobject.searchContact=true;showContact(contactobject)}
model: contactsSearchModel
delegate: ContactComponent { }
section.property: "contactType"
section.criteria: ViewSection.FullString
section.delegate: sectionHeading
}
ListModel{id: contactsSearchModel}
// Component.onCompleted: {
// friendsTabView.contactsSignal.connect(showContacts);
// showContacts()
// }
}

View file

@ -46,7 +46,7 @@ Item{
property int currentContact: 0
function showFriends(contact){
try {friendsModel.clear()} catch(e){print(e)};
try {friendsModel.clear()} catch(e){};
Helperjs.readData(db,"friendshiprequests",login.username,function(friendrequestsobject){
for (var i=0;i<friendrequestsobject.length;i++){
if (friendrequestsobject[i].note!=null){
@ -61,18 +61,18 @@ Item{
friendsModel.append({"contact":friendrequestsobject[i],"contactType":qsTr("Friend Requests")});
}
});
Helperjs.readData(db,"contacts",login.username,function(friendsobject){
Newsjs.listFriends(login,db,function(friendsobject){
for (var i=0;i<friendsobject.length;i++){
if(friendsobject[i].description!=""){
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){
friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
}
friendsModel.append({"contact":friendsobject[i],"contactType":qsTr("Friends")});
}
},"isFriend",1,"screen_name ASC");
},(searchText.text==""?searchText.preeditText:searchText.text));
}
Connections{
target:xhr
function onDownloaded(type,url,filename,i){
@ -84,6 +84,7 @@ Item{
}
}
}
MButton {
id: updateFriendsButton
text: "\uf021"
@ -95,6 +96,7 @@ Item{
Helperjs.deleteData(root.db,"friendshiprequests",root.login.username,function(){});
updatenews.setDatabase();
updatenews.login();
updatenews.setSyncAll(false);
updatenews.friendrequests();
//root.contactLoadType="friends";
Newsjs.requestFriends(root.login,db,root,function(nc){
@ -115,12 +117,34 @@ Item{
value: friendsGridTab.currentContact/root.newContacts.length
}
Rectangle {
id:searchComponent
x: mm; y:mm
color: Material.backgroundColor
radius:0.5*mm
width: 10*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
TextField {
id: searchText
color: Material.primaryTextColor
focus: true
font.pointSize: osSettings.systemFontSize
wrapMode: Text.Wrap
anchors.fill:parent
selectByMouse: true
cursorVisible: false
placeholderText: "\uf0b0"
onTextChanged: if (text.length>0){showFriends(root.login.username)}
onPreeditTextChanged: {if (preeditText.length>0){showFriends(root.login.username)}}
}
}
Component {
id: sectionHeading
Rectangle {
width: friendsView.width
height: childrenRect.height
color: Material.dialogColor //color: "lightsteelblue"
color: Material.backgroundColor
required property string section
Text {
color: Material.secondaryTextColor
@ -131,6 +155,28 @@ Item{
}
}
//GridView {
Component { id:headerComponent
Rectangle{
color: Material.dialogColor
width:friendsView.width
height:6*mm
Text{
color: Material.primaryTextColor
font.pointSize: osSettings.bigFontSize
anchors.centerIn: parent
text:"\uf234"
}
MouseArea{
anchors.fill:parent
onClicked:{
rootstackView.push("qrc:/qml/contactqml/ContactsSearchPage.qml")
}
}
}
}
ListView{
id: friendsView
x:mm
@ -145,6 +191,7 @@ Item{
// }
model: friendsModel
delegate: ContactComponent { }
header:headerComponent
section.property: "contactType"
section.criteria: ViewSection.FullString
section.delegate: sectionHeading

View file

@ -65,38 +65,38 @@ Rectangle {
TabBar {
id: friendsbar
width: osSettings.osType=="Android"?parent.width-2*osSettings.bigFontSize:parent.width
height: 9*mm
x: osSettings.osType=="Android"?2*osSettings.bigFontSize:0
width: osSettings.osType=="Android"?parent.width-2*root.fontFactor*osSettings.bigFontSize:parent.width
height: 2*root.fontFactor*osSettings.bigFontSize
x: osSettings.osType=="Android"?2*root.fontFactor*osSettings.bigFontSize:0
visible: !wideScreen
position:TabBar.Header
currentIndex: 1
TabButton {
text: qsTr("Me")
font.pointSize: osSettings.systemFontSize
height: 7*mm
height: 1.7*root.fontFactor*osSettings.bigFontSize//7*mm
}
TabButton {
text: qsTr("Friends")
font.pointSize: osSettings.systemFontSize
height: 7*mm
height: 1.7*root.fontFactor*osSettings.bigFontSize//7*mm
}
TabButton {
text: qsTr("Contacts")
font.pointSize: osSettings.systemFontSize
height: 7*mm
height: 1.7*root.fontFactor*osSettings.bigFontSize//7*mm
}
TabButton {
text: qsTr("Groups")
font.pointSize: osSettings.systemFontSize
height: 7*mm
height: 1.7*root.fontFactor*osSettings.bigFontSize//7*mm
}
}
LeftDrawerLinux{
id:leftDrawer
visible: wideScreen&&rootstackView.depth<2
width: visible?osSettings.systemFontSize*15:0
width: visible?root.fontFactor*osSettings.systemFontSize*15:0
height: root.height-bar.height
}

View file

@ -56,16 +56,8 @@ Item {
height: parent.height-mm
radius: 0.5*mm
border.color: "grey"
color:Material.backgroundColor//"white"
color:Material.backgroundColor
// Image {
// id: photoImage
// x:1
// y:1
// width: 10*mm
// height:10*mm
// source:"qrc:/images/defaultcontact.jpg"
// }
Rectangle{
id:namelabelRect
x: 1
@ -147,112 +139,7 @@ Item {
delegate: ContactComponent { }// groupMember
function processContactSelection(contactobject){showContactdetails(contactobject)}
}
ListModel{id: groupModel}
// Component {
// id:groupMember
// Rectangle{
// width:parent.width
// height:6*mm
// Rectangle{id:memberrectangle
// border.color: "#EEEEEE"
// border.width: 1
// width:parent.width-12*mm
// height:6*mm
// Image {
// id: memberImage
// x:1
// y:1
// width: 5*mm
// height:5*mm
// source:(groupmember.isFriend==1)? "file://"+groupmember.profile_image :groupmember.profile_image_url
// onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
// }
// Text{
// font.pixelSize: 3*mm
// anchors.left: memberImage.right
// anchors.margins: 1*mm
// width:parent.width-1
// text:groupmember.name
// }
// MouseArea{
// anchors.fill: parent
// onClicked:{
//// root.currentIndex=1;
//// friendstab.active=true;
//// root.contactdetailsSignal(groupmember)
// root.currentIndex=0;
// root.contactdetailsSignal(groupmember)
// }
// }
// // BlueButton{
// // anchors.left: memberrectangle.right
// // anchors.margins: 1*mm
// // text: "\uf056"
// // onClicked:{
// // groupModel.remove(index)
// // }
// // }
// }
// }
// }
// Row{
// anchors.top: groupListView.bottom
// anchors.topMargin: mm
// spacing: mm
// }
// BlueButton{
// id: addMembers
// text:"\uf234"
// onClicked: {
// Newsjs.listFriends(root.login,root.db,function(userdata){
// var newlistcontacts=[];
// for (var n in userdata){
// if (groupmembers.indexOf(userdata[n].id)==-1){
// newlistcontacts.push(userdata[n])
// }
// }
// var component = Qt.createComponent("qrc:/qml/contactqml/Contactlist.qml");
// var contactlistobject = component.createObject(groupListView,{"possibleUsers":newlistcontacts});
// })
// }
// }
// BlueButton{
// id: updateButton
// text: "\uf0ee"
// onClicked:{
// var groupobject={};
// var groupmembers=[];
// for (var i=0;i<groupModel.count;i++){groupmembers.push(groupModel.get(i).groupmember)}
// try{ groupobject.id=group.gid} catch(e){};
// try{ groupobject.new=group.new} catch(e){};
// if (namelabel.text==""){
// Helperjs.showMessage(qsTr("Error"),qsTr("No name given"),root)}
// else {
// groupobject.name=namelabel.text;
// groupobject.user=groupmembers;
// updateGroup(login,db,groupobject)
// groupComponent.state="";
// }
// }
// }
// BlueButton{
// id: deleteButton
// text: "\uf056"
// onClicked:{
// Newsjs.deleteGroup(root.login,root.db,root,group,function(){
// groupComponent.state="";
// groupsModel.remove(index)})
// }
// }
}
Component.onCompleted:{if(group.new){groupComponent.state="large"}}
}
@ -262,12 +149,7 @@ Item {
name: "large"
PropertyChanges { target: groupComponent; height: groupsView.height - 6*root.fontFactor*osSettings.bigFontSize }
PropertyChanges { target: namelabel; font.pointSize: 1.2*osSettings.bigFontSize; readOnly:false}
//PropertyChanges { target: namelabelRect; height: 2*osSettings.bigFontSize}
PropertyChanges { target: closeButton; visible: true}
//PropertyChanges { target: groupComponent; z: 2 }
//PropertyChanges { target: wrapper; width:groupsView.width-2*mm;height:groupsView.height -2*mm-1}
//PropertyChanges { target: photoImage; width:15*mm;height:15*mm }
//PropertyChanges { target:groupComponent.GridView.view ;contentY:groupComponent.y;contentX:groupComponent.x;interactive:false}
PropertyChanges { target: detailsrectangle; visible:true }
PropertyChanges { target: infobutton; visible: false}
}

View file

@ -76,17 +76,17 @@ Item{
}
}
}
MButton {
id: updateGroupsButton
text: "\uf021"
anchors.top: parent.top
anchors.topMargin: mm
anchors.right: parent.right
anchors.rightMargin: mm
onClicked: {
Newsjs.requestGroups(root.login,root.db,root,function(){
groupsGridTab.showGroups(root.login.username)})}
}
// MButton {//requestGroups() not working with Friendica 02/2022
// id: updateGroupsButton
// text: "\uf021"
// anchors.top: parent.top
// anchors.topMargin: mm
// anchors.right: parent.right
// anchors.rightMargin: mm
// onClicked: {
// Newsjs.requestGroups(root.login,root.db,root,function(){
// groupsGridTab.showGroups(root.login.username)})}
// }
// BlueButton {
// id: newGroupButton
// text: "\uf234"
@ -103,7 +103,7 @@ Item{
x:mm
y:updateGroupsButton.height+4*mm
width:groupsGridTab.width-2*mm
height:groupsGridTab.height-updateGroupsButton.height-2*mm
height:groupsGridTab.height-2*mm//-updateGroupsButton.height
clip: true
// cellHeight: 16*mm
// cellWidth: 17*mm

View file

@ -74,7 +74,7 @@ ApplicationWindow{
property bool imagePicking: false
Material.theme: Material.System // globaloptions.view_darkmode==1?Material.Dark:Material.Light
Material.theme: Material.System
color: Material.backgroundColor
function onLoginChanged(login){
@ -104,7 +104,7 @@ ApplicationWindow{
}
}
function showContact(contact){ //print(JSON.stringify(contact));
function showContact(contact){
rootstackView.push("qrc:/qml/newsqml/ContactPage.qml",{"contact": contact})
}
@ -143,14 +143,14 @@ ApplicationWindow{
onClosing: {
if (rootstack.currentIndex==0){
newstab.active=true;print("newstabstatus "+newstab.newstabstatus + " newsViewType " +globaloptions.newsViewType)
newstab.active=true;
if (newstab.newstabstatus!=globaloptions.newsViewType){
newstab.newstabstatus=globaloptions.newsViewType;
if(globaloptions.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,0,function(dbnews){
newsSignal(dbnews)
})}
else{
Newsjs.chatsfromdb(db,login.username,0,function(dbnews){
Newsjs.chatsfromdb(db,login.username,0,[],function(dbnews){
newsSignal(dbnews)
})}
close.accepted=false;
@ -164,13 +164,14 @@ ApplicationWindow{
root.pop();
close.accepted=false
}
else{print("Closing");
Service.cleanNews(root.db,function(){print("cleannews");
Service.cleanHashtags(root.db,function(){print("cleanhashtags");
Service.cleanContacts(root.login,root.db,function(){print("cleancontacts");
if (osSettings.osType=="Android"){
Qt.quit()}
else{print("show systray")
else{
Service.cleanNews(root.db,function(){
Service.cleanHashtags(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
if (osSettings.osType=="Android" || !iconTrayAvailable){
Qt.quit()
}
else{
systemTray.show();
systemTray.showMessage("",qsTr("Background Sync\n Rightclick or Middleclick to Quit"),"",5000)
root.hide()
@ -180,7 +181,7 @@ ApplicationWindow{
close.accepted=true
}
}
else if (rootstack.currentIndex==2){fotoSignal(login.username,"backButton");print("close rootstack currentindex==2");close.accepted=false}
else if (rootstack.currentIndex==2){fotoSignal(login.username,"backButton");close.accepted=false}
else {rootstack.currentIndex=0;close.accepted=false}
}
@ -191,24 +192,16 @@ ApplicationWindow{
}
header: ToolBar{
position: wideScreen?ToolBar.Header:ToolBar.Footer
background: Rectangle{
anchors.fill: parent
color: Material.backgroundDimColor//"#EEEEEE"//"#F8F8F8"
color: Material.backgroundDimColor
}
RowLayout{
anchors.fill: parent
ToolButton{
visible: !wideScreen
text: "\uf0c9"
onClicked:{
leftDrawer.visible?leftDrawer.close():leftDrawer.open()}
}
TabBar {
id: bar
Layout.fillWidth: true
//width: wideScreen?contentWidth:parent.width-10*mm
//x: 7*mm
onCurrentIndexChanged: rootstack.currentIndex=bar.currentIndex
TabButton {
text: "\uf03a"
@ -216,6 +209,7 @@ ApplicationWindow{
anchors.fill: parent
color: Material.backgroundDimColor
}
onDoubleClicked: {newstypeSignal("refresh")}
}
TabButton {
text: "\uf0c0"
@ -242,10 +236,6 @@ ApplicationWindow{
}
}
LeftDrawerAndroid{
id: leftDrawer
visible:!wideScreen
}
StackView{id:rootstackView
width:root.width
@ -295,7 +285,7 @@ StackView{id:rootstackView
Qt.quit()
}
}
Component.onCompleted: {print("systray completed")
Component.onCompleted: {
icon = iconTray
toolTip = qsTr("Click to open Friendiqa")
//&hide()
@ -309,7 +299,6 @@ StackView{id:rootstackView
if(globaloptions.view_darkmode==1){Material.theme=Material.Dark}
else if (globaloptions.view_darkmode==2){Material.theme=Material.Light}
else {Material.theme=Material.System}
if(!filesystem.Visibility){
systemTray.icon = iconTray;
// systemTray.toolTip = qsTr("Click to open Friendiqa");
@ -322,7 +311,7 @@ StackView{id:rootstackView
var IntentReceiverQml = component.createObject(root);
}
else if (osSettings.osType=="Linux"){
newstypeSignal("refresh")
if (login!=""){newstypeSignal("refresh")}
var component = Qt.createComponent("qrc:/qml/genericqml/LinuxSync.qml");
var LinuxSyncQml = component.createObject(root);
}

View file

@ -36,60 +36,60 @@ import "qrc:/qml/genericqml"
Item {
id: contactComponent
height: 4.5*root.fontFactor*osSettings.systemFontSize//8*mm
width: contactComponent.ListView.view.width//parent.width
height: 5*root.fontFactor*osSettings.systemFontSize
width: contactComponent.ListView.view.width
property var createdAtDate: new Date(contact.created_at)
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend==1)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
Rectangle {
id: wrapper
width:parent.width
height: parent.height//8*mm
height: parent.height
radius: 0.5*mm
border.color: Material.backgroundDimColor// "grey"
color: Material.backgroundColor//"white"
border.color: Material.backgroundDimColor
color: Material.backgroundColor
Image {
id: photoImage
x:0.5*mm
y:0.5*mm
width: 4*root.fontFactor*osSettings.systemFontSize//7*mm
height:4*root.fontFactor*osSettings.systemFontSize//7*mm
width: 4*root.fontFactor*osSettings.systemFontSize
height:4*root.fontFactor*osSettings.systemFontSize
source:((contact.profile_image!="") && (typeof(contact.profile_image)=="string"))? "file://"+contact.profile_image : contact.profile_image_url
onStatusChanged: {if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}}
}
Flow{
width: wrapper.width-4*root.fontFactor*osSettings.systemFontSize//8*mm
width: wrapper.width-4*root.fontFactor*osSettings.systemFontSize
height: wrapper.height-mm
anchors.left: photoImage.right
anchors.margins: 1*mm
//spacing: mm
anchors.margins: 0.5*mm
clip: true
Label {
id: namelabel
width: Math.min(wrapper.width-(photoImage.width+mm),contentWidth)//wrapper.width-4
height: 1.1*root.fontFactor*osSettings.bigFontSize//3*mm
width: Math.min(wrapper.width-(photoImage.width+mm),contentWidth)
height: 1.1*root.fontFactor*osSettings.bigFontSize
text: contact.name
elide: contentWidth>wrapper.width-4*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
color: Material.secondaryTextColor//"#303030"
color: Material.secondaryTextColor
font.pointSize: osSettings.bigFontSize
}
Label {
id: screennamelabel
width: Math.min(wrapper.width-4*root.fontFactor*osSettings.systemFontSize,contentWidth)//contentWidth+2*mm//wrapper.width-8*mm
height: 1.1*root.fontFactor*osSettings.bigFontSize//3*mm
width: Math.min(wrapper.width-4*root.fontFactor*osSettings.systemFontSize,contentWidth)
height: 1.1*root.fontFactor*osSettings.bigFontSize
text: "(@"+contact.screen_name+")"
elide: contentWidth>wrapper.width-4*root.fontFactor*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
color: Material.secondaryTextColor//"#303030"
color: Material.secondaryTextColor
font.pointSize: osSettings.bigFontSize
}
Label {
id: descriptionlabel
width: Math.min(wrapper.width-4*root.fontFactor*osSettings.systemFontSize,contentWidth)//contentWidth+2*mm//wrapper.width-8*mm
height: 2*root.fontFactor*osSettings.systemFontSize//2.5*mm
width: wrapper.width-5*root.fontFactor*osSettings.systemFontSize
height: wrapper.height-mm-1.1*root.fontFactor*osSettings.bigFontSize
maximumLineCount:2
text: Qt.atob(contact.description)!=""?contact.description:""
elide:contentWidth>wrapper.width-4*root.fontFactor*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
color: Material.secondaryTextColor//"#303030"
elide:Text.ElideRight
color: Material.secondaryTextColor
font.pointSize: osSettings.systemFontSize
}
}

View file

@ -53,5 +53,5 @@ Rectangle{
anchors.right: leftDrawer.right
color: Material.dialogColor//"#EEEEEE"
}
Component.onCompleted: {opened();}
//Component.onCompleted: {opened();}
}

View file

@ -8,6 +8,7 @@ Item {
onTriggered: {
updatenews.setDatabase();
updatenews.login();
updatenews.setSyncAll(true)
updatenews.startsync();
}
}

View file

@ -38,67 +38,68 @@ import "qrc:/qml/genericqml"
Rectangle{
id:permissionDialog
color: Material.backgroundColor
// x: mm
// x: mm
width: parent.width-5*mm
height:root.height/3
function updatePerms(){
for (var i=0;i<groupModel.count;i++)
{if (groupModel.get(i).groupstatus=="positive"){
group_allow.push(groupModel.get(i).group.gid)
}
if (groupModel.get(i).groupstatus=="negative"){
group_deny.push(groupModel.get(i).group.gid)
}
}
group_allow.push(groupModel.get(i).group.gid)
}
if (groupModel.get(i).groupstatus=="negative"){
group_deny.push(groupModel.get(i).group.gid)
}
}
for (var j=0;j<contactModel.count;j++){
if (contactModel.get(j).contactstatus=="positive"){
contact_allow.push(contactModel.get(j).contact.cid)
}
if (contactModel.get(j).contactstatus=="negative"){
contact_deny.push(contactModel.get(j).contact.cid)
}
if ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))
{permButton.text="\uf09c"}
else{permButton.text="\uf023"}
}}
if (contactModel.get(j).contactstatus=="positive"){
contact_allow.push(contactModel.get(j).contact.cid)
}
if (contactModel.get(j).contactstatus=="negative"){
contact_deny.push(contactModel.get(j).contact.cid)
}
if ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))
{permButton.text="\uf09c"}
else{permButton.text="\uf023"}
}
}
Text{
x:0.5*mm
y:0.5*mm
color: Material.primaryTextColor
text: qsTr("Friends")
Text{ //cid not working in Friendica 02/2022
x:0.5*mm
y:0.5*mm
color: Material.primaryTextColor
text: qsTr("Friends")
}
ListView {
id: contactView
x:0.5*mm
y:5.5*mm
width: permissionDialog.width/2-2*mm
height: permissionDialog.height-14*mm
clip: true
spacing: 1
model: contactModel
delegate: contactItem
}
id: contactView
x:0.5*mm
y:5.5*mm
width: permissionDialog.width/2-2*mm
height: permissionDialog.height-14*mm
clip: true
spacing: 1
model: contactModel
delegate: contactItem
}
ListModel{id: contactModel}
Component{
id:contactItem
Rectangle{
id:contactitemRect
color: Material.backgroundColor
width:contactView.width
height: 5*mm
radius: 0.5*mm
property string contactstatus
onContactstatusChanged:{
if(contactstatus=="positive"){contactitemRect.color="light green"}
else if (contactstatus=="negative"){contactitemRect.color= "red"}
else{contactitemRect.color= Material.backgroundColor}}
border.color:Material.frameColor
Text{
color: Material.primaryTextColor
text:contact.screen_name
}
ListModel{id: contactModel}
Component{
id:contactItem
Rectangle{
id:contactitemRect
color: Material.backgroundColor
width:contactView.width
height: 5*mm
radius: 0.5*mm
property string contactstatus
onContactstatusChanged:{
if(contactstatus=="positive"){contactitemRect.color="light green"}
else if (contactstatus=="negative"){contactitemRect.color= "red"}
else{contactitemRect.color= Material.backgroundColor}}
border.color:Material.frameColor
Text{
color: Material.primaryTextColor
text:contact.screen_name
}
MouseArea{
anchors.fill: parent
onClicked:{
@ -113,55 +114,55 @@ Rectangle{
else{contactModel.set(index,{"contactstatus":"neutral"});
contactstatus="neutral";
}
}}
Component.onCompleted:{
if (contactModel.get(index).contactstatus=="positive"){
contactstatus="positive"
}
else if (contactModel.get(index).contactstatus=="negative"){
contactstatus="negative"
}
else {contactstatus="neutral"} }
}
}
Text{
color: Material.primaryTextColor
x:contactView.width+2*mm
y:0.5*mm
text: qsTr("Groups")
}}
Component.onCompleted:{
if (contactModel.get(index).contactstatus=="positive"){
contactstatus="positive"
}
else if (contactModel.get(index).contactstatus=="negative"){
contactstatus="negative"
}
else {contactstatus="neutral"} }
}
}
Text{
color: Material.primaryTextColor
x:contactView.width+2*mm
y:0.5*mm
text: qsTr("Groups")
}
ListView {
id: groupView
x:contactView.width+2*mm
y:5.5*mm
width: permissionDialog.width/2-2*mm
height: permissionDialog.height-14*mm
clip: true
spacing: 1
model: groupModel
delegate: groupItem
}
id: groupView
x:contactView.width+2*mm
y:5.5*mm
width: permissionDialog.width/2-2*mm
height: permissionDialog.height-14*mm
clip: true
spacing: 1
model: groupModel
delegate: groupItem
}
ListModel{id: groupModel}
Component{
id:groupItem
Rectangle{
id:groupitemRect
width:groupView.width
radius: 0.5*mm
height: 5*mm
property string groupstatus:"neutral"
onGroupstatusChanged:
{if(groupstatus=="positive"){groupitemRect.color="light green"}
else if (groupstatus=="negative"){groupitemRect.color= "red"}
else{groupitemRect.color= Material.backgroundColor}}
color: Material.backgroundColor
border.color: Material.frameColor
Text{
color: Material.primaryTextColor
text:group.groupname
}
MouseArea{
ListModel{id: groupModel}
Component{
id:groupItem
Rectangle{
id:groupitemRect
width:groupView.width
radius: 0.5*mm
height: 5*mm
property string groupstatus:"neutral"
onGroupstatusChanged:
{if(groupstatus=="positive"){groupitemRect.color="light green"}
else if (groupstatus=="negative"){groupitemRect.color= "red"}
else{groupitemRect.color= Material.backgroundColor}}
color: Material.backgroundColor
border.color: Material.frameColor
Text{
color: Material.primaryTextColor
text:group.groupname
}
MouseArea{
anchors.fill: parent
onClicked:{
if(groupModel.get(index).groupstatus=="neutral"){
@ -170,55 +171,56 @@ Rectangle{
else if (groupModel.get(index).groupstatus=="positive"){
groupModel.set(index,{"groupstatus":"negative"});
groupstatus="negative"}
else{groupModel.set(index,{"groupstatus":"neutral"})
groupstatus="neutral"}
else{groupModel.set(index,{"groupstatus":"neutral"})
groupstatus="neutral"}
}}
Component.onCompleted:{ if (groupModel.get(index).groupstatus=="positive"){
groupstatus="positive"
}
else if (groupModel.get(index).groupstatus=="negative"){
groupstatus="negative"
}
else {groupstatus="neutral"} }
}
}
MButton{
x:0.5*mm
anchors.bottom: parent.bottom
anchors.bottomMargin:1
text:"\uf0c7"
onClicked:{
Component.onCompleted:{ if (groupModel.get(index).groupstatus=="positive"){
groupstatus="positive"
}
else if (groupModel.get(index).groupstatus=="negative"){
groupstatus="negative"
}
else {groupstatus="neutral"} }
}
}
MButton{
x:0.5*mm
anchors.bottom: parent.bottom
anchors.bottomMargin:1
text:"\uf0c7"
onClicked:{
updatePerms();
var perms=[];
perms.push(contact_allow,contact_deny,group_allow,group_deny);
Service.savePermissions(db,perms)
}
}
MButton{
x:contactView.width+2*mm
anchors.bottom: parent.bottom
anchors.bottomMargin:1
text:"\u2713"
onClicked:{updatePerms();
permissionDialog.visible=false;
}
}
}
MButton{
x:contactView.width+2*mm
anchors.bottom: parent.bottom
anchors.bottomMargin:1
text:"\u2713"
onClicked:{
updatePerms();
permissionDialog.visible=false;
}
}
Component.onCompleted:{
Helperjs.readData(db,"contacts",login.username,function(contacts){
Component.onCompleted:{
Helperjs.readData(db,"contacts",login.username,function(contacts){
for (var name in contacts){
var contactstatus="neutral";
if (contact_allow.indexOf(contacts[name].cid)>-1){contactstatus="positive"}
else if (contact_deny.indexOf(contacts[name].cid)>-1){contactstatus="negative"}
contactModel.append({"contact":contacts[name],"contactstatus":contactstatus})
}},"isFriend",1,"name");
var contactstatus="neutral";
if (contact_allow.indexOf(contacts[name].cid)>-1){contactstatus="positive"}
else if (contact_deny.indexOf(contacts[name].cid)>-1){contactstatus="negative"}
contactModel.append({"contact":contacts[name],"contactstatus":contactstatus})
}},"isFriend",1,"name");
Helperjs.readData(db,"groups",login.username,function(owngroups){
Helperjs.readData(db,"groups",login.username,function(owngroups){
for (var number in owngroups){
var groupstatus= "neutral";
if (group_allow.indexOf(owngroups[number].gid)>-1){groupstatus="positive"}
else if (group_deny.indexOf(owngroups[number].gid)>-1){groupstatus="negative"}
groupModel.append({"group":owngroups[number],"groupstatus":groupstatus})
}});
}
var groupstatus= "neutral";
if (group_allow.indexOf(owngroups[number].gid)>-1){groupstatus="positive"}
else if (group_deny.indexOf(owngroups[number].gid)>-1){groupstatus="negative"}
groupModel.append({"group":owngroups[number],"groupstatus":groupstatus})
}});
}
}

View file

@ -38,6 +38,7 @@ Rectangle {
id:searchComponent
color: Material.backgroundColor
radius:0.5*mm
property bool selfdestroying:false
/* anchors.left: parent.left
anchors.leftMargin:mm
anchors.top:parent.top
@ -54,7 +55,10 @@ Rectangle {
anchors.fill: parent
selectByMouse: true
cursorVisible: false
onEditingFinished:{ if (displayText!=""){search(displayText)};searchComponent.destroy()}
onAccepted:{
if (displayText!=""){search(displayText)};
if(selfdestroying){searchComponent.destroy()}
}
}
Component.onCompleted: searchText.forceActiveFocus()
}

View file

@ -44,8 +44,6 @@ Page {
property var contact:({})
property string profileimagesource:contact.profile_image
//function backRequested(){pageStack.pop()}
function getDateDiffString (seconds){
var timestring="";
if (seconds<60) {timestring= Math.round(seconds) + " " +qsTr("seconds");}
@ -141,14 +139,12 @@ Page {
Component { id: contactHeader
Rectangle{
border.color: Material.backgroundDimColor//"#EEEEEE"
border.color: Material.backgroundDimColor
border.width: 1
color: Material.backgroundColor//"white"
color: Material.backgroundColor
width:contactView.width
height: contactView.width<35*root.fontFactor*osSettings.systemFontSize?(profileImage.height+namelabel.height+detailtext.height+7*mm):Math.max(profileImage.height,(buttonflow.height+namelabel.height+detailtext.height))+7*mm
//height: wrapper.height
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>")
Image {
id: profileImage
@ -160,7 +156,7 @@ Page {
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
Connections{
target:contactList
onProfileimagesourceChanged:profileImage.source=profileimagesource
function onProfileimagesourceChanged(){profileImage.source=profileimagesource}
}
}
Flow{id:buttonflow
@ -175,7 +171,7 @@ Page {
id:photobutton
height: 6*mm
width: 8*mm
text: "\uf03e" // "Photos"
text: "\uf03e"
visible:(contact.network=="dfrn")
onClicked:{
rootstack.currentIndex=2;
@ -193,7 +189,7 @@ Page {
height: 6*mm
width: 8*mm
visible: (contact.following=="true")
text: "\uf040" //"DM"
text: "\uf040"
onClicked:{
rootstack.currentIndex=0;
newsSwipeview.currentIndex=2;
@ -217,9 +213,8 @@ Page {
}
MButton{
id:approvebutton
visible:(contact.hasOwnProperty("acct"))
visible:(contact.hasOwnProperty("acct")&&!contact.searchContact)
height: 6*mm
//width: implicitContentWidth+2*mm//8*mm
text:qsTr("Approve")
onClicked:{
@ -232,9 +227,8 @@ Page {
}
MButton{
id:rejectbutton
visible:(contact.hasOwnProperty("acct"))
visible:(contact.hasOwnProperty("acct")&&!contact.searchContact)
height: 6*mm
//width: implicitContentWidth+2*mm//8*mm
text:qsTr("Reject")
onClicked:{
Helperjs.friendicaPostRequest(login,"/api/v1/follow_requests/" + contact.id + "/reject",'',"POST",root,function(returnvalue){
@ -246,9 +240,8 @@ Page {
}
MButton{
id:ignorebutton
visible:(contact.hasOwnProperty("acct"))
visible:(contact.hasOwnProperty("acct")&&!contact.searchContact)
height: 6*mm
//width: implicitContentWidth+2*mm//8*mm
text:qsTr("Ignore")
onClicked:{
Helperjs.friendicaPostRequest(login,"/api/v1/follow_requests/" + contact.id + "/ignore",'',"POST",root,function(returnvalue){
@ -260,9 +253,8 @@ Page {
}
MButton{
id:followbutton
visible:(contact.isFriend==0)
visible:(contact.isFriend==0 || !contact.hasOwnProperty("isFriend"))
height: 6*mm
//width: implicitContentWidth+2*mm//8*mm
text:qsTr("Follow")
onClicked:{
contactBusy.running=true;
@ -281,7 +273,6 @@ Page {
id:unfollowbutton
visible:(contact.isFriend==1)
height: 6*mm
//width: implicitContentWidth+2*mm//8*mm
text:qsTr("Unfollow")
onClicked:{
Helperjs.friendicaPostRequest(login,"/api/v1/accounts/" + contact.id + "/unfollow",'',"POST",root,function(returnvalue){
@ -297,12 +288,11 @@ Page {
}//Flow end
Label {
id: namelabel
//x:mm
width: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.width-2*mm:contactView.width-17*root.fontFactor*osSettings.bigFontSize
height: implicitHeight
text:contact.name+" (@"+contact.screen_name+")"
wrapMode: Text.Wrap//elide:Text.ElideRight
color: Material.primaryTextColor//"#303030"
wrapMode: Text.Wrap
color: Material.primaryTextColor
font.pointSize: 1.2*osSettings.bigFontSize
font.family: "Noto Sans"
anchors.top: contactView.width<35*root.fontFactor*osSettings.systemFontSize?profileImage.bottom:buttonflow.bottom
@ -314,7 +304,6 @@ Page {
anchors.top: namelabel.bottom
anchors.left: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.left:profileImage.right
anchors.margins: 2*mm
//x:mm
width: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.width-2*mm:contactView.width-17*root.fontFactor*osSettings.bigFontSize
height: implicitHeight
font.pointSize: osSettings.systemFontSize
@ -324,15 +313,11 @@ Page {
color: Material.primaryTextColor
text:"<b>"+qsTr("Description")+": </b> "+(Qt.atob(contact.description)!=""?contact.description:"")+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
"<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+
connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
"<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
onLinkActivated: {
Qt.openUrlExternally(link)}
}
//}
}
}//Component end
Connections{
@ -342,8 +327,9 @@ Page {
contactBusy.running=false;
}
function onSuccess(data,api){
Service.processNews(api,data)
//replySignal("")
if (api=="/api/statuses/user_timeline"){
Service.processNews(api,data)
}
}
}
@ -373,7 +359,6 @@ Page {
anchors.rightMargin: 1*mm
width: 2*root.fontFactor*osSettings.bigFontSize;
text: "\uf057"
//font.pixelSize: 3*mm
onClicked: {
rootstackView.pop()
}
@ -382,9 +367,10 @@ Page {
xhr.clearParams();
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
if(contact.isFriend==1 || contact.hasOwnProperty("acct")){
xhr.setApi("/api/statuses/user_timeline");}
else{xhr.setApi("/api/users/show");}
// if(contact.isFriend==1 || contact.hasOwnProperty("acct")){
// xhr.setApi("/api/statuses/user_timeline");}
// else{xhr.setApi("/api/users/show");}
xhr.setApi("/api/statuses/user_timeline")
xhr.setParam("user_id",contact.id)
xhr.get();
}

View file

@ -34,7 +34,6 @@
import QtQuick 2.4
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
//import QtQuick.Dialogs 1.2
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/smiley.js" as Smileyjs
import "qrc:/js/news.js" as Newsjs
@ -42,19 +41,17 @@ import "qrc:/qml/genericqml"
Rectangle{
color:Material.dialogColor//"#EEEEEE"
color:Material.dialogColor
width:parent.width
height: conversation || (newsSwipeview.stacktype!="Notifications")?messageColumn.height+mm:0
height: conversation || (newsSwipeview.stacktype!="Notifications")?messageColumn.height+2*mm:0
id:messageSend
visible:conversation || (newsSwipeview.stacktype!="Notifications")||(newstab.newstabstatus!="Search")?true:false
property string parentId: ""
property bool textfocus: false
//property var parentObject:({})
property bool conversation: false
property string reply_to_user:""
property alias bodyMessage: bodyField.text
property var attachImageURLs: [];
//property int directmessage: 0;
property var contacts: []
property var groups: []
property var contact_allow:login.hasOwnProperty("permissions")?login.permissions[0]:[]
@ -130,13 +127,12 @@ Rectangle{
}
function setParent(newsitemobject){
//print("Newsobject "+newsitemobject.id+ " "+JSON.stringify(newsitemobject.user));
if (newsitemobject!=""){
messageSend.state="conversation"
messageSend.reply_to_user=newsitemobject.user.screen_name;
messageSend.parentId=newsitemobject.id
} else {
//messageSend.state=null;
messageSend.state=null;
messageSend.reply_to_user="";
messageSend.parentId="";
bodyField.text="";
@ -145,7 +141,7 @@ Rectangle{
}
}
function contactmenu(letter){//print("letter "+letter)
function contactmenu(letter){
Newsjs.listFriends(login,db,function(contacts){
contactModel.clear();
for (var i=0;i<contacts.length;i++){
@ -158,7 +154,7 @@ Rectangle{
},letter);
}
function hashtagmenu(){//print("letter "+letter)
function hashtagmenu(){
Newsjs.listHashtags(login,db,function(tags){
tagModel.clear();
for (var i=0;i<tags.length;i++){
@ -191,7 +187,7 @@ Rectangle{
id:messageColumn
spacing: 0.5*mm
width: parent.width
height: 11*mm+stackTypeDescription.height//implicitHeight
height: 2.6*root.fontFactor*osSettings.bigFontSize+stackTypeDescription.height
Label{id:stackTypeDescription
width: parent.width
horizontalAlignment:Text.AlignHCenter
@ -200,7 +196,7 @@ Rectangle{
}
TextArea{
id:receiverLabel
width: messageColumn.width//-8*mm
width: messageColumn.width
font.pointSize: osSettings.bigFontSize
placeholderText:qsTr("to:")
text: ""
@ -222,11 +218,12 @@ Rectangle{
}
Rectangle{
color: Material.backgroundColor//"white"
color: Material.backgroundColor
radius: 0.5*mm
visible:(newsSwipeview.stacktype!="Notifications")
x:mm
width: parent.width-2*mm
height:Math.max(bodyField.contentHeight+4*mm,10*mm)
height:Math.max(bodyField.contentHeight+4*mm,2.5*root.fontFactor*osSettings.bigFontSize)
TextArea {
id: bodyField
@ -238,14 +235,27 @@ Rectangle{
wrapMode: Text.Wrap
selectByMouse: true
placeholderText: conversation?"": (qsTr("What's on your mind?")+placeholder)
textFormat: TextEdit.RichText //TextEdit.PlainText
onLineCountChanged: (conversation==true)?conversationView.contentY=conversationView.contentY+3*mm:newsView.contentY=newsView.contentY+3*mm
textFormat: TextEdit.RichText
onLineCountChanged: {
if (messageSend.ListView.view==null){
if (newsitem.ListView.view==null){}
else {newsitem.ListView.view.contentY=newsitem.ListView.view.contentY+root.fontFactor*osSettings.systemFontSize}
}
if(conversation==true){
conversationView.contentY=conversationView.contentY+root.fontFactor*osSettings.systemFontSize
}
else{
messageSend.ListView.view.contentY=messageSend.ListView.view.contentY+root.fontFactor*osSettings.systemFontSize
}
}
onLinkActivated:{Qt.openUrlExternally(link)}
onActiveFocusChanged:{//print(placeholder)
onActiveFocusChanged:{
if (activeFocus==true){
print("contenty "+messageSend.ListView.view.contentY)
if (messageSend.ListView.view.contentY==null){messageSend.parent.ListView.view.y=0}else{messageSend.ListView.view.contentY=messageSend.ListView.view.contentY+8*mm};
if (conversation==true){
if (messageSend.ListView.view==null){
if (newsitem.ListView.view==null){}
else {newsitem.ListView.view.contentY=newsitem.ListView.view.contentY+newsitem.height/2}
}
else if (conversation==true){
if(parentId==""){setParent(conversationModel.get(0).newsitemobject);}
messageSend.state="conversation";
try{conversationView.contentY=conversationView.contentY+20*mm}catch(e){}
@ -253,15 +263,15 @@ Rectangle{
messageSend.state="active";
newsView.positionViewAtBeginning();
}
else{
messageSend.ListView.view.contentY=messageSend.ListView.view.contentY+8*mm
};
}
}
onTextChanged:{
if (text!=""){
var plaintext=getText(0,cursorPosition)
//print(plaintext+plaintext.lastIndexOf("@",cursorPosition)+getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition) +" preedit: "+ preeditText+cursorPosition);
var regex1 = /@[a-z]+/;var regex2 = /![a-z]+/;var regex3 = /\s/;
//print(text.substring(cursorPosition-2,cursorPosition));
//if (regex.test(getText(bodyField.cursorPosition-2,bodyField.cursorPosition)) || regex.test(preeditText) || regex.test(text)){
var regex1 = /@[a-z]+/;var regex2 = /\![a-z]+/;var regex3 = /\s/;
if (regex1.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText) && !regex3.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText)){
var letter=(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)).match(/[a-z]+/);
contactprefix="@";
@ -280,8 +290,8 @@ Rectangle{
id:contactSelector
visible: false
z:3
x:8*mm
width: parent.width-9*mm
x:2*root.fontFactor*osSettings.bigFontSize//8*mm
width: parent.width-2.2*root.fontFactor*osSettings.bigFontSize//9*mm
height: messageSend.height/2
model:contactModel
function processContactSelection(contact){
@ -307,8 +317,8 @@ Rectangle{
id: tagSelector
visible: false
z:3
x:8*mm
width: parent.width-9*mm
x:2*root.fontFactor*osSettings.bigFontSize//8*mm
width: parent.width-2.2*root.fontFactor*osSettings.bigFontSize//9*mm
height: messageSend.height/2
model:tagModel
clip: true
@ -367,15 +377,15 @@ Rectangle{
id:buttonRow
visible:false //(bodyField.length>1)||(attachImageURLs.length>0)
spacing: mm
height: 12*mm
height: 2.5*root.fontFactor*osSettings.bigFontSize//12*mm
x: 0.5*mm
MButton{id:permButton
visible: !conversation && (newsSwipeview.stacktype!=="DirectMessages")
height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
onClicked: { if (permissionDialog.visible==false){permissionDialog.visible=true} else{permissionDialog.visible=false}}
}
// MButton{id:permButton //Permissions not working in Friendica 02/2022
// visible: !conversation && (newsSwipeview.stacktype!=="DirectMessages")
// height: 2*root.fontFactor*osSettings.bigFontSize
// width: 2*root.fontFactor*osSettings.bigFontSize
// text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
// onClicked: { if (permissionDialog.visible==false){permissionDialog.visible=true} else{permissionDialog.visible=false}}
// }
MButton {
id: attachButton
height: 2*root.fontFactor*osSettings.bigFontSize
@ -440,8 +450,8 @@ Rectangle{
var body=bodyField.getFormattedText(0,bodyField.length);
var dmbody=bodyField.getText(0,bodyField.length);
if (conversation || newsSwipeview.stacktype!=="DirectMessages"){
statusUpdate(title,body,parentId,attachImageURLs)}
else {
statusUpdate(title,body,parentId,attachImageURLs)
}else {
if (reply_to_user!=""){dmUpdate(title,dmbody,parentId,reply_to_user)}
else{Helperjs.showMessage(qsTr("Error"),qsTr("No receiver supplied!"),root)}
}

View file

@ -55,7 +55,7 @@ AnimatedImage {id:gif;
MouseArea {anchors.fill:parent;
onClicked:{
rootstackView.push("qrc:/qml/newsqml/NewsPhotolist.qml",{"photolistarray": model.newsitemobject.imageAttachmentList})
roottoolbar.visible=false
//roottoolbar.visible=false
}
}
}

View file

@ -69,7 +69,7 @@ Page{
text: "\uf057"
onClicked: {
if (rootstackView.depth>1){
roottoolbar.visible=true;
//roottoolbar.visible=true;
rootstackView.pop()}
}
}

View file

@ -49,7 +49,6 @@ Rectangle{
BusyIndicator{
id: newsBusy
//visible: false
anchors.horizontalCenter: parent.horizontalCenter
anchors.top:parent.top
anchors.topMargin: 2*mm
@ -60,10 +59,8 @@ Rectangle{
}
function newstypeHandling(newstype){
newsBusy.running=true;
try{newsBusy.running=true}catch(e){print(e)};
replySignal("");
//messagesend.state="";
//newsModel.clear();
switch(newstype){
case "timeline":
newstab.newstabstatus="Timeline";
@ -75,7 +72,7 @@ Rectangle{
case "conversation":
newsStack.updateMethodNews="conversation";
newstab.newstabstatus="Conversations";
Newsjs.chatsfromdb(root.db,root.login,0,function(news,lastid){
Newsjs.chatsfromdb(root.db,root.login,0,[],function(news,lastid){
lastnewsid=lastid;
showNews(news)});
break;
@ -105,7 +102,7 @@ Rectangle{
newsBusy.running=false;
var leftoffset=(osSettings.osType=="Android")?2*root.fontFactor*osSettings.bigFontSize:0
var component = Qt.createComponent("qrc:/qml/genericqml/Search.qml");
var searchItem = component.createObject(newsStack,{y:mm,x:leftoffset,width:root.width-(leftoffset+mm),height: 1.5*root.fontFactor*osSettings.systemFontSize});
var searchItem = component.createObject(newsStack,{y:mm,x:leftoffset,width:root.width-(leftoffset+mm),height: 1.5*root.fontFactor*osSettings.systemFontSize,selfdestroying:true});
break;
case "refresh":
if (newstab.newstabstatus=="Timeline" || newstabstatus=="Timeline"){
@ -147,20 +144,19 @@ Rectangle{
function showNews(newsToShow){
try{if (rootstackView.depth>1){rootstackView.pop()}}catch(e){}
newsBusy.running=false;
var currentTime= new Date();
// downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
//print("appendnews "+JSON.stringify(newsToShow))
if (newsToShow.length==1){var method="refresh"}else{var method = newsStack.updateMethodNews}
var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'method':method, 'options':globaloptions};
newsWorker.sendMessage(msg);
//newsStack.appendNews=false
if(newsToShow.length>0){
var currentTime= new Date()
// downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
if (newsToShow.length==1){var method="refresh"}else{var method = newsStack.updateMethodNews}
var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'method':method, 'options':globaloptions};
newsWorker.sendMessage(msg);
}
}
function search(term){
if (term!=""){
//newstab.newstabstatus="Search";
newstabstatus="Search";
newsBusy.running=true;
newsStack.updateMethodNews="refresh";
@ -179,10 +175,12 @@ Rectangle{
try{var oldnewsitemobject=newsModel.get(newsModel.count-1).newsitemobject;
if(oldnewsitemobject.hasOwnProperty("lastcomment")){
var lastnews_id=oldnewsitemobject.lastcomment.created_at;
//var lastconv_id=oldnewsitemobject.lastcomment.statusnet_conversation_id
}else{
var lastnews_id=oldnewsitemobject.created_at;
//var lastconv_id=oldnewsitemobject.statusnet_conversation_id
}
} catch(e){print(e);var lastnews_id=99999999999999 }
} catch(e){print(e);var lastnews_id=99999999999999}
var messagetype=0;
switch(newsSwipeview.stacktype){
case "Home":messagetype=0;break;
@ -192,14 +190,19 @@ Rectangle{
default:messagetype=0;
}
if(newstab.newstabstatus=="Timeline" || newstabstatus=="Timeline" ){
if(newsSwipeview.stacktype!="Home"|| newstab.newstabstatus=="Timeline" || newstabstatus=="Timeline" ){
Newsjs.newsfromdb(root.db,root.login, messagetype,function(news){
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'method':"", 'options':globaloptions};
newsWorker.sendMessage(msg);
},false,lastnews_id)}
else if(newstab.newstabstatus=="Conversations" || newstabstatus=="Conversations"){
Newsjs.chatsfromdb(root.db,root.login, messagetype,function(news){
var currentconversations=[];
for (let c=0;c<newsModel.count;c++){
currentconversations.push(parseInt(newsModel.get(c).newsitemobject.statusnet_conversation_id))
}
Newsjs.chatsfromdb(root.db,root.login, messagetype,currentconversations,function(news){
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'method':"", 'options':globaloptions};
newsWorker.sendMessage(msg);
},lastnews_id)}
@ -252,7 +255,6 @@ Rectangle{
Service.updateView("Replies")
}
replySignal("")
//Service.updateView(newstab.newstabstatus)
}
}
}
@ -301,7 +303,6 @@ Rectangle{
property string viewtype: "news"
width: parent.width
height: parent.height-3*mm
//anchors.fill: parent
anchors.margins: 0.5*mm
clip: true
spacing: 0
@ -355,11 +356,11 @@ Rectangle{
})}catch(e){Helperjs.showMessage("Error",e,root)};
}
if(newstab.newstabstatus=="Conversations"){
Newsjs.chatsfromdb(db,root.login,0,function(news,lastid){
Newsjs.chatsfromdb(db,root.login,0,[],function(news,lastid){
lastnewsid=lastid;
showNews(news)});
}
} else {
} else {print("newstab.newstabstatus "+newstab.newstabstatus)
Service.updateView(newstab.newstabstatus)
}
});
@ -424,7 +425,7 @@ Rectangle{
root.searchSignal.connect(search);
try{newsModel.clear()} catch(e){}
swipeIndicator.visible=true;
//newsSwipeview.height=rootstack.height//-12*mm;
//newsSwipeview.height=rootstack.height
//newsSwipeview.y=5*mm;
//rootStackItem.state=""
root.globaloptions.hasOwnProperty("newsViewType")?newstab.newstabstatus=root.globaloptions.newsViewType:newstab.newstabstatus="Conversations";
@ -438,9 +439,8 @@ Rectangle{
default:messagetype=0;
}
//if((newstab.newstabstatus=="Conversations")&&(newsSwipeview.stacktype=="Home")){
if((newstabstatus=="Conversations")&&(newsSwipeview.stacktype=="Home")){
Newsjs.chatsfromdb(db,login,messagetype,function(dbnews,lastid){
Newsjs.chatsfromdb(db,login,messagetype,[],function(dbnews,lastid){
lastnewsid=lastid;
showNews(dbnews);
})
@ -451,5 +451,4 @@ Rectangle{
showNews(dbnews)
})}
}
//}
}

View file

@ -33,7 +33,6 @@ import QtQuick 2.9
Rectangle{
color:"black"
//border.color: "light grey"
width:toprow.width/2;
height:toprow.width/3//video.hasVideo?newscolumn.width/4*3:10*mm
property var attachment:({})
@ -49,11 +48,7 @@ Rectangle{
MouseArea {anchors.fill:parent;
onClicked:{
if(attachment.mimetype=="video/youtube"){
rootstackView.push("qrc:/qml/newsqml/NewsYplayer.qml",{"ytcode":attachment.url,"mimetype":attachment.mimetype});
} else {
rootstackView.push("qrc:/qml/newsqml/NewsVideoLarge.qml",{"source": attachment.url,"mimetype": attachment.mimetype});
}
}
}
}

View file

@ -1,77 +0,0 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2020 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.8
import QtQuick.Controls 2.12
import "qrc:/js/helper.js" as Helperjs
import QtWebView 1.1
Page {
id:newsYplayer
//color:"black"
width:root.width;
height:root.height-7*mm
property string url:""
property string ytcode:""
WebView {
id: webView
anchors.fill: parent
z:1
opacity: 0
url: root.osSettings.osType=="Android"?"https://youtube.com/watch?v="+ytcode:"qrc:/js/yplayer.html?" + ytcode
Behavior on opacity { NumberAnimation { duration: 200 } }
onLoadingChanged: {
switch (loadRequest.status)
{
case WebView.LoadSucceededStatus:
opacity = 1
return
case WebView.LoadStartedStatus:
case WebView.LoadStoppedStatus:
break
case WebView.LoadFailedStatus:
print("Failed to load the requested video" + url)
break
}
opacity = 0
}
onTitleChanged: {
if (title==2){root.pop()}
}
}
}

View file

@ -58,23 +58,21 @@ Item {
function pushConversation(){
if (model.newsitemobject.hasOwnProperty("currentconversation")){
rootstackView.push("qrc:/qml/newsqml/Conversation.qml",{"news": model.newsitemobject.currentconversation})}
//newsStack.push("qrc:/qml/newsqml/Conversation.qml",{"news": model.newsitemobject.currentconversation})}
//else{newsStack.push("qrc:/qml/newsqml/Conversation.qml")};
else{rootstackView.push("qrc:/qml/newsqml/Conversation.qml")};
showConversation(index,newsitemobject)
}
Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom;
color: Material.backgroundDimColor//"light grey"
color: Material.backgroundDimColor
}
Rectangle{
width:newsitem.width
height:newsitem.height-1
color: Material.background//"white"
color: Material.background
Column {
id:toprow //newscolumn
id:toprow
width: newsitemobject.hasOwnProperty("indent")?newsitem.width-(newsitem.width/20 *(newsitemobject.indent+1)):newsitem.width//-8*mm
x:newsitemobject.hasOwnProperty("indent")?newsitem.width/20*(newsitemobject.indent):0
height: newsitemobject.nsfw?5*mm:Math.min(implicitHeight,3/4*root.height)
@ -105,7 +103,6 @@ Item {
anchors.margins: mm
Label {
id:user_name
//color: "grey"
width:parent.width
font.bold: true
font.pointSize: osSettings.systemFontSize
@ -115,25 +112,24 @@ Item {
Label {
id:messageTypeLabel
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
text: if (newsitemobject.messagetype==1){ qsTr("Direct Message")} else if(newsitemobject.messagetype==2) {" Notification"} else {qsTr("Source: ")+newsitemobject.source}
font.pointSize: 0.6*osSettings.systemFontSize
}
Label {
id:createdAtLabel
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
font.pointSize: 0.6*osSettings.systemFontSize
horizontalAlignment: Label.AlignRight
text: " \u00B7 "+getDateDiffString(newsitemobject.dateDiff) + " " +qsTr("ago")
}
Label {
id:replytoLabel
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
font.pointSize: 0.6*osSettings.systemFontSize
font.family: "Noto Sans"
horizontalAlignment: Label.AlignRight
text: try {" \u00B7 "+qsTr("In reply to ")+newsitemobject.reply_user.screen_name
}catch(e){" "}
text: (newsitemobject.in_reply_to_status_id!="null"&&newsitemobject.in_reply_to_status_id!=null)?" \u00B7 "+qsTr("In reply to ")+newsitemobject.reply_user.screen_name:" "
}
}
}
@ -141,32 +137,27 @@ Item {
MouseArea{id: itemBody
width: toprow.width-2
height: itemMessage.height
//onPressAndHold: {pushConversation()}
onClicked: {pushConversation()}
Text {
color: Material.primaryTextColor//"#404040"
linkColor: Material.accentColor//"light green"
color: Material.primaryTextColor
linkColor: Material.accentColor
id: itemMessage
textFormat: Text.RichText
font.family: "Noto Sans"
font.pointSize: osSettings.systemFontSize
text: newsitemobject.statusnet_html
width: toprow.width-2
//height:newsitemobject.nsfw?5*mm:Math.min(implicitHeight,3/4*root.height)
height: implicitHeight
wrapMode: Text.Wrap
clip:true
onLinkActivated:{Qt.openUrlExternally(link)}
Component.onCompleted:{
if (newsitemobject.messagetype==0){
var hashtags=[];
hashtags=Newsjs.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()});
}
onLinkActivated:{
if(link.startsWith(root.login.server+"\/search\?tag=")){
newstab.newstabstatus="Search";
root.searchSignal(link.substring(root.login.server.length+12,link.length))
}
else{Qt.openUrlExternally(link)}
}
Component.onCompleted:{
if (newsitemobject.imageAttachmentList.length>0){
if(newsitemobject.imageAttachmentList[0].mimetype.substring(0,5)=="image"){
var component = Qt.createComponent("qrc:/qml/newsqml/NewsImage.qml");
@ -195,16 +186,16 @@ Item {
BlueButton{
width: newsitem.width-2
height:5*mm
anchors.bottom: toprow.bottom//itemMessage.bottom
visible: toprow.implicitHeight>3/4*root.height || newsitemobject.nsfw//messageColumn.implicitHeight>3/4*root.height || newsitemobject.nsfw//itemMessage.implicitHeight>3/4*root.height
anchors.bottom: toprow.bottom
visible: toprow.implicitHeight>3/4*root.height || newsitemobject.nsfw
text:"\uf078"
fontColor: Material.secondaryTextColor//"grey"
fontColor: Material.secondaryTextColor
border.color: "transparent"
color: Material.backgroundColor//"white"
// gradient: Gradient {
// GradientStop { position: 0.0; color: "transparent" }
// GradientStop { position: 0.5; color: "white" }
// }
color: Material.backgroundColor
// gradient: Gradient {
// GradientStop { position: 0.0; color: "transparent" }
// GradientStop { position: 0.5; color: Material.backgroundDimColor}
// }
radius:0
onClicked: {
if (text=="\uf078"){
@ -224,45 +215,45 @@ Item {
width:parent.width
spacing:mm
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.likeText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.likeText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.like)}
}
}
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.dislikeText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.dislikeText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.dislike)}
}
}
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.attendyesText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.attendyesText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendyes)}
}}
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.attendnoText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.attendnoText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendno)}
}
}
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.attendmaybeText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.attendmaybeText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendmaybe)}
@ -270,7 +261,7 @@ Item {
}
Label{
id:attendLabel
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
horizontalAlignment: Label.AlignRight
@ -284,12 +275,12 @@ Item {
height: root.fontFactor*osSettings.bigFontSize
CheckBox{
id:likeCheckbox
width:newsitem.width/5 //10*mm
width:newsitem.width/5
height: parent.height
visible: ((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))? true:false
checked:(model.newsitemobject.friendica_activities_view.self.liked==1)?true:false
indicator: Rectangle{
implicitWidth: newsitem.width/5 //10*mm
implicitWidth: newsitem.width/5
implicitHeight:root.fontFactor*osSettings.bigFontSize
color:"transparent"
Text{
@ -312,12 +303,12 @@ Item {
}
CheckBox{
id: dislikeCheckbox
width:newsitem.width/5 //10*mm
width:newsitem.width/5
height: parent.height
visible: ((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))? true:false
checked: (newsitemobject.friendica_activities_view.self.disliked==1)?true:false
indicator: Rectangle{
implicitWidth: newsitem.width/5 //10*mm
implicitWidth: newsitem.width/5
implicitHeight:root.fontFactor*osSettings.bigFontSize
color:"transparent"
Text{
@ -339,39 +330,72 @@ Item {
}}
}
CheckBox {
id:favoritedCheckbox
visible:((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))
width: newsitem.width/5 // 10*mm
// CheckBox {
// id:favoritedCheckbox
// visible:((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))
// width: newsitem.width/5
// height: parent.height
// indicator:Rectangle{
// implicitWidth: newsitem.width/5
// implicitHeight:root.fontFactor*osSettings.bigFontSize
// color:"transparent"
// Text{
// anchors.centerIn: parent
// font.pointSize: osSettings.systemFontSize
// font.family:fontAwesome.name
// color: favoritedCheckbox.checked?Material.primaryTextColor: Material.secondaryTextColor
// text:"\uf005"
// }
// }
// checked:(newsitemobject.favorited>0)
// onClicked:{
// if(favoritedCheckbox.checkState==Qt.Checked){
// Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
// else if(favoritedCheckbox.checkState==Qt.Unchecked){
// Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
// }
// }
Rectangle{
width: newsitem.width/5
height: parent.height
indicator:Rectangle{
implicitWidth: newsitem.width/5 //10*mm
implicitHeight:root.fontFactor*osSettings.bigFontSize
color:"transparent"
Text{
anchors.centerIn: parent
font.pointSize: osSettings.systemFontSize
font.family:fontAwesome.name
color: favoritedCheckbox.checked?Material.primaryTextColor: Material.secondaryTextColor
text:"\uf005"
}
visible:(newsitemobject.messagetype!==2)
color:"transparent"
Text{
id:replysymbol
color: Material.secondaryTextColor
anchors.centerIn: parent
font.pointSize: osSettings.systemFontSize
font.family:fontAwesome.name
text: "\uf112"
}
checked:(newsitemobject.favorited>0)
onClicked:{
if(favoritedCheckbox.checkState==Qt.Checked){
Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
else if(favoritedCheckbox.checkState==Qt.Unchecked){
Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
MouseArea{
anchors.fill:parent
onClicked: {
var directmessage=0;
if (newsitemobject.messagetype==1){ directmessage=1}
var replycomp=Qt.createComponent("qrc:/qml/newsqml/MessageSend.qml");
var conversation;
if (newsitem.ListView.view==null){conversation=true}
else if (newsitem.ListView.view.viewtype=="conversation"){
conversation=true
newsitem.ListView.view.currentIndex=itemindex
}
else{
conversation=false;
newsitem.ListView.view.currentIndex=itemindex
};
var reply=replycomp.createObject(friendicaActivities,{parentId:newsitemobject.id,reply_to_user:newsitemobject.user.screen_name, state:"reply",conversation:conversation,textfocus:true})
}
}
}
Rectangle{
width: newsitem.width/5 //10*mm
width: newsitem.width/5
height: parent.height
visible:(newsitemobject.messagetype!==2)
color:"transparent"
Text{
id:newsmenusymbol
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
anchors.centerIn: parent
font.pointSize: osSettings.systemFontSize
font.family:fontAwesome.name
@ -393,30 +417,8 @@ Item {
text: parent.text
}
}
Action{
text: qsTr("Reply")
onTriggered: {
var directmessage=0;
if (newsitemobject.messagetype==1){ directmessage=1}
var replycomp=Qt.createComponent("qrc:/qml/newsqml/MessageSend.qml");
var conversation;
if (newsitem.ListView.view==null){conversation=true}
else if (newsitem.ListView.view.viewtype=="conversation"){
conversation=true
newsitem.ListView.view.currentIndex=itemindex
}
else{
conversation=false;
newsitem.ListView.view.currentIndex=itemindex
};
var reply=replycomp.createObject(friendicaActivities,{parentId:newsitemobject.id,reply_to_user:newsitemobject.user.screen_name, state:"reply",conversation:conversation,textfocus:true})
}
}
Action {
text: qsTr("DM")
onTriggered: {
root.directmessageSignal(newsitemobject.user.screen_name);
}
onAboutToShow:{if(newsitemobject.hasOwnProperty("external_url")){
insertAction(4,externalAction)}
}
Action {
text: qsTr("Repost")
@ -432,7 +434,21 @@ Item {
pushConversation();
}
}
Action {
text: qsTr("DM")
onTriggered: {
root.directmessageSignal(newsitemobject.user.screen_name);
}
}
Action {
text: qsTr("Bookmark")
onTriggered: {
if(model.newsitemobject.favorited==0){
Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
else if(model.newsitemobject.favorited==1){
Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
}
}
Menu{
title: qsTr("Attending")
width: 10*root.fontFactor*osSettings.systemFontSize
@ -469,11 +485,6 @@ Item {
})
}
}
//MenuItem{
// text:qsTr("Show on website")
// onTriggered:Qt.openUrlExternally(login.server+"/display/"+newsitemobject
//}
}
Column{
id:conversationColumn
@ -481,4 +492,8 @@ Item {
width: newsitem.width
}
}
Action{id:externalAction
text: qsTr("External")
onTriggered: {Qt.openUrlExternally(newsitemobject.external_url)}
}
}

View file

@ -207,7 +207,7 @@ Rectangle{
width:4.5*mm
height: 4.5*mm
textFormat:Text.RichText
font.pointSize: 1.2*osSettings.systemFontSize
font.pointSize: osSettings.osType=="Linux"?1.7*osSettings.systemFontSize:1.2*osSettings.systemFontSize
text: emoji
MouseArea{

View file

@ -88,7 +88,7 @@ Page{
Connections{
target:xhr
onError:{print(data)}//if (data=="image"){Helperjs.showMessage()}}
//onError:{print(data)}//if (data=="image"){Helperjs.showMessage()}}
onSuccess:{
if (imageId==""){
imageNo=imageNo+1;

View file

@ -41,298 +41,293 @@ import "qrc:/qml/genericqml"
StackView{
id: photoStack
//anchors.fill:parent
initialItem:Rectangle {
id:fotorectangle
anchors.fill:parent
// y:1
// width:root.width-mm
// height:root.height-5*mm
color: Material.backgroundColor//'#fff'
property var newimages:[]
property int currentimageno: 0
property bool remoteContact: false
id:fotorectangle
anchors.fill:parent
color: Material.backgroundColor
property var newimages:[]
property int currentimageno: 0
property bool remoteContact: false
onNewimagesChanged:{
if(fotorectangle.newimages.length>0){
var ownimagelist=[];
Helperjs.readField("album",root.db,"imageData",root.login.username,function(albums){
for (var i=0;i<fotorectangle.newimages.length;i++){
if(albums.indexOf(fotorectangle.newimages[i].album)==-1){
filesystem.Directory=root.login.imagestore+"/albums";
filesystem.makeDir(fotorectangle.newimages[i].album)}
onNewimagesChanged:{
if(fotorectangle.newimages.length>0){
var ownimagelist=[];
Helperjs.readField("album",root.db,"imageData",root.login.username,function(albums){
for (var i=0;i<fotorectangle.newimages.length;i++){
if(albums.indexOf(fotorectangle.newimages[i].album)==-1){
filesystem.Directory=root.login.imagestore+"/albums";
filesystem.makeDir(fotorectangle.newimages[i].album)}
//ownimagelist.push(root.login.server+"/api/friendica/photo?scale='0'&photo_id="+fotorectangle.newimages[i].id);
}
Imagejs.dataRequest(login,fotorectangle.newimages[0],db,xhr,fotorectangle);
})
// xhr.setLogin(login.username+":"+Qt.atob(login.password));
// xhr.setImagedir(login.imagestore);
// xhr.setFilelist(ownimagelist);
// xhr.setDownloadtype("picturelist");
// xhr.getlist();
newImagesProgress.visible=true
}
}
onCurrentimagenoChanged:{
if(fotorectangle.currentimageno==fotorectangle.newimages.length){
newImagesProgress.visible=false;showFotos(root.login,"");
fotorectangle.newimages=[];fotorectangle.currentimageno=0
}else{
// download next image
Imagejs.dataRequest(login,fotorectangle.newimages[currentimageno],db,xhr,fotorectangle)
}
}
Connections{
target:xhr
function onDownloadedjson(type,url,filename,i,jsonObject){
if(type=="picturelist"){
fotorectangle.currentimageno=fotorectangle.currentimageno+1
Imagejs.storeImagedata(login,db,jsonObject,fotorectangle)
}
}
function onDownloaded(type,url,filename,i){
if(type=="picture"){fotorectangle.currentimageno=fotorectangle.currentimageno+1}
}
function onError(data,url,api,code){//print("Url "+url+" api " +api + " data "+data)
if(data=="picturelist"){
var requestid=url.substring(url.lastIndexOf("=")+1);
Imagejs.dataRequest(login,requestid,db,xhr,fotorectangle);
fotorectangle.currentimageno=fotorectangle.currentimageno+1
} else if (data=="picture"){
Helperjs.deleteData(root.db,"imageData",root.login.username,function(){
fotorectangle.currentimageno=fotorectangle.currentimageno+1
},"link",url)
}else{
fotorectangle.currentimageno=fotorectangle.currentimageno+1}
}
}
// Connections{
// target:filesystem
// onError:{print("Error deleting");
// }
// onSuccess:print("Success deleting");
// }
function showFotos(login,friend){
if(friend=="backButton"){
if (photoStack.depth > 1){photoStack.pop()}
else if(albumgridview.currentItem==null){rootstack.currentIndex=0}
else if(albumgridview.currentItem.state=='fullscreen'){
albumgridview.currentItem.state = 'inGrid'}
else if (albumgridview.currentItem.state == 'inGrid'){albumgridview.currentItem.state=''}
else{rootstack.currentIndex=0}
}
else{
try {photogroupModel.clear()}catch (e){print(e)}
if (friend){
Imagejs.newRequestFriendsAlbumPictures(login,friend,fotorectangle,function(albums,remoteAuthBool){
remoteContact=remoteAuthBool;
var msg = {'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture':true,'friend':friend}
photoWorker.sendMessage(msg);
})
phototabstatusButton.text=friend.screen_name+qsTr("\'s images")
}
else {
Helperjs.readField("album", db, "imageData",login.username,function(albums){
if (albums[0]) {
var msg = { 'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture': false};
photoWorker.sendMessage(msg);
//ownimagelist.push(root.login.server+"/api/friendica/photo?scale='0'&photo_id="+fotorectangle.newimages[i].id);
}
Imagejs.dataRequest(login,fotorectangle.newimages[0],db,xhr,fotorectangle);
})
// xhr.setLogin(login.username+":"+Qt.atob(login.password));
// xhr.setImagedir(login.imagestore);
// xhr.setFilelist(ownimagelist);
// xhr.setDownloadtype("picturelist");
// xhr.getlist();
newImagesProgress.visible=true
}
}
}
function deletepics(method, type,id){
onCurrentimagenoChanged:{
if(fotorectangle.currentimageno==fotorectangle.newimages.length){
newImagesProgress.visible=false;showFotos(root.login,"");
fotorectangle.newimages=[];fotorectangle.currentimageno=0
}else{
// download next image
Imagejs.dataRequest(login,fotorectangle.newimages[currentimageno],db,xhr,fotorectangle)
}
}
Connections{
target:xhr
function onDownloadedjson(type,url,filename,i,jsonObject){
if(type=="picturelist"){
fotorectangle.currentimageno=fotorectangle.currentimageno+1
Imagejs.storeImagedata(login,db,jsonObject,fotorectangle)
}
}
function onDownloaded(type,url,filename,i){
if(type=="picture"){fotorectangle.currentimageno=fotorectangle.currentimageno+1}
}
function onError(data,url,api,code){
if(data=="picturelist"){
var requestid=url.substring(url.lastIndexOf("=")+1);
Imagejs.dataRequest(login,requestid,db,xhr,fotorectangle);
fotorectangle.currentimageno=fotorectangle.currentimageno+1
} else if (data=="picture"){
Helperjs.deleteData(root.db,"imageData",root.login.username,function(){
fotorectangle.currentimageno=fotorectangle.currentimageno+1
},"link",url)
}else{
fotorectangle.currentimageno=fotorectangle.currentimageno+1}
}
}
// Connections{
// target:filesystem
// onError:{print("Error deleting");
// }
// onSuccess:print("Success deleting");
// }
function showFotos(login,friend){
if(friend=="backButton"){
if (photoStack.depth > 1){photoStack.pop()}
else if(albumgridview.currentItem==null){rootstack.currentIndex=0}
else if(albumgridview.currentItem.state=='fullscreen'){
albumgridview.currentItem.state = 'inGrid'}
else if (albumgridview.currentItem.state == 'inGrid'){albumgridview.currentItem.state=''}
else{rootstack.currentIndex=0}
}
else{
try {photogroupModel.clear()}catch (e){print(e)}
if (friend){
Imagejs.newRequestFriendsAlbumPictures(login,friend,fotorectangle,function(albums,remoteAuthBool){
remoteContact=remoteAuthBool;
var msg = {'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture':true,'friend':friend}
photoWorker.sendMessage(msg);
})
phototabstatusButton.text=friend.screen_name+qsTr("\'s images")
}
else {
Helperjs.readField("album", db, "imageData",login.username,function(albums){
if (albums[0]) {
var msg = { 'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture': false};
photoWorker.sendMessage(msg);
}
})
}
}
}
function deletepics(method, type,id){
if(method=="delete"){Imagejs.deleteImage(db,login,type, id,filesystem,root,function(){//showFotos("")
})}
}
function updatepic(method,type,id){
}
function updatepic(method,type,id){
if(method=="update"){
Helperjs.readData(db,"imageData",login.username,function(url){
photoStack.push(
"qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":[url[0].location+url[0].filename],"imageId":id,"currentAlbum":url[0].album}
photoStack.push(
"qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":[url[0].location+url[0].filename],"imageId":id,"currentAlbum":url[0].album}
)
},"id",id)}
}
function uploadUrls(urls){
photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":urls})
}
BlueButton{
x:mm
y:mm
z:2
visible: !wideScreen
fontColor: Material.secondaryTextColor//"grey"
border.color: "transparent"
text: "\uf0c9"
font.pointSize: osSettings.bigFontSize
onClicked:{
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
}
LeftDrawerLinux{
id:leftDrawer
property var newstabstatus: newstab.newstabstatus
visible: wideScreen&&rootstackView.depth<2
width: visible?osSettings.systemFontSize*15:0
height: root.height-bar.height
}
LeftDrawerAndroid{
id: leftDrawerAndroid
}
ProgressBar{
id: newImagesProgress
width: 15*mm
height: updatePhotolist.height
anchors.top: parent.top
anchors.right:uploadPhoto.left
anchors.rightMargin:mm
visible: false
value: fotorectangle.currentimageno/fotorectangle.newimages.length
}
MButton{
id: uploadPhoto
anchors.top: parent.top
anchors.topMargin: 0.5*mm
anchors.right:updatePhotolist.left
anchors.rightMargin:mm
text:"\uf0ee"
onClicked: {
photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml");
// var component = Qt.createComponent("qrc:/qml/photoqml/ImageUploadDialog.qml");
// var imageUpload = component.createObject(fotorectangle);
}}
MButton{
id: updatePhotolist
anchors.top: parent.top
anchors.topMargin: 0.5*mm
anchors.right:phototabstatusButton.left
anchors.rightMargin:mm
text:"\uf0ed"
Menu {
id:photoupdatemenu
width:8*root.fontFactor*osSettings.bigFontSize
MenuItem {
text: qsTr("All Images")
font.pointSize: osSettings.bigFontSize
onTriggered: {
Imagejs.requestList(root.login,root.db, false, fotostab,function(obj){fotorectangle.newimages=obj})}
}
MenuItem {
text: qsTr("Only new")
font.pointSize: osSettings.bigFontSize
onTriggered: {
Imagejs.requestList(root.login,root.db, true,fotostab,function(obj){fotorectangle.newimages=obj})}
}
},"id",id)}
}
onClicked: {photoupdatemenu.popup()}
}
MButton{
id: phototabstatusButton
anchors.top: parent.top
anchors.topMargin: 0.5*mm
anchors.right: parent.right
anchors.rightMargin:2*mm
width: Math.max(8*root.fontFactor*osSettings.bigFontSize,implicitWidth)
text: fotostab.phototabstatus=="Images"?qsTr("Own Images"):fotostab.phototabstatus
Menu {
id:phototabmenu
width: 20*root.fontFactor*osSettings.bigFontSize
MenuItem {
text: qsTr("Own Images")
font.pointSize: osSettings.bigFontSize
onTriggered: {
fotostab.phototabstatus="Images";
// phototabstatusButton.text=qsTr("Own images");
showFotos(root.login,"")}
}
function uploadUrls(urls){
photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":urls})
}
onClicked: {phototabmenu.popup()}
}
BlueButton{
x:mm
y:mm
z:2
visible: !wideScreen
fontColor: Material.secondaryTextColor//"grey"
border.color: "transparent"
text: "\uf0c9"
font.pointSize: osSettings.bigFontSize
onClicked:{
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
}
DelegateModel{
id: visualphotoModel
delegate: PhotogroupComponent{}
model: photogroupModel
}
LeftDrawerLinux{
id:leftDrawer
property var newstabstatus: newstab.newstabstatus
visible: wideScreen&&rootstackView.depth<2
width: visible?root.fontFactor*osSettings.systemFontSize*15:0
height: root.height-bar.height
}
ListModel{
id: photogroupModel
}
LeftDrawerAndroid{
id: leftDrawerAndroid
}
GridView {
id: albumgridview
cellWidth: 17*mm
cellHeight: 17*mm
x: leftDrawer.width//mm;
y:8*mm
width: wideScreen&&rootstackView.depth<2?parent.width-leftDrawer.width-mm:parent.width-mm //parent.width-2*mm;
height: parent.height-9*mm
clip: true
model: visualphotoModel.parts.album
footer:Rectangle{
border.color: Material.backgroundDimColor//"#EEEEEE"
border.width: 1
width:12*mm
height:6*mm
Text{
font.pointSize: 0.75*osSettings.systemFontSize
anchors.centerIn: parent
text:qsTr("More")
ProgressBar{
id: newImagesProgress
width: 15*mm
height: updatePhotolist.height
anchors.top: parent.top
anchors.right:uploadPhoto.left
anchors.rightMargin:mm
visible: false
value: fotorectangle.currentimageno/fotorectangle.newimages.length
}
MButton{
id: uploadPhoto
anchors.top: parent.top
anchors.topMargin: 0.5*mm
anchors.right:updatePhotolist.left
anchors.rightMargin:mm
text:"\uf0ee"
onClicked: {photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml")}
}
MButton{
id: updatePhotolist
anchors.top: parent.top
anchors.topMargin: 0.5*mm
anchors.right:phototabstatusButton.left
anchors.rightMargin:mm
text:"\uf0ed"
Menu {
id:photoupdatemenu
width:8*root.fontFactor*osSettings.bigFontSize
MenuItem {
text: qsTr("All Images")
font.pointSize: osSettings.bigFontSize
onTriggered: {
Imagejs.requestList(root.login,root.db, false, fotostab,function(obj){fotorectangle.newimages=obj})}
}
MenuItem {
text: qsTr("Only new")
font.pointSize: osSettings.bigFontSize
onTriggered: {
Imagejs.requestList(root.login,root.db, true,fotostab,function(obj){fotorectangle.newimages=obj})}
}
}
MouseArea{anchors.fill:parent
onClicked:{//print(photogroupModel.get(0).foreignPicture);
var lastalbum_id=photogroupModel.count-1;
if(photogroupModel.get(photogroupModel.count-1).foreignPicture==true){
Imagejs.newRequestFriendsAlbumPictures(login,photogroupModel.get(0).friend,fotorectangle,function(albums,remoteAuthBool){
remoteContact=remoteAuthBool;
var msg = {'model': photogroupModel,'albums':albums,'firstalbum':lastalbum_id+1,'foreignPicture':true,'friend':photogroupModel.get(0).friend}
photoWorker.sendMessage(msg)
})
}
else{Helperjs.readField("album",root.db, "imageData",root.login.username,function(albums){
var msg = { 'model': photogroupModel,'albums':albums,'foreignPicture': false,'firstalbum':lastalbum_id+1};
photoWorker.sendMessage(msg)})}
}}}
onClicked: {photoupdatemenu.popup()}
}
MButton{
id: phototabstatusButton
anchors.top: parent.top
anchors.topMargin: 0.5*mm
anchors.right: parent.right
anchors.rightMargin:2*mm
width: Math.max(8*root.fontFactor*osSettings.bigFontSize,implicitWidth)
text: fotostab.phototabstatus=="Images"?qsTr("Own Images"):fotostab.phototabstatus
Menu {
id:phototabmenu
width: 20*root.fontFactor*osSettings.bigFontSize
MenuItem {
text: qsTr("Own Images")
font.pointSize: osSettings.bigFontSize
onTriggered: {
fotostab.phototabstatus="Images";
// phototabstatusButton.text=qsTr("Own images");
showFotos(root.login,"")}
}
}
onClicked: {phototabmenu.popup()}
}
DelegateModel{
id: visualphotoModel
delegate: PhotogroupComponent{}
model: photogroupModel
}
ListModel{
id: photogroupModel
}
GridView {
id: albumgridview
cellWidth: 17*mm
cellHeight: 17*mm
x: leftDrawer.width
y:8*mm
width: wideScreen&&rootstackView.depth<2?parent.width-leftDrawer.width-mm:parent.width-mm
height: parent.height-9*mm
clip: true
model: visualphotoModel.parts.album
footer:Rectangle{
border.color: Material.backgroundDimColor
border.width: 1
color: Material.dialogColor
width:12*mm
height:6*mm
Text{
color: Material.primaryTextColor
font.pointSize: 0.75*osSettings.systemFontSize
anchors.centerIn: parent
text:qsTr("More")
}
MouseArea{anchors.fill:parent
onClicked:{
var lastalbum_id=photogroupModel.count-1;
if(photogroupModel.get(photogroupModel.count-1).foreignPicture==true){
Imagejs.newRequestFriendsAlbumPictures(login,photogroupModel.get(0).friend,fotorectangle,function(albums,remoteAuthBool){
remoteContact=remoteAuthBool;
var msg = {'model': photogroupModel,'albums':albums,'firstalbum':lastalbum_id+1,'foreignPicture':true,'friend':photogroupModel.get(0).friend}
photoWorker.sendMessage(msg)
})
}
else{Helperjs.readField("album",root.db, "imageData",root.login.username,function(albums){
var msg = { 'model': photogroupModel,'albums':albums,'foreignPicture': false,'firstalbum':lastalbum_id+1};
photoWorker.sendMessage(msg)})}
}}}
}
Rectangle { id: photoBackground; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 }
ListView { width: parent.width; height:parent.height; model: visualphotoModel.parts.browser; interactive: false }
MButton {
id: backButton
text: "\uf057"
x: parent.width - backButton.width - root.fontFactor*osSettings.bigFontSize
y: -backButton.height - root.fontFactor*osSettings.bigFontSize
z:2
onClicked: {photoBackground.opacity=0}
}
ListView {anchors.fill: parent; model: visualphotoModel.parts.fullscreen; interactive: false }
WorkerScript{id: photoWorker;source: "qrc:/js/photoworker.js"}
Component.onCompleted: {
root.fotoSignal.connect(showFotos);
root.uploadSignal.connect(uploadUrls);
root.changeimage.connect(deletepics);
root.changeimage.connect(updatepic);
if (fotostab.phototabstatus=="Images"){showFotos(root.login,"")}
}
}
Rectangle { id: photoBackground; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 }
ListView { width: parent.width; height:parent.height; model: visualphotoModel.parts.browser; interactive: false }
MButton {
id: backButton
text: "\uf057"
x: parent.width - backButton.width - root.fontFactor*osSettings.bigFontSize
y: -backButton.height - root.fontFactor*osSettings.bigFontSize
z:2
onClicked: {photoBackground.opacity=0}
}
ListView {anchors.fill: parent; model: visualphotoModel.parts.fullscreen; interactive: false }
WorkerScript{id: photoWorker;source: "qrc:/js/photoworker.js"}
Component.onCompleted: {
root.fotoSignal.connect(showFotos);
root.uploadSignal.connect(uploadUrls);
root.changeimage.connect(deletepics);
root.changeimage.connect(updatepic);
if (fotostab.phototabstatus=="Images"){showFotos(root.login,"")}
}
}
}

View file

@ -80,11 +80,11 @@
<name>CalendarTab</name>
<message>
<source>Events</source>
<translation>Termine</translation>
<translation type="vanished">Termine</translation>
</message>
<message>
<source>Own Calendar</source>
<translation>Eigener Kalender</translation>
<translation type="vanished">Eigener Kalender</translation>
</message>
</context>
<context>
@ -393,7 +393,7 @@
</message>
<message>
<source>Connect</source>
<translation>Kontaktanfrage</translation>
<translation type="vanished">Kontaktanfrage</translation>
</message>
<message>
<source>Approve</source>
@ -440,6 +440,21 @@
<translation>Netzwerk-Fehler</translation>
</message>
</context>
<context>
<name>ContactsSearchPage</name>
<message>
<source>Network Error</source>
<translation>Netzwerk-Fehler</translation>
</message>
<message>
<source>Forum</source>
<translation>Forum</translation>
</message>
<message>
<source>Person</source>
<translation>Person</translation>
</message>
</context>
<context>
<name>Conversation</name>
<message>
@ -596,7 +611,7 @@
<name>EventListItem</name>
<message>
<source>Location</source>
<translation>Ort</translation>
<translation type="vanished">Ort</translation>
</message>
</context>
<context>
@ -912,7 +927,7 @@
</message>
<message>
<source>Reply</source>
<translation>Antworten</translation>
<translation type="vanished">Antworten</translation>
</message>
<message>
<source>DM</source>
@ -950,6 +965,14 @@
<source>Delete</source>
<translation>Löschen</translation>
</message>
<message>
<source>Bookmark</source>
<translation>Markieren</translation>
</message>
<message>
<source>External</source>
<translation>Webseite</translation>
</message>
</context>
<context>
<name>PermissionDialog</name>

View file

@ -4,9 +4,9 @@
<context>
<name>AccountPage</name>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="60"/>
<location filename="../qml/configqml/AccountPage.qml" line="319"/>
<location filename="../qml/configqml/AccountPage.qml" line="341"/>
<location filename="../qml/configqml/AccountPage.qml" line="64"/>
<location filename="../qml/configqml/AccountPage.qml" line="361"/>
<location filename="../qml/configqml/AccountPage.qml" line="382"/>
<source>User</source>
<translation>Usuario</translation>
</message>
@ -15,17 +15,17 @@
<translation type="vanished">Servidor</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="165"/>
<location filename="../qml/configqml/AccountPage.qml" line="206"/>
<source>Nickname</source>
<translation>Usuario</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="183"/>
<location filename="../qml/configqml/AccountPage.qml" line="224"/>
<source>Password</source>
<translation>Contraseña</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="190"/>
<location filename="../qml/configqml/AccountPage.qml" line="231"/>
<source>Image dir.</source>
<translation>Dir. de imágenes</translation>
</message>
@ -34,54 +34,54 @@
<translation type="vanished">Noticias como</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="169"/>
<location filename="../qml/configqml/AccountPage.qml" line="256"/>
<location filename="../qml/configqml/AccountPage.qml" line="288"/>
<location filename="../qml/configqml/AccountPage.qml" line="210"/>
<location filename="../qml/configqml/AccountPage.qml" line="297"/>
<location filename="../qml/configqml/AccountPage.qml" line="330"/>
<source>Error</source>
<translation>Error</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="169"/>
<location filename="../qml/configqml/AccountPage.qml" line="210"/>
<source>Nicknames containing @ symbol currently not supported</source>
<translation>No se admiten los apodos que contienen el símbolo @ actualmente</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="239"/>
<location filename="../qml/configqml/AccountPage.qml" line="280"/>
<source>Confirm</source>
<translation>Confirmar</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="245"/>
<location filename="../qml/configqml/AccountPage.qml" line="286"/>
<source>No server given! </source>
<translation>¡Servidor no encontrado!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="246"/>
<location filename="../qml/configqml/AccountPage.qml" line="287"/>
<source>No nickname given! </source>
<translation>¡Usuario incorrecto!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="247"/>
<location filename="../qml/configqml/AccountPage.qml" line="288"/>
<source>No password given! </source>
<translation>¡Contraseña incorrecta!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="248"/>
<location filename="../qml/configqml/AccountPage.qml" line="289"/>
<source>No image directory given!</source>
<translation>¡No se ha encontrado el directorio de imágenes!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="256"/>
<location filename="../qml/configqml/AccountPage.qml" line="297"/>
<source>Wrong password!</source>
<translation>¡Contraseña incorrecta!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="282"/>
<location filename="../qml/configqml/AccountPage.qml" line="324"/>
<source>Success</source>
<translation>éxito!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="282"/>
<location filename="../qml/configqml/AccountPage.qml" line="324"/>
<source>Name</source>
<translation>Nombre</translation>
</message>
@ -97,14 +97,12 @@
<context>
<name>CalendarTab</name>
<message>
<location filename="../qml/calendarqml/CalendarTab.qml" line="152"/>
<source>Events</source>
<translation>Eventos</translation>
<translation type="vanished">Eventos</translation>
</message>
<message>
<location filename="../qml/calendarqml/CalendarTab.qml" line="157"/>
<source>Own Calendar</source>
<translation>Calendario propio</translation>
<translation type="vanished">Calendario propio</translation>
</message>
</context>
<context>
@ -333,166 +331,183 @@
<context>
<name>ContactPage</name>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="51"/>
<location filename="../qml/newsqml/ContactPage.qml" line="49"/>
<source>seconds</source>
<translation>Segundos</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="52"/>
<location filename="../qml/newsqml/ContactPage.qml" line="50"/>
<source>minute</source>
<translation>Minuto</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="53"/>
<location filename="../qml/newsqml/ContactPage.qml" line="51"/>
<source>minutes</source>
<translation>Minutos</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="54"/>
<location filename="../qml/newsqml/ContactPage.qml" line="52"/>
<source>hour</source>
<translation>Hora</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="55"/>
<location filename="../qml/newsqml/ContactPage.qml" line="53"/>
<source>hours</source>
<translation>Horas</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="56"/>
<location filename="../qml/newsqml/ContactPage.qml" line="54"/>
<source>day</source>
<translation>Dia</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="57"/>
<location filename="../qml/newsqml/ContactPage.qml" line="55"/>
<source>days</source>
<translation>Dias</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="58"/>
<location filename="../qml/newsqml/ContactPage.qml" line="56"/>
<source>month</source>
<translation>Mes</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="59"/>
<location filename="../qml/newsqml/ContactPage.qml" line="57"/>
<source>months</source>
<translation>Meses</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="60"/>
<location filename="../qml/newsqml/ContactPage.qml" line="58"/>
<source>years</source>
<translation>Años</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="69"/>
<location filename="../qml/newsqml/ContactPage.qml" line="67"/>
<source>likes this.</source>
<translation>le gusta esto.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="70"/>
<location filename="../qml/newsqml/ContactPage.qml" line="68"/>
<source>like this.</source>
<translation>me gusta esto.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="73"/>
<location filename="../qml/newsqml/ContactPage.qml" line="71"/>
<source>doesn&apos;t like this.</source>
<translation>no de ése.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="74"/>
<location filename="../qml/newsqml/ContactPage.qml" line="72"/>
<source>don&apos;t like this.</source>
<translation>no me gusta.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="77"/>
<location filename="../qml/newsqml/ContactPage.qml" line="75"/>
<source>will attend.</source>
<translation>asistirá.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="78"/>
<location filename="../qml/newsqml/ContactPage.qml" line="76"/>
<source>persons will attend.</source>
<translation>Personas que asistirán.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="81"/>
<location filename="../qml/newsqml/ContactPage.qml" line="79"/>
<source>will not attend.</source>
<translation>no asistirá.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="82"/>
<location filename="../qml/newsqml/ContactPage.qml" line="80"/>
<source>persons will not attend.</source>
<translation>Personas que no asistirán.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="85"/>
<location filename="../qml/newsqml/ContactPage.qml" line="83"/>
<source>may attend.</source>
<translation>Puede asistir.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="86"/>
<location filename="../qml/newsqml/ContactPage.qml" line="84"/>
<source>persons may attend.</source>
<translation>Personas que pueden asistir.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="151"/>
<source>Connect</source>
<translation>Conectar</translation>
<translation type="vanished">Conectar</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="223"/>
<location filename="../qml/newsqml/ContactPage.qml" line="218"/>
<source>Approve</source>
<translation>Aprobar</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="238"/>
<location filename="../qml/newsqml/ContactPage.qml" line="232"/>
<source>Reject</source>
<translation>Rechazar</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="252"/>
<location filename="../qml/newsqml/ContactPage.qml" line="245"/>
<source>Ignore</source>
<translation>Ignorar</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="266"/>
<location filename="../qml/newsqml/ContactPage.qml" line="258"/>
<source>Follow</source>
<translation>Seguir</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="285"/>
<location filename="../qml/newsqml/ContactPage.qml" line="276"/>
<source>Unfollow</source>
<translation>Dejar de seguir</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="324"/>
<location filename="../qml/newsqml/ContactPage.qml" line="314"/>
<source>Description</source>
<translation>Descripción</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="324"/>
<location filename="../qml/newsqml/ContactPage.qml" line="314"/>
<source>Location</source>
<translation>Localización</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="324"/>
<location filename="../qml/newsqml/ContactPage.qml" line="314"/>
<source>Posts</source>
<translation>Mensajes</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="325"/>
<location filename="../qml/newsqml/ContactPage.qml" line="315"/>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="326"/>
<location filename="../qml/newsqml/ContactPage.qml" line="316"/>
<source>Created at</source>
<translation>Creado en</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="340"/>
<location filename="../qml/newsqml/ContactPage.qml" line="326"/>
<source>Network Error</source>
<translation>Fallo de red</translation>
</message>
</context>
<context>
<name>ContactsSearchPage</name>
<message>
<location filename="../qml/contactqml/ContactsSearchPage.qml" line="62"/>
<source>Network Error</source>
<translation>Fallo de red</translation>
</message>
<message>
<location filename="../qml/contactqml/ContactsSearchPage.qml" line="91"/>
<source>Forum</source>
<translation>Foro</translation>
</message>
<message>
<location filename="../qml/contactqml/ContactsSearchPage.qml" line="93"/>
<source>Person</source>
<translation>Persona</translation>
</message>
</context>
<context>
<name>Conversation</name>
<message>
@ -682,9 +697,8 @@
<context>
<name>EventListItem</name>
<message>
<location filename="../qml/calendarqml/EventListItem.qml" line="80"/>
<source>Location</source>
<translation>Localización</translation>
<translation type="vanished">Localización</translation>
</message>
</context>
<context>
@ -695,7 +709,7 @@
<translation>Solicitudes de contacto</translation>
</message>
<message>
<location filename="../qml/contactqml/FriendsListTab.qml" line="72"/>
<location filename="../qml/contactqml/FriendsListTab.qml" line="71"/>
<source>Friends</source>
<translation>Amigos</translation>
</message>
@ -785,40 +799,40 @@
<context>
<name>MessageSend</name>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="205"/>
<location filename="../qml/newsqml/MessageSend.qml" line="204"/>
<source>to:</source>
<translation>a:</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="217"/>
<location filename="../qml/newsqml/MessageSend.qml" line="216"/>
<source>Title (optional)</source>
<translation>Título (opcional)</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="234"/>
<location filename="../qml/newsqml/MessageSend.qml" line="233"/>
<source> Drop your Content here.</source>
<translation> Deje caer su contenido aquí.</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="240"/>
<location filename="../qml/newsqml/MessageSend.qml" line="239"/>
<source>What&apos;s on your mind?</source>
<translation>¿Qué tienes en mente?</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="387"/>
<location filename="../qml/newsqml/MessageSend.qml" line="446"/>
<location filename="../qml/newsqml/MessageSend.qml" line="388"/>
<location filename="../qml/newsqml/MessageSend.qml" line="447"/>
<source>Error</source>
<translation>Error</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="387"/>
<location filename="../qml/newsqml/MessageSend.qml" line="388"/>
<source>Only one attachment supported at the moment.
Remove other attachment first!</source>
<translation>Solo se admite adjuntar un solo archivo en este momento.
¡Elimine y deje un archivo adjunto!</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="446"/>
<location filename="../qml/newsqml/MessageSend.qml" line="447"/>
<source>No receiver supplied!</source>
<translation>No se ha suministrado ningún receptor!</translation>
</message>
@ -834,12 +848,12 @@
<context>
<name>NewsStack</name>
<message>
<location filename="../qml/newsqml/NewsStack.qml" line="224"/>
<location filename="../qml/newsqml/NewsStack.qml" line="222"/>
<source>Network Error</source>
<translation>Fallo de red</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsStack.qml" line="270"/>
<location filename="../qml/newsqml/NewsStack.qml" line="268"/>
<source>More</source>
<translation>Mas</translation>
</message>
@ -1002,17 +1016,17 @@
<translation type="vanished">Asistiendo: </translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="119"/>
<location filename="../qml/newsqml/Newsitem.qml" line="116"/>
<source>Source: </source>
<translation>Fuente: </translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="119"/>
<location filename="../qml/newsqml/Newsitem.qml" line="116"/>
<source>Direct Message</source>
<translation>Mensaje directo</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="135"/>
<location filename="../qml/newsqml/Newsitem.qml" line="132"/>
<source>In reply to </source>
<translation>En respuesta a </translation>
</message>
@ -1026,75 +1040,86 @@
<translation>asistencia</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="127"/>
<location filename="../qml/newsqml/Newsitem.qml" line="124"/>
<source>ago</source>
<translation>hace</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="277"/>
<location filename="../qml/newsqml/Newsitem.qml" line="269"/>
<source>Attending: </source>
<translation>Asistiendo: </translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="397"/>
<source>Reply</source>
<translation>Respuesta</translation>
<translation type="vanished">Respuesta</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="416"/>
<location filename="../qml/newsqml/Newsitem.qml" line="439"/>
<source>DM</source>
<translation>Mensaje directo</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="422"/>
<location filename="../qml/newsqml/Newsitem.qml" line="425"/>
<source>Repost</source>
<translation>Volver a publicar</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="425"/>
<location filename="../qml/newsqml/Newsitem.qml" line="428"/>
<source>Success!</source>
<translation>éxito!</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="430"/>
<location filename="../qml/newsqml/Newsitem.qml" line="433"/>
<source>Conversation</source>
<translation>Conversación</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="437"/>
<location filename="../qml/newsqml/Newsitem.qml" line="445"/>
<source>Bookmark</source>
<translation>marca</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="454"/>
<source>Attending</source>
<translation>Asistiendo</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="447"/>
<location filename="../qml/newsqml/Newsitem.qml" line="464"/>
<source>yes</source>
<translation>si</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="452"/>
<location filename="../qml/newsqml/Newsitem.qml" line="469"/>
<source>maybe</source>
<translation>quizás</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="457"/>
<location filename="../qml/newsqml/Newsitem.qml" line="474"/>
<source>no</source>
<translation>no</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="464"/>
<location filename="../qml/newsqml/Newsitem.qml" line="481"/>
<source>Delete</source>
<translation>Borrar</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="497"/>
<source>External</source>
<translation>sitio web</translation>
</message>
</context>
<context>
<name>PermissionDialog</name>
<message>
<location filename="../qml/genericqml/PermissionDialog.qml" line="69"/>
<location filename="../qml/genericqml/PermissionDialog.qml" line="70"/>
<location filename="../qml/newsqml/PermissionDialog.qml" line="67"/>
<source>Friends</source>
<translation>Amigos</translation>
</message>
<message>
<location filename="../qml/genericqml/PermissionDialog.qml" line="131"/>
<location filename="../qml/genericqml/PermissionDialog.qml" line="132"/>
<location filename="../qml/newsqml/PermissionDialog.qml" line="130"/>
<source>Groups</source>
<translation>Grupos</translation>
</message>
@ -1102,28 +1127,28 @@
<context>
<name>PhotoTab</name>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="137"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="133"/>
<source>&apos;s images</source>
<translation>s Imágenes</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="229"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="222"/>
<source>All Images</source>
<translation>Todas las imagenes</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="235"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="228"/>
<source>Only new</source>
<translation>Solo nueva</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="251"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="256"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="244"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="249"/>
<source>Own Images</source>
<translation>Mis imágenes</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="296"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="291"/>
<source>More</source>
<translation>Mas</translation>
</message>
@ -1447,14 +1472,14 @@
<translation type="vanished">Salida</translation>
</message>
<message>
<location filename="../qml/friendiqa.qml" line="175"/>
<location filename="../qml/friendiqa.qml" line="176"/>
<source>Background Sync
Rightclick or Middleclick to Quit</source>
<translation>Sincronización de fondo
Haga clic con el botón derecho del ratón o con el botón central para salir.</translation>
</message>
<message>
<location filename="../qml/friendiqa.qml" line="300"/>
<location filename="../qml/friendiqa.qml" line="302"/>
<source>Click to open Friendiqa</source>
<translation>Haga clic para abrir Friendiqa</translation>
</message>
@ -1572,12 +1597,12 @@ Haga clic con el botón derecho del ratón o con el botón central para salir.</
<translation type="vanished">La configuración del tipo de vista de las noticias se ha movido de la página de la cuenta a la página de configuración.</translation>
</message>
<message>
<location filename="../js/service.js" line="463"/>
<location filename="../js/service.js" line="460"/>
<source>Undefined Array Error</source>
<translation></translation>
</message>
<message>
<location filename="../js/service.js" line="466"/>
<location filename="../js/service.js" line="463"/>
<source>JSON status Error</source>
<translation></translation>
</message>

View file

@ -4,9 +4,9 @@
<context>
<name>AccountPage</name>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="60"/>
<location filename="../qml/configqml/AccountPage.qml" line="319"/>
<location filename="../qml/configqml/AccountPage.qml" line="341"/>
<location filename="../qml/configqml/AccountPage.qml" line="64"/>
<location filename="../qml/configqml/AccountPage.qml" line="361"/>
<location filename="../qml/configqml/AccountPage.qml" line="382"/>
<source>User</source>
<translation>Felhasználó</translation>
</message>
@ -15,17 +15,17 @@
<translation type="vanished">Kiszolgáló</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="165"/>
<location filename="../qml/configqml/AccountPage.qml" line="206"/>
<source>Nickname</source>
<translation>Becenév</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="183"/>
<location filename="../qml/configqml/AccountPage.qml" line="224"/>
<source>Password</source>
<translation>Jelszó</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="190"/>
<location filename="../qml/configqml/AccountPage.qml" line="231"/>
<source>Image dir.</source>
<translation>Képkönyvtár</translation>
</message>
@ -34,54 +34,54 @@
<translation type="vanished">Hírek mint</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="169"/>
<location filename="../qml/configqml/AccountPage.qml" line="256"/>
<location filename="../qml/configqml/AccountPage.qml" line="288"/>
<location filename="../qml/configqml/AccountPage.qml" line="210"/>
<location filename="../qml/configqml/AccountPage.qml" line="297"/>
<location filename="../qml/configqml/AccountPage.qml" line="330"/>
<source>Error</source>
<translation>Hiba</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="169"/>
<location filename="../qml/configqml/AccountPage.qml" line="210"/>
<source>Nicknames containing @ symbol currently not supported</source>
<translation>A @ szimbólumot tartalmazó becenevek jelenleg nem támogatottak</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="239"/>
<location filename="../qml/configqml/AccountPage.qml" line="280"/>
<source>Confirm</source>
<translation>Megerősítés</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="245"/>
<location filename="../qml/configqml/AccountPage.qml" line="286"/>
<source>No server given! </source>
<translation>Nincs kiszolgáló megadva! </translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="246"/>
<location filename="../qml/configqml/AccountPage.qml" line="287"/>
<source>No nickname given! </source>
<translation>Nincs becenév megadva! </translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="247"/>
<location filename="../qml/configqml/AccountPage.qml" line="288"/>
<source>No password given! </source>
<translation>Nincs jelszó megadva! </translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="248"/>
<location filename="../qml/configqml/AccountPage.qml" line="289"/>
<source>No image directory given!</source>
<translation>Nincs képkönyvtár megadva!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="256"/>
<location filename="../qml/configqml/AccountPage.qml" line="297"/>
<source>Wrong password!</source>
<translation>Hibás jelszó!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="282"/>
<location filename="../qml/configqml/AccountPage.qml" line="324"/>
<source>Success</source>
<translation>Sikeres</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="282"/>
<location filename="../qml/configqml/AccountPage.qml" line="324"/>
<source>Name</source>
<translation>Név</translation>
</message>
@ -97,14 +97,12 @@
<context>
<name>CalendarTab</name>
<message>
<location filename="../qml/calendarqml/CalendarTab.qml" line="152"/>
<source>Events</source>
<translation>Események</translation>
<translation type="vanished">Események</translation>
</message>
<message>
<location filename="../qml/calendarqml/CalendarTab.qml" line="157"/>
<source>Own Calendar</source>
<translation>Saját naptár</translation>
<translation type="vanished">Saját naptár</translation>
</message>
</context>
<context>
@ -140,22 +138,22 @@
<message>
<location filename="../qml/configqml/ConfigAppearancePage.qml" line="159"/>
<source>Dark Mode</source>
<translation>Tervezés</translation>
<translation>Sötét mód</translation>
</message>
<message>
<location filename="../qml/configqml/ConfigAppearancePage.qml" line="163"/>
<source>System</source>
<translation>Szabványos kivitel</translation>
<translation>Rendszer</translation>
</message>
<message>
<location filename="../qml/configqml/ConfigAppearancePage.qml" line="174"/>
<source>Dark</source>
<translation>Sötét design</translation>
<translation>Sötét</translation>
</message>
<message>
<location filename="../qml/configqml/ConfigAppearancePage.qml" line="185"/>
<source>Light</source>
<translation>Fényes design</translation>
<translation>Világos</translation>
</message>
</context>
<context>
@ -193,7 +191,7 @@
<message>
<location filename="../qml/configqml/ConfigPage.qml" line="67"/>
<source>Start</source>
<translation>Indítsd el</translation>
<translation>Indítás</translation>
</message>
</context>
<context>
@ -349,166 +347,183 @@
<context>
<name>ContactPage</name>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="51"/>
<location filename="../qml/newsqml/ContactPage.qml" line="49"/>
<source>seconds</source>
<translation>másodperc</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="52"/>
<location filename="../qml/newsqml/ContactPage.qml" line="50"/>
<source>minute</source>
<translation>perc</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="53"/>
<location filename="../qml/newsqml/ContactPage.qml" line="51"/>
<source>minutes</source>
<translation>perc</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="54"/>
<location filename="../qml/newsqml/ContactPage.qml" line="52"/>
<source>hour</source>
<translation>óra</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="55"/>
<location filename="../qml/newsqml/ContactPage.qml" line="53"/>
<source>hours</source>
<translation>óra</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="56"/>
<location filename="../qml/newsqml/ContactPage.qml" line="54"/>
<source>day</source>
<translation>nap</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="57"/>
<location filename="../qml/newsqml/ContactPage.qml" line="55"/>
<source>days</source>
<translation>nap</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="58"/>
<location filename="../qml/newsqml/ContactPage.qml" line="56"/>
<source>month</source>
<translation>hónap</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="59"/>
<location filename="../qml/newsqml/ContactPage.qml" line="57"/>
<source>months</source>
<translation>hónap</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="60"/>
<location filename="../qml/newsqml/ContactPage.qml" line="58"/>
<source>years</source>
<translation>év</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="69"/>
<location filename="../qml/newsqml/ContactPage.qml" line="67"/>
<source>likes this.</source>
<translation>kedveli ezt.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="70"/>
<location filename="../qml/newsqml/ContactPage.qml" line="68"/>
<source>like this.</source>
<translation>kedveli ezt.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="73"/>
<location filename="../qml/newsqml/ContactPage.qml" line="71"/>
<source>doesn&apos;t like this.</source>
<translation>nem kedveli ezt.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="74"/>
<location filename="../qml/newsqml/ContactPage.qml" line="72"/>
<source>don&apos;t like this.</source>
<translation>nem kedveli ezt.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="77"/>
<location filename="../qml/newsqml/ContactPage.qml" line="75"/>
<source>will attend.</source>
<translation>részt vesz.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="78"/>
<location filename="../qml/newsqml/ContactPage.qml" line="76"/>
<source>persons will attend.</source>
<translation>személy részt vesz.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="81"/>
<location filename="../qml/newsqml/ContactPage.qml" line="79"/>
<source>will not attend.</source>
<translation>nem vesz részt.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="82"/>
<location filename="../qml/newsqml/ContactPage.qml" line="80"/>
<source>persons will not attend.</source>
<translation>személy nem vesz részt.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="85"/>
<location filename="../qml/newsqml/ContactPage.qml" line="83"/>
<source>may attend.</source>
<translation>talán részt vesz.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="86"/>
<location filename="../qml/newsqml/ContactPage.qml" line="84"/>
<source>persons may attend.</source>
<translation>személy talán részt vesz.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="151"/>
<source>Connect</source>
<translation>Kapcsolódás</translation>
<translation type="vanished">Kapcsolódás</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="223"/>
<location filename="../qml/newsqml/ContactPage.qml" line="218"/>
<source>Approve</source>
<translation>Jóváhagyás</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="238"/>
<location filename="../qml/newsqml/ContactPage.qml" line="232"/>
<source>Reject</source>
<translation>Visszautasítás</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="252"/>
<location filename="../qml/newsqml/ContactPage.qml" line="245"/>
<source>Ignore</source>
<translation>Mellőzés</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="266"/>
<location filename="../qml/newsqml/ContactPage.qml" line="258"/>
<source>Follow</source>
<translation>Kövesse</translation>
<translation>Követés</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="285"/>
<location filename="../qml/newsqml/ContactPage.qml" line="276"/>
<source>Unfollow</source>
<translation>Követés megszüntetése</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="324"/>
<location filename="../qml/newsqml/ContactPage.qml" line="314"/>
<source>Description</source>
<translation>Leírás</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="324"/>
<location filename="../qml/newsqml/ContactPage.qml" line="314"/>
<source>Location</source>
<translation>Hely</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="324"/>
<location filename="../qml/newsqml/ContactPage.qml" line="314"/>
<source>Posts</source>
<translation>Bejegyzések</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="325"/>
<location filename="../qml/newsqml/ContactPage.qml" line="315"/>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="326"/>
<location filename="../qml/newsqml/ContactPage.qml" line="316"/>
<source>Created at</source>
<translation>Létrehozva</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="340"/>
<location filename="../qml/newsqml/ContactPage.qml" line="326"/>
<source>Network Error</source>
<translation>Hálózati hiba</translation>
</message>
</context>
<context>
<name>ContactsSearchPage</name>
<message>
<location filename="../qml/contactqml/ContactsSearchPage.qml" line="62"/>
<source>Network Error</source>
<translation>Hálózati hiba</translation>
</message>
<message>
<location filename="../qml/contactqml/ContactsSearchPage.qml" line="91"/>
<source>Forum</source>
<translation>fórum</translation>
</message>
<message>
<location filename="../qml/contactqml/ContactsSearchPage.qml" line="93"/>
<source>Person</source>
<translation>személy</translation>
</message>
</context>
<context>
<name>Conversation</name>
<message>
@ -698,9 +713,8 @@
<context>
<name>EventListItem</name>
<message>
<location filename="../qml/calendarqml/EventListItem.qml" line="80"/>
<source>Location</source>
<translation>Hely</translation>
<translation type="vanished">Hely</translation>
</message>
</context>
<context>
@ -711,7 +725,7 @@
<translation>Barátkérések</translation>
</message>
<message>
<location filename="../qml/contactqml/FriendsListTab.qml" line="72"/>
<location filename="../qml/contactqml/FriendsListTab.qml" line="71"/>
<source>Friends</source>
<translation>Ismerősök</translation>
</message>
@ -812,40 +826,40 @@
<context>
<name>MessageSend</name>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="205"/>
<location filename="../qml/newsqml/MessageSend.qml" line="204"/>
<source>to:</source>
<translation>címzett:</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="217"/>
<location filename="../qml/newsqml/MessageSend.qml" line="216"/>
<source>Title (optional)</source>
<translation>Cím (elhagyható)</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="234"/>
<location filename="../qml/newsqml/MessageSend.qml" line="233"/>
<source> Drop your Content here.</source>
<translation> Ejtse ide a tartalmat.</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="240"/>
<location filename="../qml/newsqml/MessageSend.qml" line="239"/>
<source>What&apos;s on your mind?</source>
<translation>Mire gondol?</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="387"/>
<location filename="../qml/newsqml/MessageSend.qml" line="446"/>
<location filename="../qml/newsqml/MessageSend.qml" line="388"/>
<location filename="../qml/newsqml/MessageSend.qml" line="447"/>
<source>Error</source>
<translation>Hiba</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="387"/>
<location filename="../qml/newsqml/MessageSend.qml" line="388"/>
<source>Only one attachment supported at the moment.
Remove other attachment first!</source>
<translation>Csak egyetlen melléklet támogatott jelenleg.
Először távolítsa el a másik mellékletet.</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="446"/>
<location filename="../qml/newsqml/MessageSend.qml" line="447"/>
<source>No receiver supplied!</source>
<translation>Nincs fogadó megadva!</translation>
</message>
@ -861,12 +875,12 @@
<context>
<name>NewsStack</name>
<message>
<location filename="../qml/newsqml/NewsStack.qml" line="224"/>
<location filename="../qml/newsqml/NewsStack.qml" line="222"/>
<source>Network Error</source>
<translation>Hálózati hiba</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsStack.qml" line="270"/>
<location filename="../qml/newsqml/NewsStack.qml" line="268"/>
<source>More</source>
<translation>Több</translation>
</message>
@ -1033,17 +1047,17 @@
<translation type="vanished">részvétel: </translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="119"/>
<location filename="../qml/newsqml/Newsitem.qml" line="116"/>
<source>Source: </source>
<translation>Forrás: </translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="119"/>
<location filename="../qml/newsqml/Newsitem.qml" line="116"/>
<source>Direct Message</source>
<translation>Közvetlen üzenet</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="135"/>
<location filename="../qml/newsqml/Newsitem.qml" line="132"/>
<source>In reply to </source>
<translation>Válaszul erre: </translation>
</message>
@ -1057,75 +1071,86 @@
<translation>részvétel</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="127"/>
<location filename="../qml/newsqml/Newsitem.qml" line="124"/>
<source>ago</source>
<translation>óta</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="277"/>
<location filename="../qml/newsqml/Newsitem.qml" line="269"/>
<source>Attending: </source>
<translation>Részvétel: </translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="397"/>
<source>Reply</source>
<translation>Válasz</translation>
<translation type="vanished">Válasz</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="416"/>
<location filename="../qml/newsqml/Newsitem.qml" line="439"/>
<source>DM</source>
<translation>DM</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="422"/>
<location filename="../qml/newsqml/Newsitem.qml" line="425"/>
<source>Repost</source>
<translation>Újraküldés</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="425"/>
<location filename="../qml/newsqml/Newsitem.qml" line="428"/>
<source>Success!</source>
<translation>Sikeres!</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="430"/>
<location filename="../qml/newsqml/Newsitem.qml" line="433"/>
<source>Conversation</source>
<translation>Beszélgetés</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="437"/>
<location filename="../qml/newsqml/Newsitem.qml" line="445"/>
<source>Bookmark</source>
<translation>könyvjelző</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="454"/>
<source>Attending</source>
<translation>Részvétel</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="447"/>
<location filename="../qml/newsqml/Newsitem.qml" line="464"/>
<source>yes</source>
<translation>igen</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="452"/>
<location filename="../qml/newsqml/Newsitem.qml" line="469"/>
<source>maybe</source>
<translation>talán</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="457"/>
<location filename="../qml/newsqml/Newsitem.qml" line="474"/>
<source>no</source>
<translation>nem</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="464"/>
<location filename="../qml/newsqml/Newsitem.qml" line="481"/>
<source>Delete</source>
<translation>Törlés</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="497"/>
<source>External</source>
<translation>weboldal</translation>
</message>
</context>
<context>
<name>PermissionDialog</name>
<message>
<location filename="../qml/genericqml/PermissionDialog.qml" line="69"/>
<location filename="../qml/genericqml/PermissionDialog.qml" line="70"/>
<location filename="../qml/newsqml/PermissionDialog.qml" line="67"/>
<source>Friends</source>
<translation>Ismerősök</translation>
</message>
<message>
<location filename="../qml/genericqml/PermissionDialog.qml" line="131"/>
<location filename="../qml/genericqml/PermissionDialog.qml" line="132"/>
<location filename="../qml/newsqml/PermissionDialog.qml" line="130"/>
<source>Groups</source>
<translation>Csoportok</translation>
</message>
@ -1133,28 +1158,28 @@
<context>
<name>PhotoTab</name>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="137"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="133"/>
<source>&apos;s images</source>
<translation> képei</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="229"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="222"/>
<source>All Images</source>
<translation>Összes kép</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="235"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="228"/>
<source>Only new</source>
<translation>Csak újak</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="251"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="256"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="244"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="249"/>
<source>Own Images</source>
<translation>Saját képek</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="296"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="291"/>
<source>More</source>
<translation>Több</translation>
</message>
@ -1478,14 +1503,14 @@
<translation type="vanished">Kilépés</translation>
</message>
<message>
<location filename="../qml/friendiqa.qml" line="175"/>
<location filename="../qml/friendiqa.qml" line="176"/>
<source>Background Sync
Rightclick or Middleclick to Quit</source>
<translation>Háttérszinkronizálás
Kilépéshez kattintson a jobb gombbal vagy középső gombbal</translation>
</message>
<message>
<location filename="../qml/friendiqa.qml" line="300"/>
<location filename="../qml/friendiqa.qml" line="302"/>
<source>Click to open Friendiqa</source>
<translation>Kattintson a Friendiqa megnyitásához</translation>
</message>
@ -1603,12 +1628,12 @@ Kilépéshez kattintson a jobb gombbal vagy középső gombbal</translation>
<translation type="vanished">A hírek nézettípusának beállítása át lett helyezve a fiókoldalról a beállítási oldalra.</translation>
</message>
<message>
<location filename="../js/service.js" line="463"/>
<location filename="../js/service.js" line="460"/>
<source>Undefined Array Error</source>
<translation>Meghatározatlan tömbhiba</translation>
</message>
<message>
<location filename="../js/service.js" line="466"/>
<location filename="../js/service.js" line="463"/>
<source>JSON status Error</source>
<translation>JSON-állapothiba</translation>
</message>

View file

@ -4,9 +4,9 @@
<context>
<name>AccountPage</name>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="60"/>
<location filename="../qml/configqml/AccountPage.qml" line="319"/>
<location filename="../qml/configqml/AccountPage.qml" line="341"/>
<location filename="../qml/configqml/AccountPage.qml" line="64"/>
<location filename="../qml/configqml/AccountPage.qml" line="361"/>
<location filename="../qml/configqml/AccountPage.qml" line="382"/>
<source>User</source>
<translation>Utente</translation>
</message>
@ -15,17 +15,17 @@
<translation type="vanished">Server</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="165"/>
<location filename="../qml/configqml/AccountPage.qml" line="206"/>
<source>Nickname</source>
<translation>Utente</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="183"/>
<location filename="../qml/configqml/AccountPage.qml" line="224"/>
<source>Password</source>
<translation>Password</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="190"/>
<location filename="../qml/configqml/AccountPage.qml" line="231"/>
<source>Image dir.</source>
<translation>Directory immagini</translation>
</message>
@ -34,54 +34,54 @@
<translation type="vanished">News come</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="169"/>
<location filename="../qml/configqml/AccountPage.qml" line="256"/>
<location filename="../qml/configqml/AccountPage.qml" line="288"/>
<location filename="../qml/configqml/AccountPage.qml" line="210"/>
<location filename="../qml/configqml/AccountPage.qml" line="297"/>
<location filename="../qml/configqml/AccountPage.qml" line="330"/>
<source>Error</source>
<translation>Errore</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="169"/>
<location filename="../qml/configqml/AccountPage.qml" line="210"/>
<source>Nicknames containing @ symbol currently not supported</source>
<translation>I soprannomi contenenti il simbolo @ attualmente non sono supportati</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="239"/>
<location filename="../qml/configqml/AccountPage.qml" line="280"/>
<source>Confirm</source>
<translation>Conferma</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="245"/>
<location filename="../qml/configqml/AccountPage.qml" line="286"/>
<source>No server given! </source>
<translation>Nessun server inserito!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="246"/>
<location filename="../qml/configqml/AccountPage.qml" line="287"/>
<source>No nickname given! </source>
<translation>Nessun utente inserito!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="247"/>
<location filename="../qml/configqml/AccountPage.qml" line="288"/>
<source>No password given! </source>
<translation>Nessuna password inserita!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="248"/>
<location filename="../qml/configqml/AccountPage.qml" line="289"/>
<source>No image directory given!</source>
<translation>Nessuna directory immagini inserita!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="256"/>
<location filename="../qml/configqml/AccountPage.qml" line="297"/>
<source>Wrong password!</source>
<translation>Password sbagliata!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="282"/>
<location filename="../qml/configqml/AccountPage.qml" line="324"/>
<source>Success</source>
<translation>Ha funzionato!</translation>
</message>
<message>
<location filename="../qml/configqml/AccountPage.qml" line="282"/>
<location filename="../qml/configqml/AccountPage.qml" line="324"/>
<source>Name</source>
<translation>Nome</translation>
</message>
@ -97,14 +97,12 @@
<context>
<name>CalendarTab</name>
<message>
<location filename="../qml/calendarqml/CalendarTab.qml" line="152"/>
<source>Events</source>
<translation>Eventi</translation>
<translation type="vanished">Eventi</translation>
</message>
<message>
<location filename="../qml/calendarqml/CalendarTab.qml" line="157"/>
<source>Own Calendar</source>
<translation>Calendario</translation>
<translation type="vanished">Calendario</translation>
</message>
</context>
<context>
@ -321,166 +319,183 @@
<context>
<name>ContactPage</name>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="51"/>
<location filename="../qml/newsqml/ContactPage.qml" line="49"/>
<source>seconds</source>
<translation>secondi</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="52"/>
<location filename="../qml/newsqml/ContactPage.qml" line="50"/>
<source>minute</source>
<translation>minuti</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="53"/>
<location filename="../qml/newsqml/ContactPage.qml" line="51"/>
<source>minutes</source>
<translation>minuti</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="54"/>
<location filename="../qml/newsqml/ContactPage.qml" line="52"/>
<source>hour</source>
<translation>ora</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="55"/>
<location filename="../qml/newsqml/ContactPage.qml" line="53"/>
<source>hours</source>
<translation>ore</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="56"/>
<location filename="../qml/newsqml/ContactPage.qml" line="54"/>
<source>day</source>
<translation>giorno</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="57"/>
<location filename="../qml/newsqml/ContactPage.qml" line="55"/>
<source>days</source>
<translation>giorni</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="58"/>
<location filename="../qml/newsqml/ContactPage.qml" line="56"/>
<source>month</source>
<translation>mese</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="59"/>
<location filename="../qml/newsqml/ContactPage.qml" line="57"/>
<source>months</source>
<translation>mesi</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="60"/>
<location filename="../qml/newsqml/ContactPage.qml" line="58"/>
<source>years</source>
<translation>anni</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="69"/>
<location filename="../qml/newsqml/ContactPage.qml" line="67"/>
<source>likes this.</source>
<translation>mi piace.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="70"/>
<location filename="../qml/newsqml/ContactPage.qml" line="68"/>
<source>like this.</source>
<translation>mi piace.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="73"/>
<location filename="../qml/newsqml/ContactPage.qml" line="71"/>
<source>doesn&apos;t like this.</source>
<translation>non mi piace.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="74"/>
<location filename="../qml/newsqml/ContactPage.qml" line="72"/>
<source>don&apos;t like this.</source>
<translation>non mi piace.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="77"/>
<location filename="../qml/newsqml/ContactPage.qml" line="75"/>
<source>will attend.</source>
<translation>attendere.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="78"/>
<location filename="../qml/newsqml/ContactPage.qml" line="76"/>
<source>persons will attend.</source>
<translation>Persone che attendono.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="81"/>
<location filename="../qml/newsqml/ContactPage.qml" line="79"/>
<source>will not attend.</source>
<translation>non aspettare.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="82"/>
<location filename="../qml/newsqml/ContactPage.qml" line="80"/>
<source>persons will not attend.</source>
<translation>Persone che non aspettano.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="85"/>
<location filename="../qml/newsqml/ContactPage.qml" line="83"/>
<source>may attend.</source>
<translation>puoi attendere.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="86"/>
<location filename="../qml/newsqml/ContactPage.qml" line="84"/>
<source>persons may attend.</source>
<translation>Persone che possono attendere.</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="151"/>
<source>Connect</source>
<translation>Connetti</translation>
<translation type="vanished">Connetti</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="223"/>
<location filename="../qml/newsqml/ContactPage.qml" line="218"/>
<source>Approve</source>
<translation>Approvare</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="238"/>
<location filename="../qml/newsqml/ContactPage.qml" line="232"/>
<source>Reject</source>
<translation>Rifiutare</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="252"/>
<location filename="../qml/newsqml/ContactPage.qml" line="245"/>
<source>Ignore</source>
<translation>Ignorare</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="266"/>
<location filename="../qml/newsqml/ContactPage.qml" line="258"/>
<source>Follow</source>
<translation>Seguire</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="285"/>
<location filename="../qml/newsqml/ContactPage.qml" line="276"/>
<source>Unfollow</source>
<translation>Non seguire</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="324"/>
<location filename="../qml/newsqml/ContactPage.qml" line="314"/>
<source>Description</source>
<translation>Descrizione</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="324"/>
<location filename="../qml/newsqml/ContactPage.qml" line="314"/>
<source>Location</source>
<translation>Località</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="324"/>
<location filename="../qml/newsqml/ContactPage.qml" line="314"/>
<source>Posts</source>
<translation>Messaggi</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="325"/>
<location filename="../qml/newsqml/ContactPage.qml" line="315"/>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="326"/>
<location filename="../qml/newsqml/ContactPage.qml" line="316"/>
<source>Created at</source>
<translation>Creato il</translation>
</message>
<message>
<location filename="../qml/newsqml/ContactPage.qml" line="340"/>
<location filename="../qml/newsqml/ContactPage.qml" line="326"/>
<source>Network Error</source>
<translation>Errore di rete</translation>
</message>
</context>
<context>
<name>ContactsSearchPage</name>
<message>
<location filename="../qml/contactqml/ContactsSearchPage.qml" line="62"/>
<source>Network Error</source>
<translation>Errore di rete</translation>
</message>
<message>
<location filename="../qml/contactqml/ContactsSearchPage.qml" line="91"/>
<source>Forum</source>
<translation>Forum</translation>
</message>
<message>
<location filename="../qml/contactqml/ContactsSearchPage.qml" line="93"/>
<source>Person</source>
<translation>Persona</translation>
</message>
</context>
<context>
<name>Conversation</name>
<message>
@ -670,9 +685,8 @@
<context>
<name>EventListItem</name>
<message>
<location filename="../qml/calendarqml/EventListItem.qml" line="80"/>
<source>Location</source>
<translation>Località</translation>
<translation type="vanished">Località</translation>
</message>
</context>
<context>
@ -683,7 +697,7 @@
<translation>Richieste di contatto</translation>
</message>
<message>
<location filename="../qml/contactqml/FriendsListTab.qml" line="72"/>
<location filename="../qml/contactqml/FriendsListTab.qml" line="71"/>
<source>Friends</source>
<translation>Amici</translation>
</message>
@ -773,40 +787,40 @@
<context>
<name>MessageSend</name>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="205"/>
<location filename="../qml/newsqml/MessageSend.qml" line="204"/>
<source>to:</source>
<translation>a:</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="217"/>
<location filename="../qml/newsqml/MessageSend.qml" line="216"/>
<source>Title (optional)</source>
<translation>Titolo (opzionale)</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="234"/>
<location filename="../qml/newsqml/MessageSend.qml" line="233"/>
<source> Drop your Content here.</source>
<translation> Lascia qui il tuo contenuto.</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="240"/>
<location filename="../qml/newsqml/MessageSend.qml" line="239"/>
<source>What&apos;s on your mind?</source>
<translation>A cosa stai pensando?</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="387"/>
<location filename="../qml/newsqml/MessageSend.qml" line="446"/>
<location filename="../qml/newsqml/MessageSend.qml" line="388"/>
<location filename="../qml/newsqml/MessageSend.qml" line="447"/>
<source>Error</source>
<translation>Errore</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="387"/>
<location filename="../qml/newsqml/MessageSend.qml" line="388"/>
<source>Only one attachment supported at the moment.
Remove other attachment first!</source>
<translation>Solo un allegato è attualmente supportato.
Rimuovere prima gli altri allegati!</translation>
</message>
<message>
<location filename="../qml/newsqml/MessageSend.qml" line="446"/>
<location filename="../qml/newsqml/MessageSend.qml" line="447"/>
<source>No receiver supplied!</source>
<translation>Nessun ricevitore in dotazione!</translation>
</message>
@ -822,12 +836,12 @@
<context>
<name>NewsStack</name>
<message>
<location filename="../qml/newsqml/NewsStack.qml" line="224"/>
<location filename="../qml/newsqml/NewsStack.qml" line="222"/>
<source>Network Error</source>
<translation>Errore di rete</translation>
</message>
<message>
<location filename="../qml/newsqml/NewsStack.qml" line="270"/>
<location filename="../qml/newsqml/NewsStack.qml" line="268"/>
<source>More</source>
<translation>Ancora</translation>
</message>
@ -978,17 +992,17 @@
<translation type="vanished">attendere: </translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="119"/>
<location filename="../qml/newsqml/Newsitem.qml" line="116"/>
<source>Source: </source>
<translation>Codice: </translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="119"/>
<location filename="../qml/newsqml/Newsitem.qml" line="116"/>
<source>Direct Message</source>
<translation>Messaggio diretto</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="135"/>
<location filename="../qml/newsqml/Newsitem.qml" line="132"/>
<source>In reply to </source>
<translation>In risposta a </translation>
</message>
@ -1002,75 +1016,86 @@
<translation>partecipare</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="127"/>
<location filename="../qml/newsqml/Newsitem.qml" line="124"/>
<source>ago</source>
<translation>fa</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="277"/>
<location filename="../qml/newsqml/Newsitem.qml" line="269"/>
<source>Attending: </source>
<translation>Attendi: </translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="397"/>
<source>Reply</source>
<translation>Risposta</translation>
<translation type="vanished">Risposta</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="416"/>
<location filename="../qml/newsqml/Newsitem.qml" line="439"/>
<source>DM</source>
<translation>Messaggio diretto</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="422"/>
<location filename="../qml/newsqml/Newsitem.qml" line="425"/>
<source>Repost</source>
<translation>Condividi</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="425"/>
<location filename="../qml/newsqml/Newsitem.qml" line="428"/>
<source>Success!</source>
<translation>Ha funzionato!</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="430"/>
<location filename="../qml/newsqml/Newsitem.qml" line="433"/>
<source>Conversation</source>
<translation>Conversazione</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="437"/>
<location filename="../qml/newsqml/Newsitem.qml" line="445"/>
<source>Bookmark</source>
<translation>Segnalibro</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="454"/>
<source>Attending</source>
<translation>Attendi</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="447"/>
<location filename="../qml/newsqml/Newsitem.qml" line="464"/>
<source>yes</source>
<translation>si</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="452"/>
<location filename="../qml/newsqml/Newsitem.qml" line="469"/>
<source>maybe</source>
<translation>potrebbe</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="457"/>
<location filename="../qml/newsqml/Newsitem.qml" line="474"/>
<source>no</source>
<translation>no</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="464"/>
<location filename="../qml/newsqml/Newsitem.qml" line="481"/>
<source>Delete</source>
<translation>Cancella</translation>
</message>
<message>
<location filename="../qml/newsqml/Newsitem.qml" line="497"/>
<source>External</source>
<translation>Sito web</translation>
</message>
</context>
<context>
<name>PermissionDialog</name>
<message>
<location filename="../qml/genericqml/PermissionDialog.qml" line="69"/>
<location filename="../qml/genericqml/PermissionDialog.qml" line="70"/>
<location filename="../qml/newsqml/PermissionDialog.qml" line="67"/>
<source>Friends</source>
<translation>Amici</translation>
</message>
<message>
<location filename="../qml/genericqml/PermissionDialog.qml" line="131"/>
<location filename="../qml/genericqml/PermissionDialog.qml" line="132"/>
<location filename="../qml/newsqml/PermissionDialog.qml" line="130"/>
<source>Groups</source>
<translation>Gruppi</translation>
</message>
@ -1078,28 +1103,28 @@
<context>
<name>PhotoTab</name>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="137"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="133"/>
<source>&apos;s images</source>
<translation> Immagini</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="229"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="222"/>
<source>All Images</source>
<translation>Tutte immagini</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="235"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="228"/>
<source>Only new</source>
<translation>Solo nuovo</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="251"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="256"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="244"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="249"/>
<source>Own Images</source>
<translation>Mie immagini</translation>
</message>
<message>
<location filename="../qml/photoqml/PhotoTab.qml" line="296"/>
<location filename="../qml/photoqml/PhotoTab.qml" line="291"/>
<source>More</source>
<translation>Ancora</translation>
</message>
@ -1423,14 +1448,14 @@
<translation type="vanished">Chiudi</translation>
</message>
<message>
<location filename="../qml/friendiqa.qml" line="175"/>
<location filename="../qml/friendiqa.qml" line="176"/>
<source>Background Sync
Rightclick or Middleclick to Quit</source>
<translation>Sincronizzazione dello sfondo
Fare clic con il tasto destro del mouse o con il tasto centrale per uscire</translation>
</message>
<message>
<location filename="../qml/friendiqa.qml" line="300"/>
<location filename="../qml/friendiqa.qml" line="302"/>
<source>Click to open Friendiqa</source>
<translation>Clicca per aprire Friendiqa</translation>
</message>
@ -1552,12 +1577,12 @@ Fare clic con il tasto destro del mouse o con il tasto centrale per uscire</tran
<translation type="vanished">L&apos;impostazione del tipo di visualizzazione delle notizie è stata spostata dalla pagina del conto alla pagina di configurazione.</translation>
</message>
<message>
<location filename="../js/service.js" line="463"/>
<location filename="../js/service.js" line="460"/>
<source>Undefined Array Error</source>
<translation></translation>
</message>
<message>
<location filename="../js/service.js" line="466"/>
<location filename="../js/service.js" line="463"/>
<source>JSON status Error</source>
<translation></translation>
</message>