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 ## v0.6.3
* Dark theme * Dark theme

View File

@ -18,7 +18,7 @@ Currently supported:
* Search for news * Search for news
* Click on hashtag in newsitem starts search for news with that word * 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 * 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 * 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 * Open links in external browser
* Click on contact photo for contact details and last news * Click on contact photo for contact details and last news
@ -26,11 +26,11 @@ Currently supported:
* Click on post text opens conversation * Click on post text opens conversation
* Deletion, Reposting, Answering of Posts * Deletion, Reposting, Answering of Posts
* Expand truncated news items * Expand truncated news items
* Liking, disliking, favoriting * Liking, disliking
* Attending for event posts * Attending for event posts
* Update fetches new posts (up to last 50) since last in local DB * Update fetches new posts (up to last 50) since last in local DB
* More shows older posts from 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 image from Android gallery
* Send text or urls from other apps to Friendiqa * Send text or urls from other apps to Friendiqa
* Native Android image dialog * Native Android image dialog
@ -48,13 +48,14 @@ Currently supported:
* Tabs for own profiles, friends, other contacts and groups * Tabs for own profiles, friends, other contacts and groups
* Show profile(s) of user and change profile picture * Show profile(s) of user and change profile picture
* List of all known contacts with locally downloaded pictures * 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 * Show follow requests; approve, deny, ignore requests
* Additional information, last messages and other functionality shown in news tab * 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 pictures of contact (screenscraping of contact's website, works only with certain theme)
* Show public and private events of contact * Show public and private events of contact
* Show members of groups * Show members of groups
* Open website of contact or connect page (for other contacts) * Open website of contact
* Clean other contacts with no news * Clean other contacts with no news
ToDo: ToDo:
@ -66,8 +67,8 @@ ToDo:
Currently supported: Currently supported:
* Download public own images to local directory * Download public own images to local directory (API is currently broken)
* Upload public picture to album with descriptions, send from gallery * Upload public picture to album with descriptions, send from gallery (API is currently broken)
* Delete own pictures and albums on client and server * Delete own pictures and albums on client and server
* Change name or album of existing picture * Change name or album of existing picture
* Show albums in grid, show images in album in grid and fullscreen * Show albums in grid, show images in album in grid and fullscreen

View File

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

View File

@ -13,7 +13,7 @@
TEMPLATE = app TEMPLATE = app
TARGET = friendiqa TARGET = friendiqa
CONFIG += release 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) include(androidnative.pri/androidnative.pri)
@ -64,6 +64,7 @@ HEADERS += \
common/alarm.h common/alarm.h
DISTFILES += \ DISTFILES += \
android/gradle.properties \
qml/calendarqml/*.qml \ qml/calendarqml/*.qml \
android/AndroidManifest.xml \ android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \ android/gradle/wrapper/gradle-wrapper.jar \
@ -72,6 +73,7 @@ DISTFILES += \
android/build.gradle \ android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \ android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew.bat \ android/gradlew.bat \
qml/configqml/ConfigAppearancePage.qml \
translations/*.ts \ translations/*.ts \
translations/*.qm \ translations/*.qm \
qml/*.qml \ 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_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){ function onLoginChanged(login){
if(login==""){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")} if(login==""){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")}
else{//rootstackView.push(rootstack) else{
if (login.newsViewType!="" || login.newsViewType!=null){newstab.newstabstatus=login.newsViewType;} if (login.newsViewType!="" || login.newsViewType!=null){newstab.newstabstatus=login.newsViewType;}
Newsjs.getCurrentContacts(login,db,function(contacts){ Newsjs.getCurrentContacts(login,db,function(contacts){
contactlist=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}) rootstackView.push("qrc:/qml/newsqml/ContactPage.qml",{"contact": contact})
} }
@ -182,7 +182,7 @@ ApplicationWindow{
footer:ToolBar{id:roottoolbar footer:ToolBar{id:roottoolbar
background: Rectangle{ background: Rectangle{
anchors.fill: parent anchors.fill: parent
color: Material.backgroundDimColor//"#EEEEEE"//"#F8F8F8" color: Material.backgroundDimColor
} }
TabBar { 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 StackView{id:rootstackView
width:root.width width:root.width
height: root.height height: root.height
@ -250,6 +238,7 @@ ApplicationWindow{
property string newstabstatus property string newstabstatus
property var conversation:[] property var conversation:[]
source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":"" source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
//onDoubleClicked:{newstypeSignal("refresh")}
} }
Loader{ Loader{
id: friendstab 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) cmake_minimum_required(VERSION 3.1.0)
project(friendiqa VERSION 0.6 LANGUAGES CXX) 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) set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif() endif()
find_package(Qt5 COMPONENTS Widgets Quick Sql DBus WebView REQUIRED) #QuickWidgets find_package(Qt5 COMPONENTS Widgets Quick Sql DBus REQUIRED)
#Webview Webengine
set(MOC_SOURCES common/uploadableimage.h set(MOC_SOURCES common/uploadableimage.h
common/xhr.h common/xhr.h
@ -37,7 +29,7 @@ set(SOURCES common/friendiqa.cpp
common/remoteauthasyncimageprovider.cpp common/remoteauthasyncimageprovider.cpp
common/updatenews.cpp common/updatenews.cpp
common/alarmlinux.cpp) common/alarmlinux.cpp)
include_directories(common) include_directories(common)
add_executable(friendiqa ${SOURCES} ${MOC_SOURCES} application.qrc) 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::Widgets)
target_link_libraries(friendiqa Qt::Quick) target_link_libraries(friendiqa Qt::Quick)
target_link_libraries(friendiqa Qt::Sql) target_link_libraries(friendiqa Qt::Sql)
target_link_libraries(friendiqa Qt::WebView)
target_link_libraries(friendiqa Qt::DBus) 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 ${CMAKE_INSTALL_BINDIR})
install(FILES images/de.manic.Friendiqa.desktop DESTINATION share/applications)
install(TARGETS friendiqa DESTINATION bin) install(FILES images/de.manic.Friendiqa.svg DESTINATION share/icons/hicolor/scalable/apps)
#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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -32,10 +32,11 @@
#include "xhr.h" #include "xhr.h"
#include <QHttpPart> #include <QHttpPart>
#include <QTextCodec> //#include <QTextCodec>
#include <QUrlQuery> #include <QUrlQuery>
#include <QList> #include <QList>
#include <QDataStream> #include <QDataStream>
#include <QFile>
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonObject> #include <QJsonObject>
#include "uploadableimage.h" #include "uploadableimage.h"
@ -223,7 +224,7 @@ void XHR::getlist()
XHR::setUrl(m_filelist.at(dlindex));} XHR::setUrl(m_filelist.at(dlindex));}
else { else {
XHR::setUrl(m_filelist.at(dlindex));} XHR::setUrl(m_filelist.at(dlindex));}
qDebug() << "start download" << m_url; //qDebug() << "start download" << m_url;
XHR::download(); XHR::download();
} else {dlindex=0;m_downloadtype="";m_contactlist.clear();m_filelist.clear();} } else {dlindex=0;m_downloadtype="";m_contactlist.clear();m_filelist.clear();}
} }
@ -291,7 +292,6 @@ void XHR::onReplySuccess()
void XHR::onRequestFinished() void XHR::onRequestFinished()
{ {
qDebug()<<"download requestFinished ";
// Save the file here // Save the file here
if (buffer.isNull()){qDebug() << "File empty"<<m_url; buffer.clear(); emit this->error(m_downloadtype,m_url,m_api,1);} if (buffer.isNull()){qDebug() << "File empty"<<m_url; buffer.clear(); emit this->error(m_downloadtype,m_url,m_api,1);}
else if (m_downloadtype=="picturelist") { else if (m_downloadtype=="picturelist") {
@ -359,5 +359,6 @@ void XHR::onSSLError(const QList<QSslError> &errors)
QString XHR::bufferToString() 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 <QNetworkRequest>
#include <QObject> #include <QObject>
#include <QJsonObject> #include <QJsonObject>
#include <QNetworkConfiguration> //#include <QNetworkConfiguration>
class XHR : public QObject class XHR : public QObject
{ {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -2,7 +2,7 @@
Version=1.0 Version=1.0
Type=Application Type=Application
Exec=friendiqa %u Exec=friendiqa %u
Icon=Friendiqa.svg Icon=de.manic.Friendiqa.svg
Terminal=false Terminal=false
Name=Friendiqa Name=Friendiqa
GenericName=Social Media 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!=""){ try{ if (xhrequest.responseText!=""){
callback(xhrequest.responseText) callback(xhrequest.responseText)
}else{//print("API:\n" +api+" NO RESPONSE"); }else{//print("API:\n" +api+" NO RESPONSE");
showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow) //showMessage("Error","API:\n" +api+" NO RESPONSE",rootwindow)
callback(xhrequest.responseText) 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)); 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 .import "qrc:/js/helper.js" as Helperjs
function requestFriends(login,database,rootwindow,callback){ 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]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('UPDATE contacts SET isFriend=0 where username="'+login.username+'"')}); // clean old friends var result = tx.executeSql('UPDATE contacts SET isFriend=0 where username="'+login.username+'"'); // clean old friends
Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){ var result2 = tx.executeSql('DELETE from groups where username="'+login.username+'"'); // clean old groups
var friends=JSON.parse(obj); })
for (var i=0;i<friends.length;i++){ // /api/statuses/friends not working in Friendica 2/2022 , switching to api/v1/lists and download of all list members
friends[i].created_at=Date.parse(cleanDate(friends[i].created_at)); // Helperjs.friendicaRequest(login,"/api/statuses/friends?count=9999", rootwindow,function (obj){
friends[i].isFriend=1 var allfriends=[];
} Helperjs.friendicaRequest(login,"/api/v1/lists",rootwindow,function(listsobj){
//try{requestProfile(login,friends,rootwindow,function(friends_profile){callback(friends_profile)})} var lists=JSON.parse(listsobj)
//catch(e){ for (var list in lists){
callback(friends)//} 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){ function requestGroups(login,database,rootwindow,callback){
// retrieve, save and return groups. Other features currently not implemented // retrieve, save and return groups. Other features currently not implemented
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
Helperjs.friendicaRequest(login,"/api/friendica/group_show",rootwindow, function (obj){ Helperjs.friendicaRequest(login,"/api/friendica/group_show",rootwindow, function (obj){
var groups=JSON.parse(obj); var groups=JSON.parse(obj);
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('DELETE from groups where username="'+login.username+'"'); // clean old groups var result = tx.executeSql('DELETE from groups where username="'+login.username+'"'); // clean old groups
for (var i=0;i<groups.length;i++){ 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))} var memberarray=[]; for (var user in groups[i].user){memberarray.push(parseInt(groups[i].user[user].id))}
//print("Members: "+groups[i].user) //print("Members: "+groups[i].user)
var result2 = tx.executeSql('INSERT INTO groups VALUES (?,?,?,?)', [login.username,groups[i].name,groups[i].gid,JSON.stringify(memberarray)])} var result2 = tx.executeSql('INSERT INTO groups VALUES (?,?,?,?)', [login.username,groups[i].name,groups[i].gid,JSON.stringify(memberarray)])}
callback() 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 db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var filtertext=''; var filtertext='';
//try {filtertext=' AND screen_name like "' + filter+'%"'}catch(e){} if (filter!=null){var filtertext=new RegExp(".*"+filter.toLowerCase()+".*")}else{var filtertext=new RegExp(".*")}
var filtertext=new RegExp(".*"+filter.toLowerCase()+".*")
// if (filter){filtertext=' AND (screen_name like "' + filter+'%" OR name like "' + Qt.btoa(filter)+'%")'}
db.transaction( function(tx) { 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>'+isFriend+' ORDER BY screen_name');
var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend>0');
// check for friends // check for friends
var contactlist=[]; var contactlist=[];
for (var i=0;i<result.rows.length;i++){ for (var i=0;i<result.rows.length;i++){
var contact=result.rows.item(i) var contact=result.rows.item(i)
contact.name=Qt.atob(contact.name); 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())){ if(filtertext.test(contact.name.toLowerCase())|| filtertext.test(contact.screen_name.toLowerCase())){
contactlist.push(contact)} contactlist.push(contact)}
} }
@ -108,7 +134,7 @@ function storeHashtags(login,database,newstext,rootwindow){
for (var tag in hashtags){ for (var tag in hashtags){
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from hashtags where username="'+login.username+'" AND tag = "'+Qt.btoa(tag)+'"'); // check for tag 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])+'"'); result = tx.executeSql('UPDATE hashtags SET tag="'+'", date='+curDate+', ownership=0 where username="'+login.username+'" AND tag="'+Qt.btoa(hashtags[tag])+'"');
} else {// use insert } else {// use insert
result = tx.executeSql('INSERT INTO hashtags (username,tag,date,statuses,ownership) VALUES (?,?,?,?,?)', [login.username,Qt.btoa(hashtags[tag]),curDate,"[]",0]) 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){ Helperjs.friendicaPostRequest(login,"/api/friendica/group_delete?gid="+group.gid+"&name="+group.groupname,"","POST",rootwindow, function (obj){
var deletereturn=JSON.parse(obj); var deletereturn=JSON.parse(obj);
if(deletereturn.success){ if(deletereturn.success){
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('DELETE from groups where username="'+login.username+'" AND groupname="'+group.name+'"'); // delete group var result = tx.executeSql('DELETE from groups where username="'+login.username+'" AND groupname="'+group.name+'"'); // delete group
callback() callback()
}); });
}})} }})}
function getLastNews(login,database,callback){ function getLastNews(login,database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var lastnewsid=0; var lastnewsid=0;
db.transaction( function(tx) { 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'); 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}; try{lastnewsid=result.rows.item(0).status_id;}catch(e){lastnewsid=0};
callback(lastnewsid) callback(lastnewsid)
}) })
} }
@ -163,15 +189,15 @@ function getCurrentContacts(login,database,callback){
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('SELECT url from contacts WHERE username="'+login.username+'" AND isFriend=1'); // check for friends 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++){ for (var i=0;i<result.rows.length;i++){
contactlist.push(result.rows.item(i).url ) contactlist.push(result.rows.item(i).url )
//print(result.rows.item(i).url) //print(result.rows.item(i).url)
} }
var lastDate=Date.now()-604800000;// 7 days old var lastDate=Date.now()-604800000;// 7 days old
//print('SELECT url from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge>'+lastDate); //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); 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++){ for (var j=0;j<result2.rows.length;j++){
contactlist.push(result2.rows.item(j).url ) contactlist.push(result2.rows.item(j).url )
} }
}) })
callback(contactlist) callback(contactlist)
} }
@ -183,7 +209,7 @@ function findNewContacts(news,contacts){
if(contacts.indexOf(url)==-1 && !(inArray(newContacts,"url",url))){ if(contacts.indexOf(url)==-1 && !(inArray(newContacts,"url",url))){
news[i].user.isFriend=0; news[i].user.isFriend=0;
newContacts.push(news[i].user); newContacts.push(news[i].user);
} }
if (news[i].hasOwnProperty('friendica_activities') && news[i].friendica_activities.like.length>0){ if (news[i].hasOwnProperty('friendica_activities') && news[i].friendica_activities.like.length>0){
for (var j=0;j<news[i].friendica_activities.like.length;j++){ for (var j=0;j<news[i].friendica_activities.like.length;j++){
var like_url=news[i].friendica_activities.like[j].url; var like_url=news[i].friendica_activities.like[j].url;
@ -192,47 +218,48 @@ function findNewContacts(news,contacts){
newContacts.push(news[i].friendica_activities.like[j]); 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++){ for (var k=0;j<news[k].friendica_activities.dislike.length;k++){
var dislike_url=news[i].friendica_activities.dislike[k].url; var dislike_url=news[i].friendica_activities.dislike[k].url;
if(contacts.indexOf(dislike_url)==-1 && !(inArray(newContacts,"url",dislike_url))){ if(contacts.indexOf(dislike_url)==-1 && !(inArray(newContacts,"url",dislike_url))){
news[i].friendica_activities.dislike[k].isFriend=0; 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')){ if(news[i].hasOwnProperty('friendica_author')){
var owner_url=news[i].friendica_author.url; var owner_url=news[i].friendica_author.url;
if(contacts.indexOf(owner_url)==-1 && !(inArray(newContacts,"url",owner_url))){ if(contacts.indexOf(owner_url)==-1 && !(inArray(newContacts,"url",owner_url))){
news[i].friendica_author.isFriend=0; news[i].friendica_author.isFriend=0;
newContacts.push(news[i].friendica_author); newContacts.push(news[i].friendica_author);
} }
} }
} }
return newContacts return newContacts
} }
function storeNews(login,database,news,rootwindow){ function storeNews(login,database,news,rootwindow){
// save news after contacts download, call next function // save news after contacts download, call next function
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
for (var i=0;i<news.length;i++){ for (var i=0;i<news.length;i++){
//print('store news data for ' + 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); //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 ausdruck=news[i];
var likearray=[];var dislikearray=[];var attendyesarray=[];var attendnoarray=[];var attendmaybearray=[]; var likearray=[];var dislikearray=[];var attendyesarray=[];var attendnoarray=[];var attendmaybearray=[];
if(news[i].hasOwnProperty('friendica_activities')){ 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.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.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.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.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.attendmaybe){attendmaybearray.push(news[i].friendica_activities.attendmaybe[user].url)}
} }
var friendica_activities=[likearray,dislikearray,attendyesarray,attendnoarray,attendmaybearray] var friendica_activities=[likearray,dislikearray,attendyesarray,attendnoarray,attendmaybearray]
var attachments="";if (news[i].attachments){attachments=Qt.btoa(JSON.stringify(news[i].attachments))} var attachments="";if (news[i].attachments){attachments=Qt.btoa(JSON.stringify(news[i].attachments))}
if (news[i].friendica_title!="") {news[i].statusnet_html="<b>"+news[i].friendica_title +"</b><br><br>"+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} //else{
news[i].statusnet_html=news[i].friendica_html//}
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('SELECT * from news where username="'+login.username+'" AND status_id = "'+news[i].id+'" AND messagetype='+news[i].messagetype); // check for news id 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'); 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 } 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])}}) 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)); function getActivitiesUserData(allcontacts,userUrlArray){//print(JSON.stringify(userUrlArray));
var helpArray=[]; var helpArray=[];
for (var i=0;i<userUrlArray.length;i++){ for (var i=0;i<userUrlArray.length;i++){
helpArray.push(objFromArray(allcontacts,"url",userUrlArray[i])); helpArray.push(objFromArray(allcontacts,"url",userUrlArray[i]));
} }
return helpArray return helpArray
} }
function newsfromdb(database,login,messagetype,callback,contact,stop_time){ 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]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1'); 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=""; 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'); 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} else{var stop="<"+stop_time}
var contactfilter="";if(contact){contactfilter=" AND (uid='"+contact+"' OR friendica_owner='"+contact+"')"} var contactfilter="";if(contact){contactfilter=" AND (uid='"+contact+"' OR friendica_owner='"+contact+"')"}
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'); //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 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=[]; var newsArray=[];
@ -280,7 +307,7 @@ function newsfromdb(database,login,messagetype,callback,contact,stop_time){
newsArray[i]=fetchUsersForNews(database,login.username,newsArray[i],allcontacts); 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))}; 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_owner_object=objFromArray(allcontacts,"url",news.friendica_owner);
news.friendica_author=objFromArray(allcontacts,"url",news.friendica_author); news.friendica_author=objFromArray(allcontacts,"url",news.friendica_author);
if (news.messagetype==0){ 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; delete news.friendica_activities;
news.friendica_activities={}; news.friendica_activities={};
//for(var j=0;j<friendicaArray.length;j++){ //for(var j=0;j<friendicaArray.length;j++){
news.friendica_activities.like=getActivitiesUserData(allcontacts,friendicaArray[0]); news.friendica_activities.like=getActivitiesUserData(allcontacts,friendicaArray[0]);
news.friendica_activities.dislike=getActivitiesUserData(allcontacts,friendicaArray[1]); news.friendica_activities.dislike=getActivitiesUserData(allcontacts,friendicaArray[1]);
news.friendica_activities.attendyes=getActivitiesUserData(allcontacts,friendicaArray[2]); news.friendica_activities.attendyes=getActivitiesUserData(allcontacts,friendicaArray[2]);
news.friendica_activities.attendno=getActivitiesUserData(allcontacts,friendicaArray[3]); news.friendica_activities.attendno=getActivitiesUserData(allcontacts,friendicaArray[3]);
news.friendica_activities.attendmaybe=getActivitiesUserData(allcontacts,friendicaArray[4]); news.friendica_activities.attendmaybe=getActivitiesUserData(allcontacts,friendicaArray[4]);
//} //}
} }
return news return news
} }
@ -311,31 +338,31 @@ function deleteNews(login,database,newsid,messagetype,rootwindow,callback){
else if (messagetype==2){ api="/api/friendica/notifications/seen?id="} else if (messagetype==2){ api="/api/friendica/notifications/seen?id="}
Helperjs.friendicaPostRequest(login,api+newsid,"","POST", rootwindow,function (obj){ Helperjs.friendicaPostRequest(login,api+newsid,"","POST", rootwindow,function (obj){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
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 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) callback(obj)
}); });
})} })}
function retweetNews(login,database,newsid,rootwindow,callback){ function retweetNews(login,database,newsid,rootwindow,callback){
Helperjs.friendicaPostRequest(login,"/api/statuses/retweet?id="+newsid,"","POST", rootwindow,function (obj){ Helperjs.friendicaPostRequest(login,"/api/statuses/retweet?id="+newsid,"","POST", rootwindow,function (obj){
var answer=JSON.parse(obj); var answer=JSON.parse(obj);
if(answer.hasOwnProperty('status'))//('error' in answer.status) if(answer.hasOwnProperty('status'))//('error' in answer.status)
{Helperjs.showMessage("Repost",answer.status.code,rootwindow);} {Helperjs.showMessage("Repost",answer.status.code,rootwindow);}
else{Helperjs.showMessage("Repost",answer.text,rootwindow)} else{Helperjs.showMessage("Repost",answer.text,rootwindow)}
}) })
} }
function favorite(login,favorited,newsid,rootwindow){ function favorite(login,favorited,newsid,rootwindow){
// toggle favorites // toggle favorites
if(favorited){ Helperjs.friendicaPostRequest(login,"/api/favorites/create?id="+newsid,"","POST", rootwindow,function (obj){ if(favorited){ Helperjs.friendicaPostRequest(login,"/api/favorites/create?id="+newsid,"","POST", rootwindow,function (obj){
})} })}
else {Helperjs.friendicaPostRequest(login,"/api/favorites/destroy?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){ function likerequest(login,database,verb,newsid,rootwindow){
Helperjs.friendicaPostRequest(login,"/api/friendica/activity/"+verb+"?id="+newsid, "","POST",rootwindow,function (obj){ 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]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { 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_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)}} if (verb=="undislike"){ if (currentActivities.indexOf(2)!=-1){currentActivities.splice(currentActivities.indexOf(2),1)}}
//print(JSON.stringify(currentActivities)); //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); 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){ 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(verb=="dislike"&& toggle==1){likerequest(login,database,"dislike",newsid,rootwindow);
} }
if(toggle==0){ 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){ function attend(login,database,attend,newsid,rootwindow,callback){
Helperjs.friendicaPostRequest(login,"/api/friendica/activity/attend"+attend+"?id="+newsid, "","POST",rootwindow,function (obj){ Helperjs.friendicaPostRequest(login,"/api/friendica/activity/attend"+attend+"?id="+newsid, "","POST",rootwindow,function (obj){
//print("attend: "+attend+obj); //print("attend: "+attend+obj);
if (obj=='"ok"') if (obj=='"ok"')
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var currentActivities_rs=tx.executeSql('select friendica_activities_self from news WHERE username="'+login.username+'" AND status_id='+newsid) ; 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); 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); currentActivities.push(3);
if (currentActivities.indexOf(4)!=-1){currentActivities.splice(currentActivities.indexOf(4),1)} if (currentActivities.indexOf(4)!=-1){currentActivities.splice(currentActivities.indexOf(4),1)}
if (currentActivities.indexOf(5)!=-1){currentActivities.splice(currentActivities.indexOf(5),1)} if (currentActivities.indexOf(5)!=-1){currentActivities.splice(currentActivities.indexOf(5),1)}
//print(JSON.stringify(currentActivities)); //print(JSON.stringify(currentActivities));
} }
if ((attend=="no")&&(currentActivities.indexOf(4)==-1)){ if ((attend=="no")&&(currentActivities.indexOf(4)==-1)){
currentActivities.push(4); currentActivities.push(4);
if (currentActivities.indexOf(3)!=-1){currentActivities.splice(currentActivities.indexOf(3),1)} if (currentActivities.indexOf(3)!=-1){currentActivities.splice(currentActivities.indexOf(3),1)}
if (currentActivities.indexOf(5)!=-1){currentActivities.splice(currentActivities.indexOf(5),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); currentActivities.push(5);
if (currentActivities.indexOf(3)!=-1){currentActivities.splice(currentActivities.indexOf(3),1)} if (currentActivities.indexOf(3)!=-1){currentActivities.splice(currentActivities.indexOf(3),1)}
if (currentActivities.indexOf(4)!=-1){currentActivities.splice(currentActivities.indexOf(4),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); var result = tx.executeSql('UPDATE news SET friendica_activities_self ="'+JSON.stringify(currentActivities)+'" where username="'+login.username+'" AND status_id ='+newsid);
callback(); callback();
})})} })})}
function requestConversation(login,database,newsid,contacts,rootwindow,callback){ function requestConversation(login,database,newsid,contacts,rootwindow,callback){
Helperjs.friendicaRequest(login,"/api/conversation/show?id="+newsid,rootwindow, function (obj){ Helperjs.friendicaRequest(login,"/api/conversation/show?id="+newsid,rootwindow, function (obj){
var news=JSON.parse(obj); var news=JSON.parse(obj);
var newContacts=findNewContacts(news,contacts); var newContacts=findNewContacts(news,contacts);
// storeNews(login,database,news,rootwindow,callback) // storeNews(login,database,news,rootwindow,callback)
callback(news,newContacts) callback(news,newContacts)
})} })}
//function conversationfromdb(database,user,conversationId,callback){ //function conversationfromdb(database,user,conversationId,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]);
@ -420,120 +447,127 @@ function requestConversation(login,database,newsid,contacts,rootwindow,callback)
function requestFavorites(login,database,contacts,rootwindow,callback){ function requestFavorites(login,database,contacts,rootwindow,callback){
Helperjs.friendicaRequest(login,"/api/favorites",rootwindow, function (obj){ Helperjs.friendicaRequest(login,"/api/favorites",rootwindow, function (obj){
//print(obj+JSON.stringify(obj)); //print(obj+JSON.stringify(obj));
var news=JSON.parse(obj); var news=JSON.parse(obj);
var newContacts=findNewContacts(news,contacts); var newContacts=findNewContacts(news,contacts);
// storeNews(login,database,news,rootwindow,callback) // storeNews(login,database,news,rootwindow,callback)
callback(news,newContacts) 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]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
if (!stop_time){var stop=""; if (!stop_id){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'); 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).created_at}catch(e){stop="<99999999999999"}} stop="<="+rs.rows.item(0).status_id}catch(e){stop="<99999999999999"}}
else{var stop="<"+stop_time} else{var stop="<"+stop_id}
if (messagetype=="1"){messagetype="1,5"} 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'); let conversationfilter="";
var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1'); if (currentconversations.length>0){conversationfilter="AND statusnet_conversation_id NOT IN ("+currentconversations.toString()+") "}
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);
for(var j = 0; j< conversations.length; j++) { 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 newsrs=tx.executeSql('select * from news WHERE username="'+login.username+'" AND statusnet_conversation_id="'+conversations[j] +'" AND messagetype="'+messagetype+'" ORDER BY created_at ASC'); var result = tx.executeSql('SELECT status_id from news WHERE username="'+login.username+'" AND messagetype=0 ORDER BY status_id DESC LIMIT 1');
//print(JSON.stringify(newsrs.rows.item(0))+JSON.stringify(newsrs.rows.item(1))) try{var lastid=result.rows.item(0).status_id;}catch(e){var lastid=0};
var helpernews=newsrs.rows.item(0); var conversations=[];
helpernews=cleanhelpernews(database,login.username,helpernews,allcontacts) for(var i = 0; i < conversationsrs.rows.length; i++) {
helpernews.currentconversation=[]; conversations.push(conversationsrs.rows.item(i).statusnet_conversation_id);
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 newsArray=[];
var allcontacts=getAllContacts(database,login.username);
helpernews.newscount=newsrs.rows.length; for(var j = 0; j< conversations.length; j++) {
newsArray.push(helpernews); 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)))
callback(newsArray,lastid); 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){ function allchatsfromdb(database,user,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
// if (!stop_time){var stop=""; // if (!stop_time){var stop="";
// try{var rs = tx.executeSql('select created_at from news WHERE username="'+username+'" ORDER BY created_at DESC LIMIT 1'); // try{var rs = tx.executeSql('select created_at from news WHERE username="'+username+'" ORDER BY created_at DESC LIMIT 1');
// stop="<="+rs.rows.item(0).created_at}catch(e){stop="<99999999999999"}} // stop="<="+rs.rows.item(0).created_at}catch(e){stop="<99999999999999"}}
// else{var stop="<"+stop_time} // else{var stop="<"+stop_time}
var 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 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=[]; var conversationIds=[];
for(var i = 0; i < conversationsrs.rows.length; i++) { for(var i = 0; i < conversationsrs.rows.length; i++) {
conversationIds.push(conversationsrs.rows.item(i).statusnet_conversation_id); 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)
}
} }
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); newsArray.push(helpernews);
countArray.push(newsrs.rows.length) countArray.push(newsrs.rows.length)
} }
var conversationsobject=({}); var conversationsobject=({});
conversationsobject.conversationIds=conversationIds; conversationsobject.conversationIds=conversationIds;
conversationsobject.newsArray=newsArray; conversationsobject.newsArray=newsArray;
conversationsobject.countArray=countArray; conversationsobject.countArray=countArray;
callback(conversationsobject); callback(conversationsobject);
})} })}
function oldchatfromdb(database,user,conversationId,lastpost,allcontacts,callback){ function oldchatfromdb(database,user,conversationId,lastpost,allcontacts,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
// var newsArray=[]; // var newsArray=[];
// var countArray=[]; // var countArray=[];
//var allcontacts=getAllContacts(database,user); //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'); 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){ let conversation=[];
var helpernews=newsrs.rows.item(0); var helpernews={currentconversation:conversation}
var helpernews=cleanhelpernews(database,user,helpernews,allcontacts) if(newsrs.rows.length>0){
helpernews.currentconversation=[]; //helpernews=newsrs.rows.item(0);
for (var h = 0;h<newsrs.rows.length;h++){ //helpernews=cleanhelpernews(database,user,helpernews,allcontacts)
var helpernews2=newsrs.rows.item(h); //helpernews.currentconversation=[];
if(helpernews.id!=helpernews2.status_id){ for (var h = 0;h<newsrs.rows.length;h++){
helpernews2.newscount=0; var helpernews2=newsrs.rows.item(h);
helpernews2=cleanhelpernews(database,user,helpernews2,allcontacts) if(helpernews.id!=helpernews2.status_id){
helpernews.currentconversation.push(helpernews2) 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 newscount=newsrs.rows.length;
// var conversationobject={news:helpernews,newscount:newscount}; callback(helpernews,newscount);
// return conversationobject; // var conversationobject={news:helpernews,newscount:newscount};
})} // return conversationobject;
})
}
function cleanhelpernews(database,user,helpernews,allcontacts){ function cleanhelpernews(database,user,helpernews,allcontacts){
helpernews=fetchUsersForNews(database,user,helpernews,allcontacts); helpernews=fetchUsersForNews(database,user,helpernews,allcontacts);
@ -582,5 +616,5 @@ function cleanDate(date){
} }
function findTags(fulltext){ 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=({}) var self=({})
if (newsitemobject.hasOwnProperty("friendica_activities_self")){ if (newsitemobject.hasOwnProperty("friendica_activities_self")){
if (newsitemobject.friendica_activities_self.indexOf(3)!=-1){self.attending=qsTr("yes")} if (newsitemobject.friendica_activities_self.indexOf(3)!=-1){self.attending=qsTr("yes")}
if (newsitemobject.friendica_activities_self.indexOf(4)!=-1){self.attending=qsTr("no")} if (newsitemobject.friendica_activities_self.indexOf(4)!=-1){self.attending=qsTr("no")}
if (newsitemobject.friendica_activities_self.indexOf(5)!=-1){self.attending=qsTr("maybe")} if (newsitemobject.friendica_activities_self.indexOf(5)!=-1){self.attending=qsTr("maybe")}
if (newsitemobject.friendica_activities_self.indexOf(1)!=-1){self.liked=1} if (newsitemobject.friendica_activities_self.indexOf(1)!=-1){self.liked=1}
if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1} if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
} }
var friendica_activities={self:self} var friendica_activities={self:self}
var imageAttachmentList=[]; var imageAttachmentList=[];
var videoAttachmentList=[]; var videoAttachmentList=[];
var videoformats=["mp4", "avi", "webm","ogg","mp3"] var videoformats=["mp4", "avi", "webm","ogg","mp3"]
try{if(newsitemobject.attachments){ try{if(newsitemobject.attachments){
var attachArray=newsitemobject.attachments; var attachArray=newsitemobject.attachments;
for (var image in attachArray){ for (var image in attachArray){
var attachhelper={mimetype:attachArray[image].mimetype} var attachhelper={mimetype:attachArray[image].mimetype}
var attachhelperstring="<img" //Qt.btoa(attachArray[image].url) var attachhelperstring="<img"
var helperstringposition=newsitemobject.statusnet_html.indexOf(attachhelperstring); 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 {
attachhelper.url=attachArray[image].url attachhelper.url=attachArray[image].url
// } if (helperstringposition>-1){var removeme=newsitemobject.statusnet_html.substring(helperstringposition,newsitemobject.statusnet_html.indexOf('">',helperstringposition)+2);}
if (helperstringposition>-1){var removeme=newsitemobject.statusnet_html.substring(helperstringposition,newsitemobject.statusnet_html.indexOf('">',helperstringposition)+2);} newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(removeme,"")
//print("Attachhelper "+attachhelper.url) imageAttachmentList.push(attachhelper)
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)
} }
}
}catch(e){print("attachment "+e)} }catch(e){print("attachment "+e)}
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(/class=\"attachment-image\"/g,"width=\"600\" ");
for (var format in videoformats){ for (var format in videoformats){
if (newsitemobject.text.indexOf("."+videoformats[format])>-1){ if (newsitemobject.text.indexOf("."+videoformats[format])>-1){
var videohelper={mimetype:"video/"+videoformats[format]} var videohelper={mimetype:"video/"+videoformats[format]}
var videotext=newsitemobject.text; var videotext=newsitemobject.text;
while (videotext.indexOf("."+videoformats[format])>-1){ while (videotext.indexOf("."+videoformats[format])>-1){
var videohelperstringposition=videotext.indexOf("."+videoformats[format]); var videohelperstringposition=videotext.indexOf("."+videoformats[format]);
videohelper.url=videotext.substring(videotext.lastIndexOf("http",videohelperstringposition),videohelperstringposition+4); videohelper.url=videotext.substring(videotext.lastIndexOf("http",videohelperstringposition),videohelperstringposition+4);
videotext=videotext.substring(videohelperstringposition+4,videotext.length) videotext=videotext.substring(videohelperstringposition+4,videotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=videohelper.url)){videoAttachmentList.push(videohelper)} if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=videohelper.url)){videoAttachmentList.push(videohelper)}
} }
} }
} }
if (newsitemobject.text.indexOf("/videos/watch/")>-1){ if (newsitemobject.text.indexOf("/videos/watch/")>-1){
var ptvideohelper={mimetype:"video/mp4"} var ptvideohelper={mimetype:"video/mp4"}
var ptvideotext=newsitemobject.text; var ptvideotext=newsitemobject.text;
while (ptvideotext.indexOf("/videos/watch/")>-1){ while (ptvideotext.indexOf("/videos/watch/")>-1){
var ptvideohelperstringposition=ptvideotext.indexOf("/videos/watch/"); var ptvideohelperstringposition=ptvideotext.indexOf("/videos/watch/");
var ptposend=findend(ptvideotext,ptvideohelperstringposition); var ptposend=findend(ptvideotext,ptvideohelperstringposition);
if(ptposend==-1){ptposend=ptvideotext.length}; if(ptposend==-1){ptposend=ptvideotext.length};
ptvideohelper.url=ptvideotext.substring(ptvideotext.lastIndexOf("http",ptvideohelperstringposition),ptposend)+"-480.mp4"; ptvideohelper.url=ptvideotext.substring(ptvideotext.lastIndexOf("http",ptvideohelperstringposition),ptposend)+"-480.mp4";
ptvideohelper.url=ptvideohelper.url.replace("/videos/watch","/static/webseed"); ptvideohelper.url=ptvideohelper.url.replace("/videos/watch","/static/webseed");
ptvideotext=ptvideotext.substring(ptposend,ptvideotext.length) ptvideotext=ptvideotext.substring(ptposend,ptvideotext.length)
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ptvideohelper.url)){videoAttachmentList.push(ptvideohelper)} 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)}
}
} }
newsitemobject.videoAttachmentList=videoAttachmentList; newsitemobject.videoAttachmentList=videoAttachmentList;
newsitemobject.imageAttachmentList=imageAttachmentList; newsitemobject.imageAttachmentList=imageAttachmentList;
if ((msg.options.hasOwnProperty("hide_nsfw"))&&(msg.options.hide_nsfw==1)&&(newsitemobject.text.indexOf("#nsfw")>-1)){ 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; return newsitemobject;
} }
WorkerScript.onMessage = function(msg) { WorkerScript.onMessage = function(msg) {
if(msg.deleteId!==undefined) if(msg.deleteId!==undefined)
{msg.model.remove(msg.deleteId); {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() 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 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 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 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 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 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)'); 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){ function cleanPermissions(oldperms){
var newperms=oldperms.replace("<","");newperms=newperms.replace(">","");newperms="["+newperms+"]"; var newperms=oldperms.replace("<","");newperms=newperms.replace(">","");newperms="["+newperms+"]";
var newpermArray=JSON.parse(newperms); var newpermArray=JSON.parse(newperms);
return (newpermArray) return (newpermArray)
} }
function getEvents(database,login,rootwindow,callback){ 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.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){ //Helperjs.friendicaRemoteAuthRequest(login,login.server+"/cal/"+login.username+"/json",login.server+"/profile/"+login.username,rootwindow,function(obj){
var events = JSON.parse(obj); var events = JSON.parse(obj);
db.transaction( function(tx) { db.transaction( function(tx) {
for (var i=0;i<events.length;i++){ for (var i=0;i<events.length;i++){
var permissions=[]; var permissions=[];
permissions.push(cleanPermissions(events[i].item.allow_cid)); permissions.push(cleanPermissions(events[i].item.allow_cid));
permissions.push(cleanPermissions(events[i].item.allow_gid)); permissions.push(cleanPermissions(events[i].item.allow_gid));
permissions.push(cleanPermissions(events[i].item.deny_cid)); permissions.push(cleanPermissions(events[i].item.deny_cid));
permissions.push(cleanPermissions(events[i].item.deny_gid)); 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 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 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); 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 } 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)])} 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() callback()
} }
})})} })})}
function newscount(database, callback){ function newscount(database, callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var newscountrs = tx.executeSql('SELECT COUNT(*) from news'); var newscountrs = tx.executeSql('SELECT COUNT(*) from news');
var newscount = newscountrs.rows.item(0)["COUNT(*)"]; var newscount = newscountrs.rows.item(0)["COUNT(*)"];
callback(newscount) callback(newscount)
}) })
} }
function eventsfromdb(database, username,callback){ 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=[]; var allcontacts=[];
allcontacts=Newsjs.getAllContacts(root.db,login.username); allcontacts=Newsjs.getAllContacts(root.db,login.username);
db.transaction( function(tx) { db.transaction( function(tx) {
var eventrs=tx.executeSql('select * from events WHERE username="'+username+'" ORDER BY start ASC'); var eventrs=tx.executeSql('select * from events WHERE username="'+username+'" ORDER BY start ASC');
var eventArray=[]; var eventArray=[];
var dayArray=[]; var dayArray=[];
for(var i = 0; i < eventrs.rows.length; i++) { for(var i = 0; i < eventrs.rows.length; i++) {
eventArray.push(eventrs.rows.item(i)); eventArray.push(eventrs.rows.item(i));
if (eventArray[i].cid!=0){eventArray[i]["eventOwner"]=Newsjs.objFromArray(allcontacts,"cid",eventArray[i].cid);} if (eventArray[i].cid!=0){eventArray[i]["eventOwner"]=Newsjs.objFromArray(allcontacts,"cid",eventArray[i].cid);}
else{eventArray[i]["eventOwner"]=Newsjs.objFromArray(allcontacts,"isFriend",2);} 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 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} 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; eventArray[i]["startday"]=startday;eventArray[i]["endday"]=endday;
dayArray.push(startday); dayArray.push(startday);
if (endday>startday){ if (endday>startday){
for (var j=startday+1;j<endday+1;j++){dayArray.push(j)} for (var j=startday+1;j<endday+1;j++){dayArray.push(j)}
}
} }
} callback(eventArray,dayArray)});
callback(eventArray,dayArray)});
} }
function requestFriendsEvents(login,friend,rootwindow,callback){ 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){ Helperjs.friendicaWebRequest(friend.replace("profile","cal")+"/json",rootwindow,function(calhtml){
//print(calhtml); //print(calhtml);
var eventarray=[];var eventdays=[]; var eventarray=[];var eventdays=[];
var events=JSON.parse(calhtml); var events=JSON.parse(calhtml);
for (var i=0;i<events.length;i++){ for (var i=0;i<events.length;i++){
var permissions=[]; var permissions=[];
permissions.push(cleanPermissions(events[i].item.allow_cid)); permissions.push(cleanPermissions(events[i].item.allow_cid));
permissions.push(cleanPermissions(events[i].item.allow_gid)); permissions.push(cleanPermissions(events[i].item.allow_gid));
permissions.push(cleanPermissions(events[i].item.deny_cid)); permissions.push(cleanPermissions(events[i].item.deny_cid));
permissions.push(cleanPermissions(events[i].item.deny_gid)); permissions.push(cleanPermissions(events[i].item.deny_gid));
var event ={} var event ={}
event.start=Date.parse(events[i].start);event.end=Date.parse(events[i].end); 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.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.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.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.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.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.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.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.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.authorAvatar=events[i].item["author-avatar"]; event. authorLink=events[i].item["author-link"];
event.html=Qt.btoa(events[i].html); event.html=Qt.btoa(events[i].html);
eventarray.push(event); eventarray.push(event);
// var offsetTime = new Date().getTimezoneOffset() * 60 * 1000;print(new Date(event.start).toLocaleString()+"Zeitverschiebung:"+offsetTime) // var offsetTime = new Date().getTimezoneOffset() * 60 * 1000;print(new Date(event.start).toLocaleString()+"Zeitverschiebung:"+offsetTime)
// var time = event.start - offsetTime; // var time = event.start - offsetTime;
eventdays.push(Math.floor(event.start/(24*60*60*1000))) eventdays.push(Math.floor(event.start/(24*60*60*1000)))
} }
//print(JSON.stringify(eventarray)); //print(JSON.stringify(eventarray));
callback(eventarray,eventdays) callback(eventarray,eventdays)
}) })
} }
function newRequestFriendsEvents(login,friend,rootwindow,callback){ 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){ if(friend.isFriend==1){
Helperjs.friendicaRemoteAuthRequest(login,friend.url.replace("profile","cal")+"/json",friend.url,rootwindow,function(calhtml){ Helperjs.friendicaRemoteAuthRequest(login,friend.url.replace("profile","cal")+"/json",friend.url,rootwindow,function(calhtml){
getEventsFromHtml(calhtml,rootwindow,callback)}) 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.authorAvatar=events[i].item["author-avatar"]; event. authorLink=events[i].item["author-link"];
event.html=Qt.btoa(events[i].html); event.html=Qt.btoa(events[i].html);
eventarray.push(event); eventarray.push(event);
// var offsetTime = new Date().getTimezoneOffset() * 60 * 1000;print(new Date(event.start).toLocaleString()+"Zeitverschiebung:"+offsetTime) // var offsetTime = new Date().getTimezoneOffset() * 60 * 1000;print(new Date(event.start).toLocaleString()+"Zeitverschiebung:"+offsetTime)
// var time = event.start - offsetTime; // var time = event.start - offsetTime;
eventdays.push(Math.floor(event.start/(24*60*60*1000))) eventdays.push(Math.floor(event.start/(24*60*60*1000)))
} }
//print(JSON.stringify(eventarray)); //print(JSON.stringify(eventarray));
@ -194,61 +194,60 @@ function getEventsFromHtml(calhtml,rootwindow,callback){
} }
function savePermissions(database,obj) { // stores config to DB function savePermissions(database,obj) { // stores config to DB
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 permissions=JSON.stringify(obj) var permissions=JSON.stringify(obj)
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql( 'UPDATE config SET permissions="'+permissions+'" WHERE username="'+obj.username +'"'); var result = tx.executeSql( 'UPDATE config SET permissions="'+permissions+'" WHERE username="'+obj.username +'"');
}) })
} }
function storeConfig(database,obj) { // stores config to DB function storeConfig(database,obj) { // stores config to DB
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
//print(JSON.stringify(obj)); //print(JSON.stringify(obj));
var result = tx.executeSql('SELECT * from config WHERE username="'+obj.username+'"'); var result = tx.executeSql('SELECT * from config WHERE username="'+obj.username+'"');
if(result.rows.length === 1) {// use update 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 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 +'"'); var result3 = tx.executeSql('UPDATE config SET isActive=1 WHERE username !="'+obj.username +'"');
} else {// use insert print('... does not exists, create it') } 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 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 +'"'); 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){ function requestProfile(login,database,rootwindow,callback){
// return profile data // return profile data
Helperjs.friendicaRequest(login,"/api/friendica/profile/show", rootwindow,function (obj){ Helperjs.friendicaRequest(login,"/api/friendica/profile/show", rootwindow,function (obj){
var profiledata=JSON.parse(obj); var profiledata=JSON.parse(obj);
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
for (var i=0;i<profiledata.profiles.length;i++){ for (var i=0;i<profiledata.profiles.length;i++){
//print('store profile data for '+JSON.stringify(profiledata.profiles[i]));
db.transaction( function(tx) { 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 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 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)); 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 } 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]))])} 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; var profile=profiledata.friendica_owner;
profile.isFriend=2; profile.isFriend=2;
@ -258,22 +257,22 @@ function requestProfile(login,database,rootwindow,callback){
} }
function getServerConfig(database,login,rootwindow,callback){ function getServerConfig(database,login,rootwindow,callback){
// check server with given credentials // check server with given credentials
try {Helperjs.friendicaRequest(login,"/api/statusnet/config",rootwindow, function (obj){ try {Helperjs.friendicaRequest(login,"/api/statusnet/config",rootwindow, function (obj){
var serverconfig = JSON.parse(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+ 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+ "\nEmail: "+serverconfig.site.email+"\nTimezone: "+serverconfig.site.timezone+"\nClosed: "+serverconfig.site.closed+
"\nText limit: "+serverconfig.site.textlimit+"\nShort Url length: "+serverconfig.site.shorturllength+ "\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 + "\nFriendica version: "+serverconfig.site.friendica.FRIENDICA_VERSION+"\nDFRN version: "+serverconfig.site.friendica.DFRN_PROTOCOL_VERSION +
"\nDB Update version: "+serverconfig.site.friendica.DB_UPDATE_VERSION+"'}"; "\nDB Update version: "+serverconfig.site.friendica.DB_UPDATE_VERSION+"'}";
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var result = tx.executeSql('UPDATE config SET APIVersion="'+ serverconfig.site.friendica.FRIENDICA_VERSION+'" WHERE username="'+login.username +'"')}) var result = tx.executeSql('UPDATE config SET APIVersion="'+ serverconfig.site.friendica.FRIENDICA_VERSION+'" WHERE username="'+login.username +'"')})
callback(serverconfigString); callback(serverconfigString);
})} })}
catch (e){callback (e); catch (e){callback (e);
}} }}
function readConfig(database,callback,filter,filtervalue) { // reads config function readConfig(database,callback,filter,filtervalue) { // reads config
if (filter){var where = " WHERE "+ filter +" = '" + filtervalue+"'"} else { var where=""} 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'"); var tables = tx.executeSql("SELECT * FROM sqlite_master WHERE type='table'");
if (tables.rows.length==0){print("no database");callback("")} else { if (tables.rows.length==0){print("no database");callback("")} else {
var rs = tx.executeSql('select * from config'+where); var rs = tx.executeSql('select * from config'+where);
var rsArray=[]; var rsArray=[];
if (rs.rows.length>0){ if (rs.rows.length>0){
for(var i = 0; i < rs.rows.length; i++) { for(var i = 0; i < rs.rows.length; i++) {
rsArray.push(rs.rows.item(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}; 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){updateNewsviewtype(database,rsObject.newsViewType)} if (rsObject.newsViewType!="" && rsObject.newsViewType!=null &&!typeof(rsObject.newsViewType)=='undefined'){updateNewsviewtype(database,rsObject.newsViewType)}
} else {var rsObject=""} } else {var rsObject=""}
callback(rsObject)}} callback(rsObject)}}
) )
} }
@ -315,9 +314,9 @@ function readAllLogins(database,callback) { // reads config
} }
function readActiveConfig(database){ function readActiveConfig(database){
var obj=""; var obj="";
readConfig(database,function(config){obj=config},"isActive", 0); readConfig(database,function(config){obj=config},"isActive", 0);
return obj; return obj;
} }
function setDefaultOptions(database){ 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 db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
var go=({}); var go=({});
db.transaction( function(tx) { 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++){ for (var r=0; r<rs.rows.length; r++){
go[rs.rows.item(r).k]=rs.rows.item(r).v go[rs.rows.item(r).k]=rs.rows.item(r).v
} }
@ -341,7 +340,7 @@ function readGlobaloptions(database,callback){
} }
function readGO(database){ function readGO(database){
var obj; var obj;
readGlobaloptions(database,function(go){obj=go}); readGlobaloptions(database,function(go){obj=go});
return obj return obj
} }
@ -353,11 +352,11 @@ function updateglobaloptions(database,key,value){
if(result.rows.length > 0) {// use update if(result.rows.length > 0) {// use update
result = tx.executeSql('UPDATE globaloptions SET v="'+value+'" WHERE k="'+key+'"') result = tx.executeSql('UPDATE globaloptions SET v="'+value+'" WHERE k="'+key+'"')
} else {// use insert } 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; root.globaloptions[key]=value;
} }
function deleteConfig(database,userobj,callback) { // delete user data from DB 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!";} 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 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 groups WHERE username='"+ userobj.username+"'");
var rs5 = tx.executeSql("delete from events 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){ function cleanNews(database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var maxnewsrs = tx.executeSql("SELECT v FROM globaloptions WHERE k='max_news'"); 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}; var maxnews=1000; if(maxnewsrs.rows.length>0){ maxnews=maxnewsrs.rows.item(0).v};
for (var i=0; i<6;i++){ for (var i=0; i<6;i++){
if (i!=0){var maxnewsa=maxnews/5}else{maxnewsa=maxnews} if (i!=0){var maxnewsa=maxnews/5}else{maxnewsa=maxnews}
var newscountrs = tx.executeSql('SELECT COUNT(*) from news WHERE messagetype='+i); var newscountrs = tx.executeSql('SELECT COUNT(*) from news WHERE messagetype='+i);
var newscount = 0; var newscount = 0;
if (newscountrs.rows.length>0){newscount=newscountrs.rows.item(0)["COUNT(*)"]};//print(i+" "+maxnewsa+" newscount "+newscount) if (newscountrs.rows.length>0){newscount=newscountrs.rows.item(0)["COUNT(*)"]};
if (newscount>maxnewsa){ 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 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 lastvalidtime=lastvalidtimers.rows.item(newscount-maxnewsa-1).created_at;
var deleters = tx.executeSql('DELETE from news WHERE messagetype='+i+' AND created_at<='+lastvalidtime)} var deleters = tx.executeSql('DELETE from news WHERE messagetype='+i+' AND created_at<='+lastvalidtime)}
} }
callback() callback()
}) })
} }
function cleanContacts(login,database,callback){ function cleanContacts(login,database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { 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'); 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 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 var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge<'+oldestnewsTime); // check for friends
//print ("Contact result length: "+ result.rows.length) for (var i=0;i<result.rows.length;i++){
for (var i=0;i<result.rows.length;i++){//print("rm "+result.rows.item(i).profile_image)
filesystem.rmFile(result.rows.item(i).profile_image); filesystem.rmFile(result.rows.item(i).profile_image);
var deleters = tx.executeSql('DELETE from contacts WHERE username="'+login.username+'" AND url="'+result.rows.item(i).url+'"'); var deleters = tx.executeSql('DELETE from contacts WHERE username="'+login.username+'" AND url="'+result.rows.item(i).url+'"');
} }
@ -421,59 +418,64 @@ function cleanContacts(login,database,callback){
} }
function cleanHashtags(database,callback){ function cleanHashtags(database,callback){
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var tagcountrs = tx.executeSql('SELECT COUNT(*) from hashtags'); var tagcountrs = tx.executeSql('SELECT COUNT(*) from hashtags');
var tagcount = 0; var tagcount = 0;
if (tagcountrs.rows.length>0){tagcount=tagcountrs.rows.item(0)["COUNT(*)"]}; if (tagcountrs.rows.length>0){tagcount=tagcountrs.rows.item(0)["COUNT(*)"]};
if (tagcount>50){ if (tagcount>50){
var lastvaliddaters= tx.executeSql('SELECT DISTINCT date FROM hashtags ORDER BY date ASC LIMIT ' +(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 lastvaliddate=lastvaliddaters.rows.item(tagcount-49).date;
var deleters = tx.executeSql('DELETE from hashtags WHERE date<='+lastvaliddate)} var deleters = tx.executeSql('DELETE from hashtags WHERE date<='+lastvaliddate)}
callback() callback()
}) })
} }
function updateContactInDB(login,database,isFriend,contact){// for newstab and friendstab function updateContactInDB(login,database,isFriend,contact){// for newstab and friendstab
var currentTime=Date.now(); var currentTime=Date.now();
var image_timestamp=0; var image_timestamp=0;
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]); var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
db.transaction( function(tx) { db.transaction( function(tx) {
var imagename_helper=[]; 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)) 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){}; try {parseInt(image_timestamp=imagename_helper[1].substring(imagename_helper[1].indexOf("ts=")+3,imagename_helper[1].length))} catch(e){};
var result; var result;
result = tx.executeSql('SELECT * from contacts where username="'+login.username+'" AND url = "'+contact.url+'"'); // check for news url result = tx.executeSql('SELECT * from contacts where username="'+login.username+'" AND url = "'+contact.url+'"'); // check for news url
if(result.rows.length === 1) {// use update if(result.rows.length === 1) {// use update
result = tx.executeSql('UPDATE contacts SET id='+contact.id+', name="'+Qt.btoa(contact.name)+'", screen_name="'+contact.screen_name+'", location="'+contact.location+'",imageAge='+currentTime+', profile_image_url="'+contact.profile_image_url+'", description="'+Qt.btoa(contact.description)+'", protected="'+contact.protected+'", followers_count='+contact.followers_count+', friends_count='+contact.friends_count+', created_at="'+ contact.created_at+'", favourites_count="'+contact.favorites_count+'", utc_offset="'+contact.utc_offset+'", time_zone="'+contact.time_zone+'", statuses_count='+contact.statuses_count+', following="'+contact.following+'", verified ="'+contact.verified+'", statusnet_blocking="'+contact.statusnet_blocking+'", notifications="'+contact.notifictions+'", statusnet_profile_url="'+contact.statusnet_profile_url+'", cid='+contact.cid+', network="'+contact.network+'", isFriend='+isFriend+', timestamp='+ currentTime+' where username="'+login.username+'" AND url="'+contact.url+'"'); result = tx.executeSql('UPDATE contacts SET id='+contact.id+', name="'+Qt.btoa(contact.name)+'", screen_name="'+contact.screen_name+'", location="'+contact.location+'",imageAge='+currentTime+', profile_image_url="'+contact.profile_image_url+'", description="'+Qt.btoa(contact.description)+'", protected="'+contact.protected+'", followers_count='+contact.followers_count+', friends_count='+contact.friends_count+', created_at="'+ contact.created_at+'", favourites_count="'+contact.favorites_count+'", utc_offset="'+contact.utc_offset+'", time_zone="'+contact.time_zone+'", statuses_count='+contact.statuses_count+', following="'+contact.following+'", verified ="'+contact.verified+'", statusnet_blocking="'+contact.statusnet_blocking+'", notifications="'+contact.notifictions+'", statusnet_profile_url="'+contact.statusnet_profile_url+'", cid='+contact.cid+', network="'+contact.network+'", isFriend='+isFriend+', timestamp='+ currentTime+' where username="'+login.username+'" AND url="'+contact.url+'"');
} else {// use insert } else {// use insert
result = tx.executeSql('INSERT INTO contacts VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [login.username,contact.id,Qt.btoa(contact.name),contact.screen_name,contact.location,currentTime,contact.profile_image_url, Qt.btoa(contact.description),"",contact.url,contact.protected,contact.followers_count, contact.friends_count,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){ 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"){ if (api=="/api/users/show"){
var usermessages=[]; var usermessages=[];
usermessages.push(newslist.status); usermessages.push(newslist.status);
newslist=usermessages; newslist=usermessages;
} }
if (data==""){} if (data==""){newsBusy.running=false}
else if (typeof(newslist)=='undefined'){ else if (typeof(newslist)=='undefined'){
Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root) Helperjs.showMessage(qsTr("Undefined Array Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
} }
else if (newslist.hasOwnProperty('status')){ else if (newslist.hasOwnProperty('status')){
Helperjs.showMessage(qsTr("JSON status Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root) Helperjs.showMessage(qsTr("JSON status Error"),"API:\n" +login.server+api+"\n Return: \n"+data,root)
} }
else if (!(Array.isArray(newslist))){
replytimer.restart()
}
else { else {
var allcontacts=[]; var allcontacts=[];
allcontacts=Newsjs.getAllContacts(db,login.username); 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){ 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].messagetype=1;
newslist[n].source=" Friendica"; newslist[n].source=" Friendica";
newslist[n].status_id=newslist[n].id; 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 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)} 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){ for (var n in newslist){
newslist[n].created_at=Date.parse(newslist[n].date); newslist[n].created_at=Date.parse(newslist[n].date);
newslist[n].messagetype=2; newslist[n].messagetype=2;
@ -502,38 +504,42 @@ function processNews(api,data){
} }
} }
else {//if(api!="/api/statuses/user_timeline"){ else {//if(api!="/api/statuses/user_timeline"){
var chatlist=[]; var chatlist=[];
var chatlistclean=[];
var conversationIds=[]; var conversationIds=[];
var commentCount=[]; var commentCount=[];
for (var n in newslist){ for (var n in newslist){
if (newslist[n]!=null){ if (newslist[n]!=null){
newslist[n].created_at=Date.parse(Newsjs.cleanDate(newslist[n].created_at)); 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;} 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].friendica_author=cleanUser(newslist[n].friendica_author);
newslist[n].user=cleanUser(newslist[n].user); 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;} //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} //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].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')){ if(newslist[n].hasOwnProperty('friendica_activities')){
for (var m in newslist[n].friendica_activities.like){ 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){ 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){ 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){ 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){ 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'))){ if(!(newslist[n].hasOwnProperty('friendica_author'))){
newslist[n].friendica_author=newslist[n].user newslist[n].friendica_author=newslist[n].user
@ -542,29 +548,50 @@ function processNews(api,data){
//fill chatlist //fill chatlist
if (conversationindex==-1){ 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); conversationIds.push(newslist[n].statusnet_conversation_id);
commentCount.push(1); commentCount.push(1);
} else{ } else{
commentCount[conversationindex]=commentCount[conversationindex]+1; 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]) if ((newstab.newstabstatus=="Conversations")&&!(api=="/api/conversation/show"|| api=="/api/direct_messages/conversation")){
//chatlist[count].newscount=commentCount[count] //enrich chatlist with old entries
if (chatlist[count].id_str!==chatlist[count].statusnet_conversation_id){ for (var count in chatlist){
try{ chatlist[count].currentconversation.reverse();
Newsjs.oldchatfromdb(db,login.username,chatlist[count].statusnet_conversation_id,chatlist[count].id,allcontacts,function(oldpost,oldcount){ if (chatlist[count].currentconversation[0].id_str!==chatlist[count].currentconversation[0].statusnet_conversation_id){
chatlist[count]=oldpost; try{
chatlist[count].newscount=oldcount+commentCount[count]; Newsjs.oldchatfromdb(db,login.username,chatlist[count].currentconversation[0].statusnet_conversation_id,chatlist[count].currentconversation[0].id,allcontacts,function(oldpost,oldcount){
//print("JSON "+chatlist[count].statusnet_conversation_id+" "+chatlist[count].id+JSON.stringify(oldpost)) let completeChat=oldpost.currentconversation.concat(chatlist[count].currentconversation);
}) let newChat=completeChat[0];
}catch(e){print(e)} 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"){ else if (api=="/api/statuses/user_timeline" || api=="/api/users/show"){
root.contactposts=newslist root.contactposts=newslist
} }
else if ((api!="/api/direct_messages/all")&&(api!="/api/friendica/notifications")&&(newstab.newstabstatus==="Conversations")){ else if ((api!="/api/direct_messages/all")&&(api!="/api/friendica/notification")&&(api!="/api/direct_messages/new")&&(newstab.newstabstatus==="Conversations")){
showNews(chatlist);root.news=newslist showNews(chatlistclean);root.news=newslist
} }
else { else {
showNews(newslist);root.news=newslist showNews(newslist);root.news=newslist
@ -585,7 +612,6 @@ function processNews(api,data){
var newstabarray=["Conversations","Favorites","Timeline","DirectMessage","Replies"]; var newstabarray=["Conversations","Favorites","Timeline","DirectMessage","Replies"];
if (newstabarray.indexOf(newstab.newstabstatus)>-1){contacttimer.start()} if (newstabarray.indexOf(newstab.newstabstatus)>-1){contacttimer.start()}
} }
} }
@ -603,70 +629,70 @@ function updateView(viewtype){
//newsBusy.running=true; //newsBusy.running=true;
//downloadNotice.text="xhr start "+Date.now() //downloadNotice.text="xhr start "+Date.now()
switch(viewtype){ switch(viewtype){
case "Conversations": case "Conversations":
Newsjs.getLastNews(login,db,function(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 "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":
xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server); xhr.setUrl(login.server);
xhr.setApi("/api/search"); xhr.setApi("/api/statuses/friends_timeline");
break;
case "Notifications":
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/friendica/notifications");
xhr.clearParams(); xhr.clearParams();
break; xhr.setParam("since_id",lastnews);
case "Direct Messages": xhr.setParam("count",50)});
break;
case "Timeline":
var lastnews=Newsjs.getLastNews(login,db,function(lastnews){
xhr.setLogin(login.username+":"+Qt.atob(login.password)); xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server); xhr.setUrl(login.server);
xhr.setApi("/api/direct_messages/all"); xhr.setApi("/api/statuses/friends_timeline");
xhr.clearParams(); xhr.clearParams();
break; xhr.setParam("since_id",lastnews);
case "Public Timeline": 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.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server); xhr.setUrl(login.server);
xhr.setApi("/api/statuses/public_timeline"); xhr.setApi("/api/statuses/friends_timeline");
xhr.clearParams(); xhr.clearParams();
break; xhr.setParam("since_id",lastnews);
case "Favorites": xhr.setParam("count",50)
xhr.setLogin(login.username+":"+Qt.atob(login.password)); newstab.newstabstatus="Conversations";
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.get(); xhr.get();
@ -682,12 +708,12 @@ function updateView(viewtype){
function showGroups(){ function showGroups(){
Helperjs.readData(db,"groups",login.username,function(groups){ Helperjs.readData(db,"groups",login.username,function(groups){
var groupitems=""; var groupitems="";
for (var i=0;i<groups.length;i++){ for (var i=0;i<groups.length;i++){
groupitems=groupitems+"MenuItem{text:'"+groups[i].groupname+"'; onTriggered: Service.getGroupnews("+groups[i].gid+")}" 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 menuString="import QtQuick.Controls 2.12; import 'qrc:/js/service.js' as Service; Menu {"+groupitems+"}";
var grouplistObject=Qt.createQmlObject(menuString,newsStack,"groupmenuOutput"); var grouplistObject=Qt.createQmlObject(menuString,newsStack,"groupmenuOutput");
grouplistObject.popup() grouplistObject.popup()
}) })
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -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 2.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
import QtQuick.LocalStorage 2.0 import QtQuick.LocalStorage 2.0
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
//import "qrc:/js/news.js" as Newsjs
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
import "qrc:/js/news.js" as Newsjs
import "qrc:/qml/contactqml" import "qrc:/qml/contactqml"
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
@ -44,14 +45,16 @@ Item{
Layout.fillWidth:true Layout.fillWidth:true
Layout.fillHeight: true Layout.fillHeight: true
function showContacts(contact){ function showContacts(contact){
try {contactsModel.clear()} catch(e){print(e)}; try {contactsModel.clear()} catch(e){};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){ Newsjs.listFriends(login,db,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){ for (var j=0;j<contactsobject.length;j++){
contactsobject[j].description=Qt.atob(contactsobject[j].description); contactsobject[j].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]}); contactsModel.append({"contact":contactsobject[j]});
} }
},"isFriend",0,"screen_name ASC"); },searchText.text,-1);
} }
MButton { MButton {
id: cleanButton id: cleanButton
@ -61,17 +64,40 @@ Item{
anchors.right: parent.right anchors.right: parent.right
onClicked: { onClicked: {
Service.cleanContacts(root.login,root.db,function(){ Service.cleanContacts(root.login,root.db,function(){
try {contactsModel.clear()} catch(e){print(e)}; showContacts()
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){ // try {contactsModel.clear()} catch(e){print(e)};
for (var j=0;j<contactsobject.length;j++){ // Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
contactsobject[j].description=Qt.atob(contactsobject[j].description); // for (var j=0;j<contactsobject.length;j++){
contactsobject[j].name=Qt.atob(contactsobject[j].name); // contactsobject[j].description=Qt.atob(contactsobject[j].description);
contactsModel.append({"contact":contactsobject[j]}); // contactsobject[j].name=Qt.atob(contactsobject[j].name);
} // contactsModel.append({"contact":contactsobject[j]});
},"isFriend",0,"screen_name ASC"); // }
// },"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 { ListView {
id: contactsView id: contactsView
x:mm 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 property int currentContact: 0
function showFriends(contact){ function showFriends(contact){
try {friendsModel.clear()} catch(e){print(e)}; try {friendsModel.clear()} catch(e){};
Helperjs.readData(db,"friendshiprequests",login.username,function(friendrequestsobject){ Helperjs.readData(db,"friendshiprequests",login.username,function(friendrequestsobject){
for (var i=0;i<friendrequestsobject.length;i++){ for (var i=0;i<friendrequestsobject.length;i++){
if (friendrequestsobject[i].note!=null){ if (friendrequestsobject[i].note!=null){
@ -61,18 +61,18 @@ Item{
friendsModel.append({"contact":friendrequestsobject[i],"contactType":qsTr("Friend Requests")}); 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++){ for (var i=0;i<friendsobject.length;i++){
if(friendsobject[i].description!=""){ if(friendsobject[i].description!=""){
friendsobject[i].description=Qt.atob(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){ if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){
friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
} }
friendsModel.append({"contact":friendsobject[i],"contactType":qsTr("Friends")}); friendsModel.append({"contact":friendsobject[i],"contactType":qsTr("Friends")});
} }
},"isFriend",1,"screen_name ASC"); },(searchText.text==""?searchText.preeditText:searchText.text));
} }
Connections{ Connections{
target:xhr target:xhr
function onDownloaded(type,url,filename,i){ function onDownloaded(type,url,filename,i){
@ -84,6 +84,7 @@ Item{
} }
} }
} }
MButton { MButton {
id: updateFriendsButton id: updateFriendsButton
text: "\uf021" text: "\uf021"
@ -95,6 +96,7 @@ Item{
Helperjs.deleteData(root.db,"friendshiprequests",root.login.username,function(){}); Helperjs.deleteData(root.db,"friendshiprequests",root.login.username,function(){});
updatenews.setDatabase(); updatenews.setDatabase();
updatenews.login(); updatenews.login();
updatenews.setSyncAll(false);
updatenews.friendrequests(); updatenews.friendrequests();
//root.contactLoadType="friends"; //root.contactLoadType="friends";
Newsjs.requestFriends(root.login,db,root,function(nc){ Newsjs.requestFriends(root.login,db,root,function(nc){
@ -115,12 +117,34 @@ Item{
value: friendsGridTab.currentContact/root.newContacts.length 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 { Component {
id: sectionHeading id: sectionHeading
Rectangle { Rectangle {
width: friendsView.width width: friendsView.width
height: childrenRect.height height: childrenRect.height
color: Material.dialogColor //color: "lightsteelblue" color: Material.backgroundColor
required property string section required property string section
Text { Text {
color: Material.secondaryTextColor color: Material.secondaryTextColor
@ -131,6 +155,28 @@ Item{
} }
} }
//GridView { //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{ ListView{
id: friendsView id: friendsView
x:mm x:mm
@ -145,6 +191,7 @@ Item{
// } // }
model: friendsModel model: friendsModel
delegate: ContactComponent { } delegate: ContactComponent { }
header:headerComponent
section.property: "contactType" section.property: "contactType"
section.criteria: ViewSection.FullString section.criteria: ViewSection.FullString
section.delegate: sectionHeading section.delegate: sectionHeading

View File

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

View File

@ -56,16 +56,8 @@ Item {
height: parent.height-mm height: parent.height-mm
radius: 0.5*mm radius: 0.5*mm
border.color: "grey" 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{ Rectangle{
id:namelabelRect id:namelabelRect
x: 1 x: 1
@ -147,112 +139,7 @@ Item {
delegate: ContactComponent { }// groupMember delegate: ContactComponent { }// groupMember
function processContactSelection(contactobject){showContactdetails(contactobject)} function processContactSelection(contactobject){showContactdetails(contactobject)}
} }
ListModel{id: groupModel} 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"}} Component.onCompleted:{if(group.new){groupComponent.state="large"}}
} }
@ -262,12 +149,7 @@ Item {
name: "large" name: "large"
PropertyChanges { target: groupComponent; height: groupsView.height - 6*root.fontFactor*osSettings.bigFontSize } PropertyChanges { target: groupComponent; height: groupsView.height - 6*root.fontFactor*osSettings.bigFontSize }
PropertyChanges { target: namelabel; font.pointSize: 1.2*osSettings.bigFontSize; readOnly:false} 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: 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: detailsrectangle; visible:true }
PropertyChanges { target: infobutton; visible: false} PropertyChanges { target: infobutton; visible: false}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,7 +55,7 @@ AnimatedImage {id:gif;
MouseArea {anchors.fill:parent; MouseArea {anchors.fill:parent;
onClicked:{ onClicked:{
rootstackView.push("qrc:/qml/newsqml/NewsPhotolist.qml",{"photolistarray": model.newsitemobject.imageAttachmentList}) 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" text: "\uf057"
onClicked: { onClicked: {
if (rootstackView.depth>1){ if (rootstackView.depth>1){
roottoolbar.visible=true; //roottoolbar.visible=true;
rootstackView.pop()} rootstackView.pop()}
} }
} }

View File

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

View File

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

View File

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

View File

@ -41,298 +41,293 @@ import "qrc:/qml/genericqml"
StackView{ StackView{
id: photoStack id: photoStack
//anchors.fill:parent
initialItem:Rectangle { initialItem:Rectangle {
id:fotorectangle id:fotorectangle
anchors.fill:parent anchors.fill:parent
// y:1 color: Material.backgroundColor
// width:root.width-mm property var newimages:[]
// height:root.height-5*mm property int currentimageno: 0
color: Material.backgroundColor//'#fff' property bool remoteContact: false
property var newimages:[]
property int currentimageno: 0
property bool remoteContact: false
onNewimagesChanged:{ onNewimagesChanged:{
if(fotorectangle.newimages.length>0){ if(fotorectangle.newimages.length>0){
var ownimagelist=[]; var ownimagelist=[];
Helperjs.readField("album",root.db,"imageData",root.login.username,function(albums){ Helperjs.readField("album",root.db,"imageData",root.login.username,function(albums){
for (var i=0;i<fotorectangle.newimages.length;i++){ for (var i=0;i<fotorectangle.newimages.length;i++){
if(albums.indexOf(fotorectangle.newimages[i].album)==-1){ if(albums.indexOf(fotorectangle.newimages[i].album)==-1){
filesystem.Directory=root.login.imagestore+"/albums"; filesystem.Directory=root.login.imagestore+"/albums";
filesystem.makeDir(fotorectangle.newimages[i].album)} filesystem.makeDir(fotorectangle.newimages[i].album)}
//ownimagelist.push(root.login.server+"/api/friendica/photo?scale='0'&photo_id="+fotorectangle.newimages[i].id); //ownimagelist.push(root.login.server+"/api/friendica/photo?scale='0'&photo_id="+fotorectangle.newimages[i].id);
}
Imagejs.dataRequest(login,fotorectangle.newimages[0],db,xhr,fotorectangle);
})
// 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);
} }
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("") 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"){ if(method=="update"){
Helperjs.readData(db,"imageData",login.username,function(url){ Helperjs.readData(db,"imageData",login.username,function(url){
photoStack.push( photoStack.push(
"qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":[url[0].location+url[0].filename],"imageId":id,"currentAlbum":url[0].album} "qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":[url[0].location+url[0].filename],"imageId":id,"currentAlbum":url[0].album}
) )
},"id",id)} },"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})}
}
} }
onClicked: {photoupdatemenu.popup()}
}
MButton{ function uploadUrls(urls){
id: phototabstatusButton photoStack.push("qrc:/qml/photoqml/ImageUploadDialog.qml",{"attachImageURLs":urls})
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()}
}
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{ LeftDrawerLinux{
id: visualphotoModel id:leftDrawer
delegate: PhotogroupComponent{} property var newstabstatus: newstab.newstabstatus
model: photogroupModel visible: wideScreen&&rootstackView.depth<2
} width: visible?root.fontFactor*osSettings.systemFontSize*15:0
height: root.height-bar.height
}
ListModel{ LeftDrawerAndroid{
id: photogroupModel id: leftDrawerAndroid
} }
GridView { ProgressBar{
id: albumgridview id: newImagesProgress
cellWidth: 17*mm width: 15*mm
cellHeight: 17*mm height: updatePhotolist.height
x: leftDrawer.width//mm; anchors.top: parent.top
y:8*mm anchors.right:uploadPhoto.left
width: wideScreen&&rootstackView.depth<2?parent.width-leftDrawer.width-mm:parent.width-mm //parent.width-2*mm; anchors.rightMargin:mm
height: parent.height-9*mm visible: false
clip: true value: fotorectangle.currentimageno/fotorectangle.newimages.length
model: visualphotoModel.parts.album }
footer:Rectangle{
border.color: Material.backgroundDimColor//"#EEEEEE" MButton{
border.width: 1 id: uploadPhoto
width:12*mm anchors.top: parent.top
height:6*mm anchors.topMargin: 0.5*mm
Text{ anchors.right:updatePhotolist.left
font.pointSize: 0.75*osSettings.systemFontSize anchors.rightMargin:mm
anchors.centerIn: parent text:"\uf0ee"
text:qsTr("More") 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: {photoupdatemenu.popup()}
onClicked:{//print(photogroupModel.get(0).foreignPicture); }
var lastalbum_id=photogroupModel.count-1;
if(photogroupModel.get(photogroupModel.count-1).foreignPicture==true){ MButton{
Imagejs.newRequestFriendsAlbumPictures(login,photogroupModel.get(0).friend,fotorectangle,function(albums,remoteAuthBool){ id: phototabstatusButton
remoteContact=remoteAuthBool; anchors.top: parent.top
var msg = {'model': photogroupModel,'albums':albums,'firstalbum':lastalbum_id+1,'foreignPicture':true,'friend':photogroupModel.get(0).friend} anchors.topMargin: 0.5*mm
photoWorker.sendMessage(msg) anchors.right: parent.right
}) anchors.rightMargin:2*mm
} width: Math.max(8*root.fontFactor*osSettings.bigFontSize,implicitWidth)
else{Helperjs.readField("album",root.db, "imageData",root.login.username,function(albums){ text: fotostab.phototabstatus=="Images"?qsTr("Own Images"):fotostab.phototabstatus
var msg = { 'model': photogroupModel,'albums':albums,'foreignPicture': false,'firstalbum':lastalbum_id+1}; Menu {
photoWorker.sendMessage(msg)})} 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> <name>CalendarTab</name>
<message> <message>
<source>Events</source> <source>Events</source>
<translation>Termine</translation> <translation type="vanished">Termine</translation>
</message> </message>
<message> <message>
<source>Own Calendar</source> <source>Own Calendar</source>
<translation>Eigener Kalender</translation> <translation type="vanished">Eigener Kalender</translation>
</message> </message>
</context> </context>
<context> <context>
@ -393,7 +393,7 @@
</message> </message>
<message> <message>
<source>Connect</source> <source>Connect</source>
<translation>Kontaktanfrage</translation> <translation type="vanished">Kontaktanfrage</translation>
</message> </message>
<message> <message>
<source>Approve</source> <source>Approve</source>
@ -440,6 +440,21 @@
<translation>Netzwerk-Fehler</translation> <translation>Netzwerk-Fehler</translation>
</message> </message>
</context> </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> <context>
<name>Conversation</name> <name>Conversation</name>
<message> <message>
@ -596,7 +611,7 @@
<name>EventListItem</name> <name>EventListItem</name>
<message> <message>
<source>Location</source> <source>Location</source>
<translation>Ort</translation> <translation type="vanished">Ort</translation>
</message> </message>
</context> </context>
<context> <context>
@ -912,7 +927,7 @@
</message> </message>
<message> <message>
<source>Reply</source> <source>Reply</source>
<translation>Antworten</translation> <translation type="vanished">Antworten</translation>
</message> </message>
<message> <message>
<source>DM</source> <source>DM</source>
@ -950,6 +965,14 @@
<source>Delete</source> <source>Delete</source>
<translation>Löschen</translation> <translation>Löschen</translation>
</message> </message>
<message>
<source>Bookmark</source>
<translation>Markieren</translation>
</message>
<message>
<source>External</source>
<translation>Webseite</translation>
</message>
</context> </context>
<context> <context>
<name>PermissionDialog</name> <name>PermissionDialog</name>

View File

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

View File

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

View File

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