Browse Source

v.0.3.4

tags/v0.3.4
LubuWest 9 months ago
parent
commit
aca94a5393
98 changed files with 1061 additions and 152 deletions
  1. 12
    3
      CHANGELOG.md
  2. 1
    1
      PrivacyPolicy.md
  3. 1
    1
      source-android/android/AndroidManifest.xml
  4. 2
    0
      source-android/application.qrc
  5. 1
    1
      source-android/friendiqa.pro
  6. 1
    1
      source-android/js/friendworker.js
  7. 2
    2
      source-android/js/helper.js
  8. 1
    2
      source-android/js/image.js
  9. 1
    1
      source-android/js/layout.js
  10. 2
    2
      source-android/js/news.js
  11. 16
    2
      source-android/js/newsworker.js
  12. 1
    1
      source-android/js/photoworker.js
  13. 34
    1
      source-android/js/service.js
  14. 1
    1
      source-android/js/smiley.js
  15. 1
    1
      source-android/qml/calendarqml/CalendarDay.qml
  16. 1
    1
      source-android/qml/calendarqml/CalendarTab.qml
  17. 1
    1
      source-android/qml/calendarqml/EventList.qml
  18. 50
    5
      source-android/qml/configqml/ConfigTab.qml
  19. 2
    2
      source-android/qml/configqml/InfoBox.qml
  20. 1
    1
      source-android/qml/configqml/OSSettingsAndroid.qml
  21. 1
    1
      source-android/qml/configqml/OSSettingsLinux.qml
  22. 61
    0
      source-android/qml/configqml/RegisterPage.qml
  23. 1
    1
      source-android/qml/contactqml/ContactComponent.qml
  24. 2
    2
      source-android/qml/contactqml/ContactDetailsComponent.qml
  25. 1
    1
      source-android/qml/contactqml/Contactlist.qml
  26. 1
    1
      source-android/qml/contactqml/FriendsTab.qml
  27. 1
    1
      source-android/qml/contactqml/GroupComponent.qml
  28. 2
    1
      source-android/qml/contactqml/ProfileComponent.qml
  29. 4
    2
      source-android/qml/friendiqa.qml
  30. 3
    4
      source-android/qml/newsqml/ContactPage.qml
  31. 3
    3
      source-android/qml/newsqml/Conversation.qml
  32. 1
    1
      source-android/qml/newsqml/FriendicaActivities.qml
  33. 1
    1
      source-android/qml/newsqml/Hashtag.qml
  34. 1
    1
      source-android/qml/newsqml/MessageSend.qml
  35. 1
    1
      source-android/qml/newsqml/NewsImage.qml
  36. 52
    0
      source-android/qml/newsqml/NewsLink.qml
  37. 8
    8
      source-android/qml/newsqml/NewsTab.qml
  38. 1
    1
      source-android/qml/newsqml/NewsVideo.qml
  39. 18
    7
      source-android/qml/newsqml/Newsitem.qml
  40. 1
    1
      source-android/qml/newsqml/PermissionDialog.qml
  41. 1
    1
      source-android/qml/newsqml/SmileyDialog.qml
  42. 1
    1
      source-android/qml/photoqml/ImageUploadDialog.qml
  43. 1
    1
      source-android/qml/photoqml/PhotoComponent.qml
  44. 2
    2
      source-android/qml/photoqml/PhotoTab.qml
  45. 1
    1
      source-android/qml/photoqml/PhotogroupComponent.qml
  46. 2
    0
      source-linux/application.qrc
  47. 1
    1
      source-linux/common/filesystem.cpp
  48. 1
    1
      source-linux/common/filesystem.h
  49. 8
    2
      source-linux/common/friendiqa.cpp
  50. 1
    1
      source-linux/common/remoteauthasyncimageprovider.cpp
  51. 1
    1
      source-linux/common/remoteauthasyncimageprovider.h
  52. 341
    0
      source-linux/common/updatenews.cpp
  53. 110
    0
      source-linux/common/updatenews.h
  54. 1
    1
      source-linux/common/uploadableimage.cpp
  55. 1
    1
      source-linux/common/uploadableimage.h
  56. 2
    2
      source-linux/common/xhr.cpp
  57. 1
    1
      source-linux/common/xhr.h
  58. 7
    4
      source-linux/friendiqa.pro
  59. 1
    1
      source-linux/js/friendworker.js
  60. 2
    2
      source-linux/js/helper.js
  61. 1
    2
      source-linux/js/image.js
  62. 1
    1
      source-linux/js/layout.js
  63. 2
    2
      source-linux/js/news.js
  64. 16
    2
      source-linux/js/newsworker.js
  65. 1
    1
      source-linux/js/photoworker.js
  66. 34
    1
      source-linux/js/service.js
  67. 1
    1
      source-linux/js/smiley.js
  68. 1
    1
      source-linux/qml/calendarqml/CalendarDay.qml
  69. 1
    1
      source-linux/qml/calendarqml/CalendarTab.qml
  70. 1
    1
      source-linux/qml/calendarqml/EventList.qml
  71. 49
    5
      source-linux/qml/configqml/ConfigTab.qml
  72. 2
    2
      source-linux/qml/configqml/InfoBox.qml
  73. 1
    1
      source-linux/qml/configqml/OSSettingsAndroid.qml
  74. 1
    1
      source-linux/qml/configqml/OSSettingsLinux.qml
  75. 61
    0
      source-linux/qml/configqml/RegisterPage.qml
  76. 1
    1
      source-linux/qml/contactqml/ContactComponent.qml
  77. 2
    2
      source-linux/qml/contactqml/ContactDetailsComponent.qml
  78. 1
    1
      source-linux/qml/contactqml/Contactlist.qml
  79. 1
    1
      source-linux/qml/contactqml/FriendsTab.qml
  80. 1
    1
      source-linux/qml/contactqml/GroupComponent.qml
  81. 2
    1
      source-linux/qml/contactqml/ProfileComponent.qml
  82. 4
    2
      source-linux/qml/friendiqa.qml
  83. 3
    4
      source-linux/qml/newsqml/ContactPage.qml
  84. 3
    3
      source-linux/qml/newsqml/Conversation.qml
  85. 1
    1
      source-linux/qml/newsqml/FriendicaActivities.qml
  86. 1
    1
      source-linux/qml/newsqml/Hashtag.qml
  87. 1
    1
      source-linux/qml/newsqml/MessageSend.qml
  88. 1
    1
      source-linux/qml/newsqml/NewsImage.qml
  89. 52
    0
      source-linux/qml/newsqml/NewsLink.qml
  90. 8
    8
      source-linux/qml/newsqml/NewsTab.qml
  91. 1
    1
      source-linux/qml/newsqml/NewsVideo.qml
  92. 16
    2
      source-linux/qml/newsqml/Newsitem.qml
  93. 1
    1
      source-linux/qml/newsqml/PermissionDialog.qml
  94. 1
    1
      source-linux/qml/newsqml/SmileyDialog.qml
  95. 1
    1
      source-linux/qml/photoqml/ImageUploadDialog.qml
  96. 1
    1
      source-linux/qml/photoqml/PhotoComponent.qml
  97. 2
    2
      source-linux/qml/photoqml/PhotoTab.qml
  98. 1
    1
      source-linux/qml/photoqml/PhotogroupComponent.qml

+ 12
- 3
CHANGELOG.md View File

@@ -91,7 +91,16 @@
91 91
 
92 92
 
93 93
 ## v0.3.3 ##
94
-* Update for OpenSSL and Qt
95
-* Experimental support for Peertube (links are expanded for video widget)
96
-* Some unicode emojis
94
+* Update for OpenSSL and At
95
+* Experimental support for Peertube (links are expanded to video widget)
96
+* Some Unicode emojis
97 97
 * Redesign of contact details (click on contact opens in new stack and shows last news)
98
+
99
+
100
+## v0.3.4 ##
101
+* Direct message creation from profile page works again
102
+* Profile image upload works again
103
+* Viewing private album pictures of contacts works again
104
+* On first start servername from https://dir.friendica.social/servers/surprise selected
105
+* Register button opens webview of registration page on server
106
+

+ 1
- 1
PrivacyPolicy.md View File

@@ -5,5 +5,5 @@ You have probably selected Friendica as your preferred social network because yo
5 5
 
6 6
 Storing some pieces of user data on the device is necessary for some app features, other apps on your device may not access this data (keeping app’s own database storage protected from other apps is guaranteed by Android). The app has been programmed so that stored information contain any personal data (only login data and id number of last seen post will be transferred to servers). Photos from the albums and contact images are stored in a public directory on the device. Other apps may access these files and the Friendiqa needs access to this directory.
7 7
 To send images from the Android gallery the app needs access to picture databases on the device.
8
-
9 8
 This app don’t collect any usage statistics. In addition, no information is sent from your Smartphone to me as a developer or to a website associated with me.
9
+On first start, the website https://dir.friendica.social/servers/surprise is contacted and the selected server shown in the app.

+ 1
- 1
source-android/android/AndroidManifest.xml View File

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0"?>
2
-<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.3.3" android:versionCode="10" android:installLocation="auto">
2
+<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.3.4" android:versionCode="11" android:installLocation="auto">
3 3
     <application android:hardwareAccelerated="true" android:vmSafeMode="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Friendiqa" android:icon="@drawable/friendiqa" android:logo="@drawable/friendiqa" android:theme="@android:style/Theme.Holo.Light">
4 4
         <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="androidnative.friendiqa.FriendiqaActivity" android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleInstance" android:taskAffinity="">
5 5
             <intent-filter>

+ 2
- 0
source-android/application.qrc View File

@@ -223,5 +223,7 @@
223 223
         <file>qml/newsqml/NewsImage.qml</file>
224 224
         <file>qml/newsqml/NewsVideo.qml</file>
225 225
         <file>qml/newsqml/ContactPage.qml</file>
226
+        <file>qml/newsqml/NewsLink.qml</file>
227
+        <file>qml/configqml/RegisterPage.qml</file>
226 228
     </qresource>
227 229
 </RCC>

+ 1
- 1
source-android/friendiqa.pro View File

@@ -13,7 +13,7 @@
13 13
 TEMPLATE = app
14 14
 TARGET = friendiqa
15 15
 CONFIG += release
16
-QT += qml quick gui widgets androidextras
16
+QT += qml quick gui widgets androidextras sql webview
17 17
 
18 18
 include(androidnative.pri/androidnative.pri)
19 19
 

+ 1
- 1
source-android/js/friendworker.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 2
source-android/js/helper.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -151,7 +151,7 @@ var where = " AND "+ filter +" = '" + filtervalue+"'";
151 151
  });
152 152
 }
153 153
 
154
-function showMessage(header,message,rootwindow){
154
+function showMessage(header,message,rootwindow){print(message);
155 155
     var cleanmessage=message.replace(/"/g,"-");
156 156
     if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
157 157
     var messageString='import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:"'+header+'";standardButtons: StandardButton.Ok; text:" '+cleanmessage+'"}';

+ 1
- 2
source-android/js/image.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -175,7 +175,6 @@ function deleteContacts(database,user,callback) { // does nothing useful at the
175 175
 function newRequestFriendsAlbumPictures(login,friend,rootwindow,callback){
176 176
 // screenscraping of albums page of contact with remoteAuth
177 177
     Helperjs.friendicaRemoteAuthRequest(login,friend.url.replace("profile","photos"),friend.url,rootwindow,function(photohtml){
178
-            //print("Photohtml: "+photohtml);
179 178
         try {var obj=JSON.parse(photohtml);
180 179
             if (obj.hasOwnProperty('status')){
181 180
                 Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){

+ 1
- 1
source-android/js/layout.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 2
source-android/js/news.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -465,7 +465,7 @@ function chatsfromdb(database,user,callback,stop_time){
465 465
         helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
466 466
         helpernews.text=Qt.atob(helpernews.text);
467 467
         helpernews.id=helpernews.status_id;
468
-        if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
468
+        if (helpernews.attachments!==null){print(Qt.atob(helpernews.attachments));helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
469 469
         newsArray.push(helpernews);
470 470
     }
471 471
     callback(newsArray);

+ 16
- 2
source-android/js/newsworker.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -31,7 +31,7 @@
31 31
 
32 32
 function findend (text, startpos) {
33 33
     var indexOf = text.substring(startpos || 0).search(/\s/);
34
-    return (indexOf >= 0) ? (indexOf + (startpos || 0)) : indexOf;
34
+    return (indexOf >= 0) ? (indexOf + (startpos || 0)) : text.length;
35 35
 }
36 36
 
37 37
 
@@ -135,6 +135,20 @@ else{
135 135
                if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=ptvideohelper.url)){attachmentList.push(ptvideohelper)}
136 136
            }
137 137
       }
138
+//        if (newsitemobject.text.indexOf(".html")>-1){
139
+//            //print("message "+msg.options.showWebsiteForLinks);
140
+//           if (msg.options.showWebsiteForLinks!="false"){
141
+//               var linkhelper={mimetype:"text/html"}
142
+//               var linktext=newsitemobject.text;
143
+//               while (linktext.indexOf(".html")>-1){
144
+//                   var linkhelperstringposition=linktext.indexOf(".html");
145
+//                   var linkposend=findend(linktext,linkhelperstringposition);
146
+//                   linkhelper.url=linktext.substring(linktext.lastIndexOf("http",linkhelperstringposition),linkposend);
147
+//                   linktext=linktext.substring(linkhelperstringposition+5,linktext.length)
148
+//                   if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=linkhelper.url)){attachmentList.push(linkhelper)}
149
+//               }
150
+//           }
151
+//      }
138 152
 
139 153
         newsitemobject.attachmentList=attachmentList;
140 154
 

+ 1
- 1
source-android/js/photoworker.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 34
- 1
source-android/js/service.js View File

@@ -1,4 +1,5 @@
1
-//  This file is part of Friendiqa //  https://github.com/lubuwest/Friendiqa
1
+//  This file is part of Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
2 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
3 4
 //
4 5
 //  This program is free software: you can redistribute it and/or modify
@@ -48,6 +49,7 @@ function initDatabase(database) { // initialize the database object
48 49
            tx.executeSql('CREATE TABLE IF NOT EXISTS profiles(username TEXT, id INT, profiledata TEXT)');
49 50
         tx.executeSql('CREATE TABLE IF NOT EXISTS groups(username TEXT, groupname TEXT, gid INT, members TEXT)');
50 51
         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)');
52
+        tx.executeSql('CREATE TABLE IF NOT EXISTS globaloptions(k TEXT, v TEXT)')
51 53
 })}
52 54
 
53 55
 function cleanPermissions(oldperms){
@@ -293,6 +295,31 @@ function readActiveConfig(database){
293 295
   return obj;
294 296
 }
295 297
 
298
+function readGlobaloptions(database,callback){
299
+    var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
300
+    var go=({});
301
+    db.transaction( function(tx) {
302
+        var rs = tx.executeSql('select * from globaloptions');
303
+        for (var r=0; r<rs.rows.length; r++){
304
+            go[rs.rows.item(r).k]=rs.rows.item(r).v
305
+        }
306
+        callback(go)
307
+    })
308
+
309
+}
310
+
311
+function updateglobaloptions(database,key,value){
312
+    var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
313
+    db.transaction( function(tx) {
314
+        var result = tx.executeSql('SELECT * from globaloptions where k="'+key+'"'); // check for key
315
+        if(result.rows.length === 1) {// use update
316
+            result = tx.executeSql('UPDATE globaloptions SET v="'+value+'" WHERE k="'+key+'"')
317
+        } else {// use insert
318
+                result = tx.executeSql('INSERT INTO globaloptions (k,v) VALUES (?,?)', [key,value])
319
+        }
320
+    })
321
+ }
322
+
296 323
 function deleteConfig(database,userobj,callback) { // delete user data from DB
297 324
     if (userobj){var where = " WHERE username='"+ userobj.username+"' and server='"+userobj.server+"'";} else { return "no user selected!";}
298 325
     var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
@@ -486,6 +513,9 @@ function updateView(viewtype){
486 513
     //downloadNotice.text="xhr start "+Date.now()
487 514
     switch(viewtype){
488 515
         case "Conversations":
516
+//            updatenews.setDatabase();
517
+//            updatenews.login();
518
+//            updatenews.timeline();
489 519
             var lastnews=Newsjs.getLastNews(login,db);
490 520
             xhr.setLogin(login.username+":"+Qt.atob(login.password));
491 521
             xhr.setUrl(login.server);
@@ -495,6 +525,9 @@ function updateView(viewtype){
495 525
             xhr.setParam("count",50)
496 526
             break;
497 527
         case "Timeline":
528
+//             updatenews.setDatabase();
529
+//            updatenews.login();
530
+//            updatenews.timeline();
498 531
             var lastnews=Newsjs.getLastNews(login,db);
499 532
             xhr.setLogin(login.username+":"+Qt.atob(login.password));
500 533
             xhr.setUrl(login.server);

+ 1
- 1
source-android/js/smiley.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/calendarqml/CalendarDay.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/calendarqml/CalendarTab.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/calendarqml/EventList.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 50
- 5
source-android/qml/configqml/ConfigTab.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -123,6 +123,11 @@ StackView{
123 123
         visible: false
124 124
         x: 4*mm; y: 70*mm; width:20*mm;wrapMode: Text.Wrap
125 125
       }
126
+      
127
+//      Text {
128
+//          text: qsTr("Show Website")
129
+//          x: 4*mm; y: 70*mm; width: 20*mm
130
+//      }
126 131
 
127 132
         Image{
128 133
             id:servericon
@@ -176,12 +181,15 @@ StackView{
176 181
 
177 182
      Rectangle{
178 183
          color: "light grey"
179
-         x: 25*mm; y: 20*mm; width: root.width/2; height: 5*mm;
184
+         x: 25*mm; y: 20*mm; width: root.width/2-9*mm; height: 5*mm;
180 185
          TextInput {
181 186
              id: username
182 187
              anchors.fill: parent
183 188
              selectByMouse: true
184
-             //onEditingFinished:{
189
+            onEditingFinished:{
190
+                if (username.text.indexOf('@')>-1){
191
+                    Helperjs.showMessage(qsTr("Error"),qsTr("Nicknames containing @ symbol currently not supported"),configBackground)
192
+                }
185 193
              //    Helperjs.friendicaWebRequest(servername.text+'/api/users/show?screen_name='+username.text,configBackground,function(obj){
186 194
              //        var screennametest=JSON.parse(obj);
187 195
             //         if (screennametest.hasOwnProperty('status')){
@@ -190,8 +198,16 @@ StackView{
190 198
            //          }else{configBackground.registeredUser=true}
191 199
            //      });
192 200
            //  }
193
-        }
201
+            }
202
+         }
194 203
     }
204
+     BlueButton {
205
+         x: root.width/2+18*mm; y: 20*mm; width:7*mm
206
+         text: "\uf234"
207
+         onClicked: {
208
+             configStack.push({item:"qrc:/qml/configqml/RegisterPage.qml",properties:{url:servername.text+"/register?nickname="+username.getText(0,username.length)}})
209
+         }
210
+     }
195 211
 
196 212
     Rectangle{
197 213
         color: "light grey"
@@ -284,6 +300,23 @@ StackView{
284 300
      }
285 301
 
286 302
 
303
+
304
+//    CheckBox{
305
+//        id:showwebsiteCheckbox
306
+//        x:35*mm;y:70*mm
307
+//        onClicked:{
308
+//            if (checked==true){
309
+//                Service.updateglobaloptions(root.db,"showWebsiteForLinks","true")
310
+//                root.globaloptions.showWebsiteForLinks="true"
311
+//            }
312
+//            else {
313
+//                Service.updateglobaloptions(root.db,"showWebsiteForLinks","false")
314
+//                root.globaloptions.showWebsiteForLinks="false"
315
+//            }
316
+//        }
317
+        
318
+//    }
319
+
287 320
     BlueButton {
288 321
     x: 25*mm; y: 78*mm
289 322
     text: qsTr("Confirm")
@@ -328,6 +361,8 @@ StackView{
328 361
          else {Helperjs.showMessage(qsTr("Error"), errormessage,root)}
329 362
     }}
330 363
 
364
+
365
+
331 366
     BlueButton {
332 367
     x: root.width/2+2*mm; y: mm; width: 5*mm; height: 5*mm;
333 368
     text: "-"
@@ -413,8 +448,18 @@ StackView{
413 448
             messageIntervalSlider.value=obj.timerInterval;
414 449
             if( obj.isActive==0){userButton.fontColor='black'} else {userButton.fontColor='grey'}},"isActive",0
415 450
             )
451
+          })
452
+            //Service.readGlobaloptions(db,function(go){
453
+//                if (root.globaloptions.showWebsiteForLinks!="false"){showwebsiteCheckbox.checked=true}
454
+            //})
455
+  
456
+          }
457
+      catch (e){
458
+          Helperjs.friendicaWebRequest("https://dir.friendica.social/servers/surprise",configBackground,function(html){
459
+              var bpos=html.indexOf("baseurl");
460
+              var baseurl=html.substring(html.indexOf("http",bpos),html.indexOf('"',html.indexOf("http",bpos)));
461
+              servername.text=baseurl
416 462
           })}
417
-      catch (e){print(e)}
418 463
     }
419 464
 }
420 465
 }

+ 2
- 2
source-android/qml/configqml/InfoBox.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -43,7 +43,7 @@ Rectangle{
43 43
         textFormat: Text.RichText
44 44
         width: parent.width
45 45
         wrapMode: Text.WrapAtWordBoundaryOrAnywhere
46
-        text: "<b>Friendiqa v0.3.3 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
46
+        text: "<b>Friendiqa v0.3.4 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
47 47
               "Profile <a href='https://freunde.ma-nic.de/profile/friendiqa'>https://freunde.ma-nic.de/profile/friendiqa</a><br>"+
48 48
               "Sourcecode: <a href='https://git.friendi.ca/LubuWest/Friendiqa'>https://git.friendi.ca/LubuWest/Friendiqa</a><br>"+
49 49
                "Most of C++ code by <a href='https://kirgroup.com/profile/fabrixxm'>Fabio</a><br>"+

+ 1
- 1
source-android/qml/configqml/OSSettingsAndroid.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/configqml/OSSettingsLinux.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 61
- 0
source-android/qml/configqml/RegisterPage.qml View File

@@ -0,0 +1,61 @@
1
+//  This file is part of Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3
+//  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4
+//
5
+//  This program is free software: you can redistribute it and/or modify
6
+//  it under the terms of the GNU General Public License as published by
7
+//  the Free Software Foundation, either version 3 of the License, or
8
+//  (at your option) any later version.
9
+//
10
+//  In addition, as a special exception, the copyright holders give
11
+//  permission to link the code of portions of this program with the
12
+//  OpenSSL library under certain conditions as described in each
13
+//  individual source file, and distribute linked combinations including
14
+//  the two.
15
+//
16
+//  You must obey the GNU General Public License in all respects for all
17
+//  of the code used other than OpenSSL. If you modify file(s) with this
18
+//  exception, you may extend this exception to your version of the
19
+//  file(s), but you are not obligated to do so. If you do not wish to do
20
+//  so, delete this exception statement from your version. If you delete
21
+//  this exception statement from all source files in the program, then
22
+//  also delete it here.
23
+//
24
+//  This program is distributed in the hope that it will be useful,
25
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
+//  GNU General Public License for more details.
28
+//
29
+//  You should have received a copy of the GNU General Public License
30
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
31
+
32
+import QtQuick 2.9
33
+import QtWebView 1.1
34
+import "qrc:/qml/genericqml"
35
+
36
+Rectangle{
37
+    color:"white"
38
+    //border.color: "light grey"
39
+    property alias url:htmlview.url
40
+    width:root.width-5*mm
41
+    height:root.height-12*mm
42
+
43
+    WebView {id:htmlview;
44
+        height:parent.height-7*mm
45
+        width:parent.width
46
+        y:7*mm
47
+        MouseArea {anchors.fill:parent;
48
+            onClicked:{print(url)}
49
+        }
50
+        onLoadingChanged: print(loadProgress)
51
+    }
52
+    BlueButton{
53
+        id:closeButton
54
+        anchors.top: parent.top
55
+        anchors.topMargin: 1*mm
56
+        anchors.right: parent.right
57
+        anchors.rightMargin: 1*mm
58
+        text:   "\uf057"
59
+        onClicked:{configStack.pop()}
60
+     }
61
+}

+ 1
- 1
source-android/qml/contactqml/ContactComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 2
source-android/qml/contactqml/ContactDetailsComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -113,7 +113,7 @@ Rectangle{
113 113
                     fotostab.phototabstatus="Contact";
114 114
                     root.currentIndex=2;
115 115
                     fotostab.active=true;
116
-                    root.fotoSignal(root.login,contact) ;
116
+                    root.fotoSignal(contact) ;
117 117
                     contactLargeComponent.destroy();
118 118
                     }
119 119
              }

+ 1
- 1
source-android/qml/contactqml/Contactlist.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/contactqml/FriendsTab.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/contactqml/GroupComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 1
source-android/qml/contactqml/ProfileComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -141,6 +141,7 @@ Rectangle {
141 141
         MouseArea{
142 142
                 anchors.fill: parent
143 143
                 onClicked:{
144
+                    imagePicking=true;
144 145
                     var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
145 146
                     osSettings.imagePickQml+'{multiple: false;onReady: {photoImage.source=imageUrl;'+
146 147
                     '}}',profileGridTab,"imagePicker");

+ 4
- 2
source-android/qml/friendiqa.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -56,10 +56,11 @@ TabView{
56 56
 
57 57
     property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
58 58
     property var login: Service.readActiveConfig(db)
59
+    property var globaloptions: ({}) //Service.readGlobaloptions(db)
59 60
     property var contactlist: []
60 61
     property real mm: Screen.pixelDensity
61 62
     signal messageSignal(var friend)
62
-    signal fotoSignal(var login, var friend)
63
+    signal fotoSignal(var username, var friend)
63 64
     signal directmessageSignal(var friend)
64 65
     signal newsSignal(var news)
65 66
     signal friendsSignal(var username)
@@ -191,6 +192,7 @@ TabView{
191 192
         source: (root.currentIndex==4)?"qrc:/qml/configqml/ConfigTab.qml":""
192 193
     }
193 194
     Component.onCompleted: {
195
+        Service.readGlobaloptions(db,function(go){globaloptions=go})
194 196
         //print(xhr.networktype);
195 197
         if(osSettings.imagePickQml=="ImagePicker"){var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
196 198
             var IntentReceiverQml = component.createObject(root)

+ 3
- 4
source-android/qml/newsqml/ContactPage.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -110,7 +110,6 @@ Rectangle {
110 110
                           onClicked:{
111 111
                               currentIndex=0;
112 112
                               directmessageSignal(contact.screen_name)
113
-                              newsStack.pop()
114 113
                           }
115 114
                       }
116 115
 
@@ -126,7 +125,7 @@ Rectangle {
126 125
                           }
127 126
                       }
128 127
 
129
-                  }//Row end
128
+                  }//Column end
130 129
                Label {
131 130
                    id: namelabel
132 131
                    x:mm
@@ -168,7 +167,7 @@ Rectangle {
168 167
             contactBusy.running=false;
169 168
             contactModel.clear();
170 169
             var currentTime= new Date();
171
-            var msg = {'currentTime': currentTime, 'model': contactModel,'news':newstab.contactposts};
170
+            var msg = {'currentTime': currentTime, 'model': contactModel,'news':newstab.contactposts, 'options':globaloptions};
172 171
             contactWorker.sendMessage(msg)
173 172
         }
174 173
     }

+ 3
- 3
source-android/qml/newsqml/Conversation.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -81,7 +81,7 @@ Rectangle {
81 81
                 } else { conversationBusy.running=false;
82 82
                   conversationModel.clear();
83 83
                   var currentTime= new Date();
84
-                  var msg = {'currentTime': currentTime, 'model': conversationModel,'news':newstab.conversation};
84
+                  var msg = {'currentTime': currentTime, 'model': conversationModel,'news':newstab.conversation, 'options':globaloptions};
85 85
                   conversationWorker.sendMessage(msg)
86 86
                   //conversationsymbol.color="grey"
87 87
                 }
@@ -112,7 +112,7 @@ Rectangle {
112 112
                 wrapMode: Text.Wrap
113 113
                 anchors.fill: parent
114 114
                 selectByMouse: true
115
-                onHeightChanged: newsView.contentY+=4.5*mm
115
+                onHeightChanged: conversationView.contentY+=4.5*mm
116 116
                 }
117 117
            }
118 118
 

+ 1
- 1
source-android/qml/newsqml/FriendicaActivities.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/newsqml/Hashtag.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/newsqml/MessageSend.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/newsqml/NewsImage.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 52
- 0
source-android/qml/newsqml/NewsLink.qml View File

@@ -0,0 +1,52 @@
1
+//  This file is part of Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3
+//  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4
+//
5
+//  This program is free software: you can redistribute it and/or modify
6
+//  it under the terms of the GNU General Public License as published by
7
+//  the Free Software Foundation, either version 3 of the License, or
8
+//  (at your option) any later version.
9
+//
10
+//  In addition, as a special exception, the copyright holders give
11
+//  permission to link the code of portions of this program with the
12
+//  OpenSSL library under certain conditions as described in each
13
+//  individual source file, and distribute linked combinations including
14
+//  the two.
15
+//
16
+//  You must obey the GNU General Public License in all respects for all
17
+//  of the code used other than OpenSSL. If you modify file(s) with this
18
+//  exception, you may extend this exception to your version of the
19
+//  file(s), but you are not obligated to do so. If you do not wish to do
20
+//  so, delete this exception statement from your version. If you delete
21
+//  this exception statement from all source files in the program, then
22
+//  also delete it here.
23
+//
24
+//  This program is distributed in the hope that it will be useful,
25
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
+//  GNU General Public License for more details.
28
+//
29
+//  You should have received a copy of the GNU General Public License
30
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
31
+
32
+import QtQuick 2.9
33
+import "qrc:/js/helper.js" as Helperjs
34
+//import QtWebView 1.1
35
+
36
+Rectangle{
37
+    color:"transparent"
38
+    width:newscolumn.width;
39
+    height:newscolumn.width/4*3
40
+    property string url:""//htmlview.text
41
+
42
+    Text{id:htmlview
43
+        textFormat:Text.RichText
44
+    }
45
+//    WebView {id:htmlview;
46
+//        anchors.fill: parent
47
+//    }
48
+    Component.onCompleted: //Helperjs.friendicaWebRequest(url,parent,function(html){
49
+        //print(html);
50
+        htmlview.text="Text <iframe src='"+url+"' width = '300px' height = '300px'>"
51
+    //})
52
+}

+ 8
- 8
source-android/qml/newsqml/NewsTab.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -87,7 +87,7 @@ Item {
87 87
        var currentTime= new Date();
88 88
       // downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
89 89
        //print("appendnews "+newsStack.appendNews +JSON.stringify(newsToShow))
90
-       var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'method':newsStack.updateMethodNews};
90
+       var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'method':newsStack.updateMethodNews, 'options':globaloptions};
91 91
        newsWorker.sendMessage(msg);
92 92
        //newsStack.appendNews=false
93 93
     }
@@ -146,8 +146,8 @@ Item {
146 146
     }
147 147
 
148 148
     function onDirectMessage(friend){
149
-        newstab.newstabstatus="SendMessage"
150
-        newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": friend,"directmessage":1,"login":root.login}});
149
+        //newstab.newstabstatus="SendMessage" ,"login":login ,
150
+        newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": friend,"directmessage":1, "login":root.login}});
151 151
     }
152 152
 
153 153
     function sendUrls(urls){print(root.currentIndex==0);
@@ -335,12 +335,12 @@ Item {
335 335
                         var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;
336 336
                         if(newstab.newstabstatus=="Timeline"){
337 337
                             Newsjs.newsfromdb(root.db,root.login.username, function(news){
338
-                                var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
338
+                                var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true, 'options':globaloptions};
339 339
                                 newsWorker.sendMessage(msg);
340 340
                             },false,lastnews_id)}
341 341
                         if(newstab.newstabstatus=="Conversations"){
342 342
                             Newsjs.chatsfromdb(root.db,root.login.username, function(news){
343
-                                var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
343
+                                var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true, 'options':globaloptions};
344 344
                                 newsWorker.sendMessage(msg);
345 345
                             },lastnews_id)}
346 346
 //                        else if(newstab.newstabstatus=="Contact"){
@@ -424,8 +424,8 @@ Item {
424 424
            root.uploadSignal.connect(sendUrls);
425 425
            root.sendtextSignal.connect(sendtext);
426 426
            try{newsModel.clear()} catch(e){}
427
-           xhr.setLogin(login.username+":"+Qt.atob(login.password));
428
-           xhr.setUrl(login.server);
427
+//           xhr.setLogin(login.username+":"+Qt.atob(login.password));
428
+//           xhr.setUrl(login.server);
429 429
             if(root.news.length>0){showNews(root.news)}
430 430
             else{ newstab.newstabstatus=login.newsViewType; 
431 431
                 if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}

+ 1
- 1
source-android/qml/newsqml/NewsVideo.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 18
- 7
source-android/qml/newsqml/Newsitem.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -134,11 +134,8 @@ Item {
134 134
                 MouseArea{
135 135
                     anchors.fill:parent
136 136
                     onClicked: {
137
-                        conversationsymbol.color="black";
138
-                        newsView.contentY+=newsitem.height;
139
-                        var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
140
-                        var conversationItem = component.createObject(friendicaActivities,{"news":newsitemobject.chatArray});
141
-                        showConversation(index,newsitemobject);
137
+                        newsStack.push("qrc:/qml/newsqml/Conversation.qml");
138
+                        showConversation(index,newsitemobject)
142 139
                     }
143 140
                 }
144 141
             }
@@ -186,7 +183,12 @@ Item {
186 183
                         if(newsitemobject.attachmentList[attachments].mimetype.substring(0,5)=="image"){
187 184
                             var component = Qt.createComponent("qrc:/qml/newsqml/NewsImage.qml");
188 185
                             var imageQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
189
-                        } else {//print(newsitemobject.attachmentList[attachments].url+" Type: "+newsitemobject.attachmentList[attachments].mimetype)
186
+                        }
187
+//                        else if(newsitemobject.attachmentList[attachments].mimetype=="text/html"){
188
+//                            var component = Qt.createComponent("qrc:/qml/newsqml/NewsLink.qml");
189
+//                            var linkQml = component.createObject(messageColumn,{"url":newsitemobject.attachmentList[attachments].url});
190
+//                        }
191
+                        else {//print(newsitemobject.attachmentList[attachments].url+" Type: "+newsitemobject.attachmentList[attachments].mimetype)
190 192
                             var component = Qt.createComponent("qrc:/qml/newsqml/NewsVideo.qml");
191 193
                             var videoQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
192 194
 }
@@ -459,6 +461,15 @@ Item {
459 461
                 })
460 462
             }
461 463
         }
464
+        MenuItem {
465
+            text: qsTr("Post")
466
+            onTriggered: {
467
+                Helperjs.friendicaPostRequest(root.login,"/item","preview=1&"+encodeURIComponent(newsitemobject.text),"POST",root,function(reply){
468
+                   print(reply)
469
+                })
470
+            }
471
+        }
472
+
462 473
         //MenuItem{
463 474
         //    text:qsTr("Show on website")
464 475
         //    onTriggered:Qt.openUrlExternally(login.server+"/display/"+newsitemobject

+ 1
- 1
source-android/qml/newsqml/PermissionDialog.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/newsqml/SmileyDialog.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/photoqml/ImageUploadDialog.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-android/qml/photoqml/PhotoComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 2
source-android/qml/photoqml/PhotoTab.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -115,7 +115,7 @@ StackView{
115 115
         else{
116 116
             try {photogroupModel.clear()}catch (e){print(e)}
117 117
             if (friend){
118
-                  Imagejs.newRequestFriendsAlbumPictures(login,friend,fotorectangle,function(albums,remoteAuthBool){
118
+                  Imagejs.newRequestFriendsAlbumPictures(root.login,friend,fotorectangle,function(albums,remoteAuthBool){
119 119
                     remoteContact=remoteAuthBool;
120 120
                     var msg = {'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture':true,'friend':friend}
121 121
                     photoWorker.sendMessage(msg);

+ 1
- 1
source-android/qml/photoqml/PhotogroupComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 0
source-linux/application.qrc View File

@@ -223,5 +223,7 @@
223 223
         <file>qml/newsqml/NewsImage.qml</file>
224 224
         <file>qml/newsqml/NewsVideo.qml</file>
225 225
         <file>qml/newsqml/ContactPage.qml</file>
226
+        <file>qml/newsqml/NewsLink.qml</file>
227
+        <file>qml/configqml/RegisterPage.qml</file>
226 228
     </qresource>
227 229
 </RCC>

+ 1
- 1
source-linux/common/filesystem.cpp View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/common/filesystem.h View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 8
- 2
source-linux/common/friendiqa.cpp View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -32,8 +32,10 @@
32 32
 #include <QApplication>
33 33
 #include <QtQml/QQmlEngine>
34 34
 #include <QtQuick>
35
+#include <QtWebView>
35 36
 #include "xhr.h"
36 37
 #include "filesystem.h"
38
+#include "updatenews.h"
37 39
 #include "remoteauthasyncimageprovider.h"
38 40
 //#include "AndroidNative/systemdispatcher.h"
39 41
 //#include "AndroidNative/environment.h"
@@ -60,17 +62,21 @@ int main(int argc, char *argv[]) {
60 62
     QTranslator qtTranslator;
61 63
     qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
62 64
     app.installTranslator(&qtTranslator);
65
+    QtWebView::initialize();
63 66
    RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
64 67
     view.engine()->addImageProvider("remoteauthimage",imageProvider);
65 68
     view.rootContext()->setContextProperty("remoteauth", imageProvider);
69
+    auto offlineStoragePath=QUrl::fromLocalFile(view.engine()->offlineStorageDatabaseFilePath("Friendiqa"));
70
+    view.rootContext()->setContextProperty("offlineStoragePath", offlineStoragePath);
66 71
     XHR* xhr = XHR::instance();
67 72
     view.rootContext()->setContextProperty("xhr", xhr);
68 73
     FILESYSTEM* filesystem = FILESYSTEM::instance();
69 74
     view.rootContext()->setContextProperty("filesystem", filesystem);
75
+//    UPDATENEWS* updatenews = UPDATENEWS::instance();
76
+//    view.rootContext()->setContextProperty("updatenews", updatenews);
70 77
     view.setSource(QUrl("qrc:/qml/friendiqa.qml"));
71 78
     view.show();
72 79
     view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
73 80
     return app.exec();
74
-
75 81
 }
76 82
 

+ 1
- 1
source-linux/common/remoteauthasyncimageprovider.cpp View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/common/remoteauthasyncimageprovider.h View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 341
- 0
source-linux/common/updatenews.cpp View File

@@ -0,0 +1,341 @@
1
+//  This file is part of Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3
+//  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4
+//
5
+//  This program is free software: you can redistribute it and/or modify
6
+//  it under the terms of the GNU General Public License as published by
7
+//  the Free Software Foundation, either version 3 of the License, or
8
+//  (at your option) any later version.
9
+//
10
+//  In addition, as a special exception, the copyright holders give
11
+//  permission to link the code of portions of this program with the
12
+//  OpenSSL library under certain conditions as described in each
13
+//  individual source file, and distribute linked combinations including
14
+//  the two.
15
+//
16
+//  You must obey the GNU General Public License in all respects for all
17
+//  of the code used other than OpenSSL. If you modify file(s) with this
18
+//  exception, you may extend this exception to your version of the
19
+//  file(s), but you are not obligated to do so. If you do not wish to do
20
+//  so, delete this exception statement from your version. If you delete
21
+//  this exception statement from all source files in the program, then
22
+//  also delete it here.
23
+//
24
+//  This program is distributed in the hope that it will be useful,
25
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
+//  GNU General Public License for more details.
28
+//
29
+//  You should have received a copy of the GNU General Public License
30
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
31
+
32
+#include "updatenews.h"
33
+
34
+#include <QHttpPart>
35
+#include <QTextCodec>
36
+#include <QUrlQuery>
37
+#include <QList>
38
+#include <QDataStream>
39
+#include <QJsonDocument>
40
+#include <QJsonObject>
41
+#include <QJsonArray>
42
+#include <QQmlEngine>
43
+#include <QSqlQuery>
44
+#include <QSqlRecord>
45
+#include <QSqlDatabase>
46
+#include <QSqlError>
47
+#include <QDateTime>
48
+#include "xhr.h"
49
+
50
+
51
+UPDATENEWS *UPDATENEWS::instance()
52
+{
53
+    static UPDATENEWS udn;
54
+    return &udn;
55
+}
56
+
57
+UPDATENEWS::UPDATENEWS(QObject *parent) : QObject(parent)
58
+{
59
+
60
+}
61
+
62
+void UPDATENEWS::setUrl(QString url)
63
+{
64
+   if (url!=m_url) {
65
+       m_url = url;
66
+       emit urlChanged(m_url);
67
+   }
68
+}
69
+
70
+
71
+void UPDATENEWS::setDatabase()
72
+{
73
+    static QQmlEngine qe;
74
+    QString db_url=qe.offlineStorageDatabaseFilePath("Friendiqa");
75
+    m_db = QSqlDatabase::addDatabase("QSQLITE");
76
+    m_db.setDatabaseName(QUrl("file://"+db_url+".sqlite").toLocalFile());
77
+    qDebug() << db_url;
78
+
79
+      if (!m_db.open())
80
+      {
81
+         qDebug() << "Error: connection with database fail " << m_db.lastError();
82
+      }
83
+      else
84
+      {
85
+         qDebug() << "Database: connection ok";
86
+      }
87
+}
88
+
89
+
90
+void UPDATENEWS::login()
91
+{
92
+    qDebug() << "login";
93
+    QSqlQuery query("SELECT * FROM config WHERE isActive=0",m_db);
94
+    qDebug() <<"size "<< query.size();
95
+    while (query.next())
96
+    {
97
+       username = query.value(1).toString();
98
+       QByteArray bpassword=query.value(2).toByteArray();
99
+       QString password=QByteArray::fromBase64(bpassword);
100
+       m_login=username+":"+password ;
101
+       //emit this->loginChanged(m_login);
102
+       m_url=query.value(0).toString();
103
+       QString isActive=query.value(7).toString();
104
+
105
+       qDebug() << " username " << username<< password << m_url << isActive;
106
+       //UPDATENEWS::connect(&UPDATENEWS::getLogin,SIGNAL(loginChanged(QString)),this,SLOT(XHR::login(QString)));
107
+       m_api="/api/statuses/friends_timeline";
108
+    }
109
+    //return m_login;
110
+}
111
+
112
+
113
+void UPDATENEWS::timeline()
114
+{
115
+    QSqlQuery query("SELECT status_id FROM news WHERE username='"+ username +"' ORDER BY status_id DESC LIMIT 1",m_db);
116
+    if (query.isActive() && query.isSelect()){query.first();};
117
+    QString lastid=query.value(0).toString();
118
+    //query.finish();
119
+    qDebug() << lastid << query.at();
120
+    clearParams();
121
+    setParam("since_id",lastid);
122
+    setParam("count","50");
123
+    get();
124
+    QObject::connect(this,&UPDATENEWS::success,this,&UPDATENEWS::store);
125
+}
126
+
127
+void UPDATENEWS::store(QByteArray serverreply,QString apiname)
128
+{
129
+    //qDebug() <<  serverreply;
130
+    QJsonDocument news;
131
+    QJsonParseError jsonerror;
132
+    news=QJsonDocument::fromJson(serverreply,&jsonerror);
133
+    qDebug() << news.isArray()<<news.isObject()<<news.isEmpty()<<jsonerror.errorString();
134
+    if (news.isArray()){
135
+     qDebug() << " isArray ";
136
+     //QJsonArray array = news.//news.toArray();
137
+     for (int i=0; i < news.array().count();i++){
138
+         QJsonValue newsitem=news[i];
139
+         QSqlQuery query(m_db);
140
+         query.prepare("INSERT INTO news (username,messagetype,text,created_at,in_reply_to_status_id,source,status_id,in_reply_to_user_id,geo,favorited,uid,statusnet_html,statusnet_conversation_id,friendica_activities,friendica_activities_self,attachments,friendica_owner) " "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
141
+         query.bindValue(0,username);
142
+         query.bindValue(1,"0");
143
+         query.bindValue(2, newsitem["text"].toString().toUtf8().toBase64());
144
+         QString sourcedate=newsitem["created_at"].toString();
145
+         QString formateddate=sourcedate.mid(0,3)+", "+sourcedate.mid(8,3)+sourcedate.mid(4,3)+sourcedate.mid(25,5)+sourcedate.mid(10,15);
146
+         query.bindValue(3,QDateTime::fromString(formateddate,Qt::RFC2822Date).toMSecsSinceEpoch() );
147
+         if(newsitem["in_reply_to_status_id"]!=QJsonValue::Null){query.bindValue(4, newsitem["in_reply_to_status_id"].toInt());};
148
+         query.bindValue(5,newsitem["source"]);
149
+         query.bindValue(6,newsitem["id"].toInt());
150
+         if(newsitem["in_reply_to_user_id"]!=QJsonValue::Null){ query.bindValue(7,newsitem["in_reply_to_user_id"].toInt());};
151
+         query.bindValue(8,newsitem["geo"]);
152
+         query.bindValue( 9, newsitem["favorited"].toInt());
153
+         query.bindValue(10, newsitem["user"]["id"].toInt());
154
+         query.bindValue(11, newsitem["statusnet_html"].toString().toUtf8().toBase64());
155
+         query.bindValue(12, newsitem["statusnet_conversation_id"].toInt());
156
+         QJsonArray likeArray;QJsonArray dislikeArray;QJsonArray attendyesArray;QJsonArray attendnoArray;QJsonArray attendmaybeArray;
157
+         if (newsitem.toObject().contains("friendica_activities")){
158
+             for (int a=0; a < newsitem["friendica_activities"]["like"].toArray().count();a++){
159
+                 likeArray.append(newsitem["friendica_activities"]["like"][a]["url"].toString());
160
+             }
161
+             for (int b=0; b < newsitem["friendica_activities"]["dislike"].toArray().count();b++){
162
+                 dislikeArray.append(newsitem["friendica_activities"]["dislike"][b]["url"].toString());
163
+             }
164
+             for (int c=0; c < newsitem["friendica_activities"]["attendyes"].toArray().count();c++){
165
+                 attendyesArray.append(newsitem["friendica_activities"]["attendyes"][c]["url"].toString());
166
+             }
167
+             for (int d=0; d < newsitem["friendica_activities"]["attendno"].toArray().count();d++){
168
+                 attendnoArray.append(newsitem["friendica_activities"]["attendno"][d]["url"].toString());
169
+             }
170
+             for (int e = 0; e < newsitem["friendica_activities"]["attendmaybe"].toArray().count();e++){
171
+                 attendmaybeArray.append(newsitem["friendica_activities"]["attendmaybe"][e]["url"].toString());
172
+             }
173
+         };
174
+         QJsonArray friendica_activities; friendica_activities={likeArray,dislikeArray,attendyesArray,attendnoArray,attendmaybeArray};
175
+         QJsonDocument activities; activities.setArray(friendica_activities);
176
+         query.bindValue(13,activities.toJson(QJsonDocument::Compact).toBase64());
177
+         query.bindValue(14,"[]");
178
+
179
+         if (newsitem["attachments"]!=QJsonValue::Undefined){
180
+             query.bindValue(15, QJsonDocument(newsitem["attachments"].toArray()).toJson(QJsonDocument::Compact).toBase64());
181
+         };
182
+
183
+         query.bindValue(16, newsitem["friendica_owner"]["url"]);
184
+         qDebug() << query.exec() <<query.lastError();
185
+         //query.finish();
186
+    }
187
+    }
188
+    QList<QJsonValue> newcontacts=findNewContacts(news);
189
+    updateContacts(newcontacts);
190
+
191
+    emit updatesuccess();
192
+}
193
+
194
+
195
+QList <QJsonValue> UPDATENEWS::findNewContacts(QJsonDocument news){
196
+    QSqlQuery query("SELECT profile_image_url FROM contacts",m_db);
197
+    QList<QString> imageurls;
198
+    while (query.next()){
199
+        imageurls.append(query.value(0).toString());
200
+    }
201
+    QList<QJsonValue> newcontacts;
202
+    QList<QString> newcontactimagelinks;
203
+    qDebug()<<news.array().count();
204
+    for (int i=0; i<news.array().count();i++){
205
+        if(imageurls.contains(news[i]["user"]["profile_image_url"].toString()) || newcontactimagelinks.contains(news[i]["user"]["profile_image_url"].toString())){
206
+            qDebug()<<"vorhanden";
207
+            }
208
+        else{ qDebug()<<"newcontact" <<news[i]["user"];
209
+            newcontacts.append(news[i]["user"]);
210
+            newcontactimagelinks.append(news[i]["user"]["profile_image_url"].toString());
211
+        }
212
+    }
213
+    return newcontacts;
214
+}
215
+
216
+
217
+void UPDATENEWS::updateContacts(QList<QJsonValue> contacts){
218
+    qint64 currentTime =QDateTime::currentMSecsSinceEpoch();
219
+    for (int i=0; i < contacts.count();i++){
220
+        QJsonValue contact=contacts[i];
221
+        QSqlQuery query(m_db);
222
+
223
+        query.prepare("INSERT INTO contacts username, id, name, screen_name, location,imageAge, "
224
+                      "profile_image_url, description, profile_image, url, protected, followers_count, "
225
+                      "friends_count, created_at, favourites_count, utc_offset, time_zone, statuses_count,"
226
+                      " following, verified, statusnet_blocking, notifications, statusnet_profile_url,"
227
+                      " cid, network, isFriend, timestamp"
228
+                      "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
229
+        query.bindValue(0,username);
230
+        query.bindValue(1, contact["id"]);
231
+        query.bindValue(2, contact["name"].toString().toUtf8().toBase64());
232
+        query.bindValue(3, contact["screen_name"]);
233
+        query.bindValue(4, contact["location"]);
234
+        query.bindValue(5, currentTime);
235
+        query.bindValue(6, contact["profile_image_url"]);
236
+        query.bindValue(7, contact["description"].toString().toUtf8().toBase64());
237
+        //query.bindValue(8,"")
238
+        query.bindValue(9, contact["url"]);
239
+        query.bindValue(10,contact["protected"]);
240
+        query.bindValue(11,contact["followers_count"]);
241
+        query.bindValue(12,contact["friends_count"]);
242
+        query.bindValue(13,contact["created_at"]);
243
+        query.bindValue(14,contact["favorites_count"]);
244
+        query.bindValue(15,contact["utc_offset"]);
245
+        query.bindValue(16,contact["time_zone"]);
246
+        query.bindValue(17,contact["statuses_count"]);
247
+        query.bindValue(18,contact["following"]);
248
+        query.bindValue(19,contact["verfied"]);
249
+        query.bindValue(20,contact["statusnet_blocking"]);
250
+        query.bindValue(21,contact["notifications"]);
251
+        query.bindValue(22,contact["statusnet_profile_url"]);
252
+        query.bindValue(23,contact["cid"]);
253
+        query.bindValue(24,contact["network"]);
254
+        query.bindValue(25, 1);
255
+        //query.bindValue(26,image_timestamp);
256
+
257
+    }
258
+}
259
+
260
+QString UPDATENEWS::url() const
261
+{
262
+    return m_url;
263
+}
264
+
265
+
266
+
267
+
268
+
269
+
270
+void UPDATENEWS::setParam(QString name, QString value)
271
+{
272
+    params.insert(name, value);
273
+}
274
+
275
+void UPDATENEWS::clearParams()
276
+{
277
+    files.clear();
278
+    params.clear();
279
+}
280
+
281
+
282
+void UPDATENEWS::get()
283
+{
284
+    QUrlQuery query;
285
+
286
+    QHashIterator<QString, QString> i(params);
287
+    while(i.hasNext()) {
288
+        i.next();
289
+        query.addQueryItem(i.key(), i.value());
290
+    }
291
+
292
+    QUrl requrl(m_url+m_api);
293
+    qDebug() << requrl;
294
+    requrl.setQuery(query);
295
+    QByteArray loginData = m_login.toLocal8Bit().toBase64();
296
+    QString headerData = "Basic " + loginData;
297
+    request.setRawHeader("Authorization", headerData.toLocal8Bit());
298
+    request.setUrl(requrl);
299
+    reply = manager.get(request);
300
+
301
+    connect(reply, &QNetworkReply::finished, this, &UPDATENEWS::onReplySuccess);
302
+    connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
303
+    connect(reply, &QNetworkReply::readyRead, this, &UPDATENEWS::onReadyRead);
304
+    connect(reply, &QNetworkReply::sslErrors, this, &UPDATENEWS::onSSLError);
305
+}
306
+
307
+void UPDATENEWS::onReplyError(QNetworkReply::NetworkError code)
308
+{
309
+    qDebug() << code;
310
+    emit this->error( bufferToString(), m_url,m_api, (int) code);
311
+    buffer.clear();
312
+    reply->deleteLater();
313
+}
314
+
315
+void UPDATENEWS::onReplySuccess()
316
+{
317
+    qDebug() << "!";
318
+    emit this->success( buffer, m_api);
319
+    buffer.clear();
320
+//    reply->deleteLater();
321
+}
322
+
323
+void UPDATENEWS::onReadyRead()
324
+{
325
+    qDebug() << ".";
326
+    buffer += reply->readAll();
327
+}
328
+
329
+void UPDATENEWS::onSSLError(const QList<QSslError> &errors)
330
+{
331
+    qDebug() << "XHR::onSSLError :" ;
332
+    QListIterator<QSslError> ierrs(errors);
333
+    while(ierrs.hasNext()) {
334
+        qDebug() << "\t" <<  ierrs.next().errorString();
335
+    }
336
+}
337
+
338
+QString UPDATENEWS::bufferToString()
339
+{
340
+    return QTextCodec::codecForName("utf-8")->toUnicode(buffer);
341
+}

+ 110
- 0
source-linux/common/updatenews.h View File

@@ -0,0 +1,110 @@
1
+//  This file is part of Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3
+//  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4
+//
5
+//  This program is free software: you can redistribute it and/or modify
6
+//  it under the terms of the GNU General Public License as published by
7
+//  the Free Software Foundation, either version 3 of the License, or
8
+//  (at your option) any later version.
9
+//
10
+//  In addition, as a special exception, the copyright holders give
11
+//  permission to link the code of portions of this program with the
12
+//  OpenSSL library under certain conditions as described in each
13
+//  individual source file, and distribute linked combinations including
14
+//  the two.
15
+//
16
+//  You must obey the GNU General Public License in all respects for all
17
+//  of the code used other than OpenSSL. If you modify file(s) with this
18
+//  exception, you may extend this exception to your version of the
19
+//  file(s), but you are not obligated to do so. If you do not wish to do
20
+//  so, delete this exception statement from your version. If you delete
21
+//  this exception statement from all source files in the program, then
22
+//  also delete it here.
23
+//
24
+//  This program is distributed in the hope that it will be useful,
25
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
+//  GNU General Public License for more details.
28
+//
29
+//  You should have received a copy of the GNU General Public License
30
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
31
+
32
+#ifndef UPDATENEWS_H
33
+#define UPDATENEWS_H
34
+
35
+#include <QObject>
36
+#include <QJsonObject>
37
+#include <QSqlDatabase>
38
+#include "xhr.h"
39
+
40
+class UPDATENEWS : public QObject
41
+{
42
+    Q_OBJECT
43
+    Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged)
44
+//    Q_PROPERTY(QString login READ login NOTIFY loginChanged)
45
+public:
46
+    static UPDATENEWS *instance();
47
+
48
+    explicit UPDATENEWS(QObject *parent = 0);
49
+  
50
+    QString url() const;
51
+    //QString login() const;
52
+
53
+signals:
54
+
55
+//    void loginChanged(QString login);
56
+    void urlChanged(QString url);
57
+    void updatesuccess();
58
+    //void apiChanged(QString api);
59
+
60
+
61
+    //network
62
+    void success(QByteArray data, QString api);
63
+    void error(QString data, QString url,QString api, int code);
64
+    //network
65
+
66
+public slots:
67
+    void setUrl(QString url);
68
+    //void setLogin();
69
+    //QString login();
70
+    void setDatabase();
71
+    void login();
72
+    void timeline();
73
+
74
+
75
+    //network
76
+    void onReplyError(QNetworkReply::NetworkError code);
77
+    void onReplySuccess();
78
+    void onReadyRead();
79
+    void onSSLError(const QList<QSslError> &errors);
80
+    void setParam(QString name, QString value);
81
+    void clearParams();
82
+    void get();
83
+    //network
84
+
85
+private:
86
+    QString m_url;
87
+    QString m_api;
88
+    QString m_login;
89
+    QString username;
90
+    QSqlDatabase m_db;
91
+    QList<QJsonValue> findNewContacts(QJsonDocument news);
92
+    //void timeline();
93
+    void store(QByteArray serverreply,QString apiname);
94
+    void updateContacts(QList<QJsonValue> contacts);
95
+
96
+
97
+
98
+    //network
99
+    QHash<QString, QString> params;
100
+    QHash<QString, QString> files;
101
+    QByteArray buffer;
102
+    QNetworkAccessManager manager;
103
+    QNetworkRequest request;
104
+    QNetworkReply *reply;
105
+    QNetworkConfiguration nc;
106
+    QString bufferToString();
107
+    //network
108
+};
109
+
110
+#endif // UPDATENEWS_H

+ 1
- 1
source-linux/common/uploadableimage.cpp View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/common/uploadableimage.h View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 2
source-linux/common/xhr.cpp View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -205,7 +205,7 @@ void XHR::get()
205 205
     }
206 206
 
207 207
     QUrl requrl(m_url+m_api);
208
-    //qDebug() << requrl;
208
+    qDebug() << requrl;
209 209
     requrl.setQuery(query);
210 210
     QByteArray loginData = m_login.toLocal8Bit().toBase64();
211 211
     QString headerData = "Basic " + loginData;

+ 1
- 1
source-linux/common/xhr.h View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 7
- 4
source-linux/friendiqa.pro View File

@@ -13,13 +13,14 @@
13 13
 TEMPLATE = app
14 14
 TARGET = friendiqa
15 15
 CONFIG += release
16
-QT += qml quick gui widgets 
16
+QT += qml quick gui widgets sql webview
17 17
 
18 18
 SOURCES += common/friendiqa.cpp \
19 19
 	common/uploadableimage.cpp \
20 20
 	common/xhr.cpp \
21 21
         common/filesystem.cpp \
22
-        common/remoteauthasyncimageprovider.cpp
22
+        common/remoteauthasyncimageprovider.cpp \
23
+    common/updatenews.cpp
23 24
 
24 25
 RESOURCES     = application.qrc
25 26
 
@@ -39,7 +40,8 @@ HEADERS += \
39 40
     common/uploadableimage.h \
40 41
     common/xhr.h \
41 42
     common/filesystem.h \   
42
-    common/remoteauthasyncimageprovider.h
43
+    common/remoteauthasyncimageprovider.h \
44
+    common/updatenews.h
43 45
     
44 46
 DISTFILES += \
45 47
     qml/calendarqml/*.qml \
@@ -52,4 +54,5 @@ DISTFILES += \
52 54
     qml/configqml/*.qml \
53 55
     js/*.js \
54 56
     qml/newsqml/Hashtag.qml \
55
-    qml/newsqml/NewsImage.qml
57
+    qml/newsqml/NewsImage.qml \
58
+    qml/newsqml/NewsLink.qml

+ 1
- 1
source-linux/js/friendworker.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 2
source-linux/js/helper.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -151,7 +151,7 @@ var where = " AND "+ filter +" = '" + filtervalue+"'";
151 151
  });
152 152
 }
153 153
 
154
-function showMessage(header,message,rootwindow){
154
+function showMessage(header,message,rootwindow){print(message);
155 155
     var cleanmessage=message.replace(/"/g,"-");
156 156
     if(cleanmessage.length>200){cleanmessage=cleanmessage.slice(0,200)+'...'}
157 157
     var messageString='import QtQuick 2.0; import QtQuick.Dialogs 1.2; MessageDialog{ visible: true; title:"'+header+'";standardButtons: StandardButton.Ok; text:" '+cleanmessage+'"}';

+ 1
- 2
source-linux/js/image.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -175,7 +175,6 @@ function deleteContacts(database,user,callback) { // does nothing useful at the
175 175
 function newRequestFriendsAlbumPictures(login,friend,rootwindow,callback){
176 176
 // screenscraping of albums page of contact with remoteAuth
177 177
     Helperjs.friendicaRemoteAuthRequest(login,friend.url.replace("profile","photos"),friend.url,rootwindow,function(photohtml){
178
-            //print("Photohtml: "+photohtml);
179 178
         try {var obj=JSON.parse(photohtml);
180 179
             if (obj.hasOwnProperty('status')){
181 180
                 Helperjs.friendicaWebRequest(friend.url.replace("profile","photos"),rootwindow,function(photohtml){

+ 1
- 1
source-linux/js/layout.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 2
source-linux/js/news.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -465,7 +465,7 @@ function chatsfromdb(database,user,callback,stop_time){
465 465
         helpernews.statusnet_html=Qt.atob(helpernews.statusnet_html);
466 466
         helpernews.text=Qt.atob(helpernews.text);
467 467
         helpernews.id=helpernews.status_id;
468
-        if (helpernews.attachments!==null){helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
468
+        if (helpernews.attachments!==null){print(Qt.atob(helpernews.attachments));helpernews.attachments=JSON.parse(Qt.atob(helpernews.attachments))};
469 469
         newsArray.push(helpernews);
470 470
     }
471 471
     callback(newsArray);

+ 16
- 2
source-linux/js/newsworker.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -31,7 +31,7 @@
31 31
 
32 32
 function findend (text, startpos) {
33 33
     var indexOf = text.substring(startpos || 0).search(/\s/);
34
-    return (indexOf >= 0) ? (indexOf + (startpos || 0)) : indexOf;
34
+    return (indexOf >= 0) ? (indexOf + (startpos || 0)) : text.length;
35 35
 }
36 36
 
37 37
 
@@ -135,6 +135,20 @@ else{
135 135
                if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=ptvideohelper.url)){attachmentList.push(ptvideohelper)}
136 136
            }
137 137
       }
138
+//        if (newsitemobject.text.indexOf(".html")>-1){
139
+//            //print("message "+msg.options.showWebsiteForLinks);
140
+//           if (msg.options.showWebsiteForLinks!="false"){
141
+//               var linkhelper={mimetype:"text/html"}
142
+//               var linktext=newsitemobject.text;
143
+//               while (linktext.indexOf(".html")>-1){
144
+//                   var linkhelperstringposition=linktext.indexOf(".html");
145
+//                   var linkposend=findend(linktext,linkhelperstringposition);
146
+//                   linkhelper.url=linktext.substring(linktext.lastIndexOf("http",linkhelperstringposition),linkposend);
147
+//                   linktext=linktext.substring(linkhelperstringposition+5,linktext.length)
148
+//                   if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=linkhelper.url)){attachmentList.push(linkhelper)}
149
+//               }
150
+//           }
151
+//      }
138 152
 
139 153
         newsitemobject.attachmentList=attachmentList;
140 154
 

+ 1
- 1
source-linux/js/photoworker.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 34
- 1
source-linux/js/service.js View File

@@ -1,4 +1,5 @@
1
-//  This file is part of Friendiqa //  https://github.com/lubuwest/Friendiqa
1
+//  This file is part of Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
2 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
3 4
 //
4 5
 //  This program is free software: you can redistribute it and/or modify
@@ -48,6 +49,7 @@ function initDatabase(database) { // initialize the database object
48 49
            tx.executeSql('CREATE TABLE IF NOT EXISTS profiles(username TEXT, id INT, profiledata TEXT)');
49 50
         tx.executeSql('CREATE TABLE IF NOT EXISTS groups(username TEXT, groupname TEXT, gid INT, members TEXT)');
50 51
         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)');
52
+        tx.executeSql('CREATE TABLE IF NOT EXISTS globaloptions(k TEXT, v TEXT)')
51 53
 })}
52 54
 
53 55
 function cleanPermissions(oldperms){
@@ -293,6 +295,31 @@ function readActiveConfig(database){
293 295
   return obj;
294 296
 }
295 297
 
298
+function readGlobaloptions(database,callback){
299
+    var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
300
+    var go=({});
301
+    db.transaction( function(tx) {
302
+        var rs = tx.executeSql('select * from globaloptions');
303
+        for (var r=0; r<rs.rows.length; r++){
304
+            go[rs.rows.item(r).k]=rs.rows.item(r).v
305
+        }
306
+        callback(go)
307
+    })
308
+
309
+}
310
+
311
+function updateglobaloptions(database,key,value){
312
+    var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
313
+    db.transaction( function(tx) {
314
+        var result = tx.executeSql('SELECT * from globaloptions where k="'+key+'"'); // check for key
315
+        if(result.rows.length === 1) {// use update
316
+            result = tx.executeSql('UPDATE globaloptions SET v="'+value+'" WHERE k="'+key+'"')
317
+        } else {// use insert
318
+                result = tx.executeSql('INSERT INTO globaloptions (k,v) VALUES (?,?)', [key,value])
319
+        }
320
+    })
321
+ }
322
+
296 323
 function deleteConfig(database,userobj,callback) { // delete user data from DB
297 324
     if (userobj){var where = " WHERE username='"+ userobj.username+"' and server='"+userobj.server+"'";} else { return "no user selected!";}
298 325
     var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
@@ -486,6 +513,9 @@ function updateView(viewtype){
486 513
     //downloadNotice.text="xhr start "+Date.now()
487 514
     switch(viewtype){
488 515
         case "Conversations":
516
+//            updatenews.setDatabase();
517
+//            updatenews.login();
518
+//            updatenews.timeline();
489 519
             var lastnews=Newsjs.getLastNews(login,db);
490 520
             xhr.setLogin(login.username+":"+Qt.atob(login.password));
491 521
             xhr.setUrl(login.server);
@@ -495,6 +525,9 @@ function updateView(viewtype){
495 525
             xhr.setParam("count",50)
496 526
             break;
497 527
         case "Timeline":
528
+//             updatenews.setDatabase();
529
+//            updatenews.login();
530
+//            updatenews.timeline();
498 531
             var lastnews=Newsjs.getLastNews(login,db);
499 532
             xhr.setLogin(login.username+":"+Qt.atob(login.password));
500 533
             xhr.setUrl(login.server);

+ 1
- 1
source-linux/js/smiley.js View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/calendarqml/CalendarDay.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/calendarqml/CalendarTab.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/calendarqml/EventList.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 49
- 5
source-linux/qml/configqml/ConfigTab.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -123,6 +123,11 @@ StackView{
123 123
         visible: false
124 124
         x: 4*mm; y: 70*mm; width:20*mm;wrapMode: Text.Wrap
125 125
       }
126
+      
127
+//      Text {
128
+//          text: qsTr("Show Website")
129
+//          x: 4*mm; y: 70*mm; width: 20*mm
130
+//      }
126 131
 
127 132
         Image{
128 133
             id:servericon
@@ -176,12 +181,15 @@ StackView{
176 181
 
177 182
      Rectangle{
178 183
          color: "light grey"
179
-         x: 25*mm; y: 20*mm; width: root.width/2; height: 5*mm;
184
+         x: 25*mm; y: 20*mm; width: root.width/2-9*mm; height: 5*mm;
180 185
          TextInput {
181 186
              id: username
182 187
              anchors.fill: parent
183 188
              selectByMouse: true
184
-             //onEditingFinished:{
189
+            onEditingFinished:{
190
+                if (username.text.indexOf('@')>-1){
191
+                    Helperjs.showMessage(qsTr("Error"),qsTr("Nicknames containing @ symbol currently not supported"),configBackground)
192
+                }
185 193
              //    Helperjs.friendicaWebRequest(servername.text+'/api/users/show?screen_name='+username.text,configBackground,function(obj){
186 194
              //        var screennametest=JSON.parse(obj);
187 195
             //         if (screennametest.hasOwnProperty('status')){
@@ -190,8 +198,16 @@ StackView{
190 198
            //          }else{configBackground.registeredUser=true}
191 199
            //      });
192 200
            //  }
193
-        }
201
+            }
202
+         }
194 203
     }
204
+     BlueButton {
205
+         x: root.width/2+18*mm; y: 20*mm; width:7*mm
206
+         text: "\uf234"
207
+         onClicked: {
208
+             configStack.push({item:"qrc:/qml/configqml/RegisterPage.qml",properties:{url:servername.text+"/register?nickname="+username.getText(0,username.length)}})
209
+         }
210
+     }
195 211
 
196 212
     Rectangle{
197 213
         color: "light grey"
@@ -284,6 +300,23 @@ StackView{
284 300
      }
285 301
 
286 302
 
303
+
304
+//    CheckBox{
305
+//        id:showwebsiteCheckbox
306
+//        x:35*mm;y:70*mm
307
+//        onClicked:{
308
+//            if (checked==true){
309
+//                Service.updateglobaloptions(root.db,"showWebsiteForLinks","true")
310
+//                root.globaloptions.showWebsiteForLinks="true"
311
+//            }
312
+//            else {
313
+//                Service.updateglobaloptions(root.db,"showWebsiteForLinks","false")
314
+//                root.globaloptions.showWebsiteForLinks="false"
315
+//            }
316
+//        }
317
+        
318
+//    }
319
+
287 320
     BlueButton {
288 321
     x: 25*mm; y: 78*mm
289 322
     text: qsTr("Confirm")
@@ -328,6 +361,8 @@ StackView{
328 361
          else {Helperjs.showMessage(qsTr("Error"), errormessage,root)}
329 362
     }}
330 363
 
364
+
365
+
331 366
     BlueButton {
332 367
     x: root.width/2+2*mm; y: mm; width: 5*mm; height: 5*mm;
333 368
     text: "-"
@@ -413,8 +448,17 @@ StackView{
413 448
             messageIntervalSlider.value=obj.timerInterval;
414 449
             if( obj.isActive==0){userButton.fontColor='black'} else {userButton.fontColor='grey'}},"isActive",0
415 450
             )
451
+          })
452
+            //Service.readGlobaloptions(db,function(go){
453
+//                if (root.globaloptions.showWebsiteForLinks!="false"){showwebsiteCheckbox.checked=true}
454
+            //})
455
+  
456
+          }
457
+      catch (e){
458
+          Helperjs.friendicaWebRequest("https://dir.friendica.social/servers/surprise",configBackground,function(html){
459
+            var baseurl=html.substring(html.indexOf("baseurl")+11,html.indexOf('"',html.indexOf("baseurl")+11))
460
+              servername.text=baseurl
416 461
           })}
417
-      catch (e){print(e)}
418 462
     }
419 463
 }
420 464
 }

+ 2
- 2
source-linux/qml/configqml/InfoBox.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -43,7 +43,7 @@ Rectangle{
43 43
         textFormat: Text.RichText
44 44
         width: parent.width
45 45
         wrapMode: Text.WrapAtWordBoundaryOrAnywhere
46
-        text: "<b>Friendiqa v0.3.3 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
46
+        text: "<b>Friendiqa v0.3.4 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
47 47
               "Profile <a href='https://freunde.ma-nic.de/profile/friendiqa'>https://freunde.ma-nic.de/profile/friendiqa</a><br>"+
48 48
               "Sourcecode: <a href='https://git.friendi.ca/LubuWest/Friendiqa'>https://git.friendi.ca/LubuWest/Friendiqa</a><br>"+
49 49
                "Most of C++ code by <a href='https://kirgroup.com/profile/fabrixxm'>Fabio</a><br>"+

+ 1
- 1
source-linux/qml/configqml/OSSettingsAndroid.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/configqml/OSSettingsLinux.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 61
- 0
source-linux/qml/configqml/RegisterPage.qml View File

@@ -0,0 +1,61 @@
1
+//  This file is part of Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3
+//  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4
+//
5
+//  This program is free software: you can redistribute it and/or modify
6
+//  it under the terms of the GNU General Public License as published by
7
+//  the Free Software Foundation, either version 3 of the License, or
8
+//  (at your option) any later version.
9
+//
10
+//  In addition, as a special exception, the copyright holders give
11
+//  permission to link the code of portions of this program with the
12
+//  OpenSSL library under certain conditions as described in each
13
+//  individual source file, and distribute linked combinations including
14
+//  the two.
15
+//
16
+//  You must obey the GNU General Public License in all respects for all
17
+//  of the code used other than OpenSSL. If you modify file(s) with this
18
+//  exception, you may extend this exception to your version of the
19
+//  file(s), but you are not obligated to do so. If you do not wish to do
20
+//  so, delete this exception statement from your version. If you delete
21
+//  this exception statement from all source files in the program, then
22
+//  also delete it here.
23
+//
24
+//  This program is distributed in the hope that it will be useful,
25
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
+//  GNU General Public License for more details.
28
+//
29
+//  You should have received a copy of the GNU General Public License
30
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
31
+
32
+import QtQuick 2.9
33
+import QtWebView 1.1
34
+import "qrc:/qml/genericqml"
35
+
36
+Rectangle{
37
+    color:"white"
38
+    //border.color: "light grey"
39
+    property alias url:htmlview.url
40
+    width:root.width-5*mm
41
+    height:root.height-12*mm
42
+
43
+    WebView {id:htmlview;
44
+        height:parent.height-7*mm
45
+        width:parent.width
46
+        y:7*mm
47
+        MouseArea {anchors.fill:parent;
48
+            onClicked:{print(url)}
49
+        }
50
+        onLoadingChanged: print(loadProgress)
51
+    }
52
+    BlueButton{
53
+        id:closeButton
54
+        anchors.top: parent.top
55
+        anchors.topMargin: 1*mm
56
+        anchors.right: parent.right
57
+        anchors.rightMargin: 1*mm
58
+        text:   "\uf057"
59
+        onClicked:{configStack.pop()}
60
+     }
61
+}

+ 1
- 1
source-linux/qml/contactqml/ContactComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 2
source-linux/qml/contactqml/ContactDetailsComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -113,7 +113,7 @@ Rectangle{
113 113
                     fotostab.phototabstatus="Contact";
114 114
                     root.currentIndex=2;
115 115
                     fotostab.active=true;
116
-                    root.fotoSignal(root.login,contact) ;
116
+                    root.fotoSignal(contact) ;
117 117
                     contactLargeComponent.destroy();
118 118
                     }
119 119
              }

+ 1
- 1
source-linux/qml/contactqml/Contactlist.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/contactqml/FriendsTab.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/contactqml/GroupComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 2
- 1
source-linux/qml/contactqml/ProfileComponent.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -141,6 +141,7 @@ Rectangle {
141 141
         MouseArea{
142 142
                 anchors.fill: parent
143 143
                 onClicked:{
144
+                    imagePicking=true;
144 145
                     var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
145 146
                     osSettings.imagePickQml+'{multiple: false;onReady: {photoImage.source=imageUrl;'+
146 147
                     '}}',profileGridTab,"imagePicker");

+ 4
- 2
source-linux/qml/friendiqa.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -56,10 +56,11 @@ TabView{
56 56
 
57 57
     property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
58 58
     property var login: Service.readActiveConfig(db)
59
+    property var globaloptions: ({}) //Service.readGlobaloptions(db)
59 60
     property var contactlist: []
60 61
     property real mm: Screen.pixelDensity
61 62
     signal messageSignal(var friend)
62
-    signal fotoSignal(var login, var friend)
63
+    signal fotoSignal(var username, var friend)
63 64
     signal directmessageSignal(var friend)
64 65
     signal newsSignal(var news)
65 66
     signal friendsSignal(var username)
@@ -191,6 +192,7 @@ TabView{
191 192
         source: (root.currentIndex==4)?"qrc:/qml/configqml/ConfigTab.qml":""
192 193
     }
193 194
     Component.onCompleted: {
195
+        Service.readGlobaloptions(db,function(go){globaloptions=go})
194 196
         //print(xhr.networktype);
195 197
         if(osSettings.imagePickQml=="ImagePicker"){var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
196 198
             var IntentReceiverQml = component.createObject(root)

+ 3
- 4
source-linux/qml/newsqml/ContactPage.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -110,7 +110,6 @@ Rectangle {
110 110
                           onClicked:{
111 111
                               currentIndex=0;
112 112
                               directmessageSignal(contact.screen_name)
113
-                              newsStack.pop()
114 113
                           }
115 114
                       }
116 115
 
@@ -126,7 +125,7 @@ Rectangle {
126 125
                           }
127 126
                       }
128 127
 
129
-                  }//Row end
128
+                  }//Column end
130 129
                Label {
131 130
                    id: namelabel
132 131
                    x:mm
@@ -168,7 +167,7 @@ Rectangle {
168 167
             contactBusy.running=false;
169 168
             contactModel.clear();
170 169
             var currentTime= new Date();
171
-            var msg = {'currentTime': currentTime, 'model': contactModel,'news':newstab.contactposts};
170
+            var msg = {'currentTime': currentTime, 'model': contactModel,'news':newstab.contactposts, 'options':globaloptions};
172 171
             contactWorker.sendMessage(msg)
173 172
         }
174 173
     }

+ 3
- 3
source-linux/qml/newsqml/Conversation.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -81,7 +81,7 @@ Rectangle {
81 81
                 } else { conversationBusy.running=false;
82 82
                   conversationModel.clear();
83 83
                   var currentTime= new Date();
84
-                  var msg = {'currentTime': currentTime, 'model': conversationModel,'news':newstab.conversation};
84
+                  var msg = {'currentTime': currentTime, 'model': conversationModel,'news':newstab.conversation, 'options':globaloptions};
85 85
                   conversationWorker.sendMessage(msg)
86 86
                   //conversationsymbol.color="grey"
87 87
                 }
@@ -112,7 +112,7 @@ Rectangle {
112 112
                 wrapMode: Text.Wrap
113 113
                 anchors.fill: parent
114 114
                 selectByMouse: true
115
-                onHeightChanged: newsView.contentY+=4.5*mm
115
+                onHeightChanged: conversationView.contentY+=4.5*mm
116 116
                 }
117 117
            }
118 118
 

+ 1
- 1
source-linux/qml/newsqml/FriendicaActivities.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/newsqml/Hashtag.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/newsqml/MessageSend.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/newsqml/NewsImage.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 52
- 0
source-linux/qml/newsqml/NewsLink.qml View File

@@ -0,0 +1,52 @@
1
+//  This file is part of Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3
+//  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4
+//
5
+//  This program is free software: you can redistribute it and/or modify
6
+//  it under the terms of the GNU General Public License as published by
7
+//  the Free Software Foundation, either version 3 of the License, or
8
+//  (at your option) any later version.
9
+//
10
+//  In addition, as a special exception, the copyright holders give
11
+//  permission to link the code of portions of this program with the
12
+//  OpenSSL library under certain conditions as described in each
13
+//  individual source file, and distribute linked combinations including
14
+//  the two.
15
+//
16
+//  You must obey the GNU General Public License in all respects for all
17
+//  of the code used other than OpenSSL. If you modify file(s) with this
18
+//  exception, you may extend this exception to your version of the
19
+//  file(s), but you are not obligated to do so. If you do not wish to do
20
+//  so, delete this exception statement from your version. If you delete
21
+//  this exception statement from all source files in the program, then
22
+//  also delete it here.
23
+//
24
+//  This program is distributed in the hope that it will be useful,
25
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
+//  GNU General Public License for more details.
28
+//
29
+//  You should have received a copy of the GNU General Public License
30
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
31
+
32
+import QtQuick 2.9
33
+import "qrc:/js/helper.js" as Helperjs
34
+//import QtWebView 1.1
35
+
36
+Rectangle{
37
+    color:"transparent"
38
+    width:newscolumn.width;
39
+    height:newscolumn.width/4*3
40
+    property string url:""//htmlview.text
41
+
42
+    Text{id:htmlview
43
+        textFormat:Text.RichText
44
+    }
45
+//    WebView {id:htmlview;
46
+//        anchors.fill: parent
47
+//    }
48
+    Component.onCompleted: //Helperjs.friendicaWebRequest(url,parent,function(html){
49
+        //print(html);
50
+        htmlview.text="Text <iframe src='"+url+"' width = '300px' height = '300px'>"
51
+    //})
52
+}

+ 8
- 8
source-linux/qml/newsqml/NewsTab.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -87,7 +87,7 @@ Item {
87 87
        var currentTime= new Date();
88 88
       // downloadNotice.text=downloadNotice.text + "\n shownews start "+ Date.now();
89 89
        //print("appendnews "+newsStack.appendNews +JSON.stringify(newsToShow))
90
-       var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'method':newsStack.updateMethodNews};
90
+       var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsToShow,'method':newsStack.updateMethodNews, 'options':globaloptions};
91 91
        newsWorker.sendMessage(msg);
92 92
        //newsStack.appendNews=false
93 93
     }
@@ -146,8 +146,8 @@ Item {
146 146
     }
147 147
 
148 148
     function onDirectMessage(friend){
149
-        newstab.newstabstatus="SendMessage"
150
-        newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": friend,"directmessage":1,"login":root.login}});
149
+        //newstab.newstabstatus="SendMessage" ,"login":login ,
150
+        newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": friend,"directmessage":1, "login":root.login}});
151 151
     }
152 152
 
153 153
     function sendUrls(urls){print(root.currentIndex==0);
@@ -335,12 +335,12 @@ Item {
335 335
                         var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;
336 336
                         if(newstab.newstabstatus=="Timeline"){
337 337
                             Newsjs.newsfromdb(root.db,root.login.username, function(news){
338
-                                var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
338
+                                var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true, 'options':globaloptions};
339 339
                                 newsWorker.sendMessage(msg);
340 340
                             },false,lastnews_id)}
341 341
                         if(newstab.newstabstatus=="Conversations"){
342 342
                             Newsjs.chatsfromdb(root.db,root.login.username, function(news){
343
-                                var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
343
+                                var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true, 'options':globaloptions};
344 344
                                 newsWorker.sendMessage(msg);
345 345
                             },lastnews_id)}
346 346
 //                        else if(newstab.newstabstatus=="Contact"){
@@ -424,8 +424,8 @@ Item {
424 424
            root.uploadSignal.connect(sendUrls);
425 425
            root.sendtextSignal.connect(sendtext);
426 426
            try{newsModel.clear()} catch(e){}
427
-           xhr.setLogin(login.username+":"+Qt.atob(login.password));
428
-           xhr.setUrl(login.server);
427
+//           xhr.setLogin(login.username+":"+Qt.atob(login.password));
428
+//           xhr.setUrl(login.server);
429 429
             if(root.news.length>0){showNews(root.news)}
430 430
             else{ newstab.newstabstatus=login.newsViewType; 
431 431
                 if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}

+ 1
- 1
source-linux/qml/newsqml/NewsVideo.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 16
- 2
source-linux/qml/newsqml/Newsitem.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify
@@ -186,7 +186,12 @@ Item {
186 186
                         if(newsitemobject.attachmentList[attachments].mimetype.substring(0,5)=="image"){
187 187
                             var component = Qt.createComponent("qrc:/qml/newsqml/NewsImage.qml");
188 188
                             var imageQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
189
-                        } else {//print(newsitemobject.attachmentList[attachments].url+" Type: "+newsitemobject.attachmentList[attachments].mimetype)
189
+                        }
190
+//                        else if(newsitemobject.attachmentList[attachments].mimetype=="text/html"){
191
+//                            var component = Qt.createComponent("qrc:/qml/newsqml/NewsLink.qml");
192
+//                            var linkQml = component.createObject(messageColumn,{"url":newsitemobject.attachmentList[attachments].url});
193
+//                        }
194
+                        else {//print(newsitemobject.attachmentList[attachments].url+" Type: "+newsitemobject.attachmentList[attachments].mimetype)
190 195
                             var component = Qt.createComponent("qrc:/qml/newsqml/NewsVideo.qml");
191 196
                             var videoQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
192 197
 }
@@ -459,6 +464,15 @@ Item {
459 464
                 })
460 465
             }
461 466
         }
467
+        MenuItem {
468
+            text: qsTr("Post")
469
+            onTriggered: {
470
+                Helperjs.friendicaPostRequest(root.login,"/item","preview=1&"+encodeURIComponent(newsitemobject.text),"POST",root,function(reply){
471
+                   print(reply)
472
+                })
473
+            }
474
+        }
475
+
462 476
         //MenuItem{
463 477
         //    text:qsTr("Show on website")
464 478
         //    onTriggered:Qt.openUrlExternally(login.server+"/display/"+newsitemobject

+ 1
- 1
source-linux/qml/newsqml/PermissionDialog.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa
2
+//  https://git.friendi.ca/lubuwest/Friendiqa
3 3
 //  Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
4 4
 //
5 5
 //  This program is free software: you can redistribute it and/or modify

+ 1
- 1
source-linux/qml/newsqml/SmileyDialog.qml View File

@@ -1,5 +1,5 @@
1 1
 //  This file is part of Friendiqa
2
-//  https://github.com/lubuwest/Friendiqa