git.iko.soy/cinny-click-packaging
on main help sign in
12 files changed+174−198
since splitsnapshots
unifiedsplit
.github/ISSUE_TEMPLATE/bug_report.md+32 .github/ISSUE_TEMPLATE/feature_request.md+22 .github/workflows/build.yml+31 .gitlab-ci.yml−59 README.md+1−3 manifest.json.in+1−1 patches/0008-Set-push-notifications-to-UTs-push-hook.patch+27−23 patches/0013-Disable-cinny-s-notification-sound.patch+36 po/cinny.nitanmarcel.pot+10−6 prebuild.sh+10−2 qml/Main.qml+4−97 qml/qml.qrc.depends−7
.github/ISSUE_TEMPLATE/bug_report.mdnew file+32
@@ -0,0 +1,32 @@
1+---
2+name: Bug report
3+about: Create a report to help us improve
4+title: ''
5+labels: ''
6+assignees: ''
7+
8+---
9+
10+# Please follow the general troubleshooting steps first:
11+
12+- [ ] This bug is not reproducible on https://app.cinny.in
13+- [ ] This bug is not mentioned in any issues here or in the [upstream repository](https://github.com/cinnyapp/cinny)
14+
15+**Describe the bug**
16+A clear and concise description of what the bug is.
17+
18+**To Reproduce**
19+Steps to reproduce the behavior:
20+1. Go to '...'
21+2. Click on '....'
22+3. Scroll down to '....'
23+4. See error
24+
25+**Expected behavior**
26+A clear and concise description of what you expected to happen.
27+
28+**Screenshots**
29+If applicable, add screenshots to help explain your problem.
30+
31+**Additional context**
32+Add any other context about the problem here.
.github/ISSUE_TEMPLATE/feature_request.mdnew file+22
@@ -0,0 +1,22 @@
1+---
2+name: Feature request
3+about: Suggest an idea for this project
4+title: ''
5+labels: ''
6+assignees: ''
7+
8+---
9+
10+- [ ] This feature request can't be implemented in the [upstream repository](https://github.com/cinnyapp/cinny)
11+
12+**Is your feature request related to a problem? Please describe.**
13+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
14+
15+**Describe the solution you'd like**
16+A clear and concise description of what you want to happen.
17+
18+**Describe alternatives you've considered**
19+A clear and concise description of any alternative solutions or features you've considered.
20+
21+**Additional context**
22+Add any other context or screenshots about the feature request here.
.github/workflows/build.ymlnew file+31
@@ -0,0 +1,31 @@
1+name: Clickable Build
2+
3+on:
4+ push:
5+
6+jobs:
7+ build:
8+ strategy:
9+ matrix:
10+ arch: [amd64, arm64, armhf]
11+ runs-on: ubuntu-latest
12+ steps:
13+ - name: Checkout
14+ uses: actions/checkout@v3
15+ with:
16+ submodules: 'true'
17+ - name: Parse version
18+ run: |
19+ echo ARTIFACT_VERSION=$(cat prebuild.sh | grep "export REPO_VERSION=" | awk -F'"' '$0=$2')$(cat prebuild.sh | grep "export CLICK_VERSION_PREFIX=" | awk -F'"' '$0=$2') >> $GITHUB_ENV
20+ - name: Install clickable
21+ run: |
22+ python3 -m pip install clickable-ut
23+ - name: Build
24+ run: |
25+ clickable build --arch ${{ matrix.arch }}
26+ - name: Upload Artifacts
27+ uses: actions/upload-artifact@v3
28+ with:
29+ name: cinny.nitanmarcel_${{ env.ARTIFACT_VERSION }}_${{ matrix.arch }}
30+ path: build/*/app/*.click
31+ if-no-files-found: error
.gitlab-ci.ymldeleted−59
@@ -1,59 +0,0 @@
1−---
2−variables:
3− GIT_SUBMODULE_STRATEGY: recursive
4−
5−###############################################################################
6−# Define all YAML node anchors
7−###############################################################################
8−.node_anchors:
9− # `stage`
10− stage_build: &stage_build 'build'
11− # `image`
12− image_clickable_amd64: &image_clickable_amd64 'clickable/ci-16.04-amd64'
13− image_clickable_arm64: &image_clickable_arm64 'clickable/ci-16.04-arm64'
14− image_clickable_armhf: &image_clickable_armhf 'clickable/ci-16.04-armhf'
15− # `artifacts.paths`
16− paths_amd64: &paths_amd64
17− - 'build/x86_64-linux-gnu/app/*.click'
18− paths_arm64: &paths_arm64
19− - 'build/aarch64-linux-gnu/app/*.click'
20− paths_armhf: &paths_armhf
21− - 'build/arm-linux-gnueabihf/app/*.click'
22−
23−###############################################################################
24−# Define stages
25−###############################################################################
26−stages:
27− - *stage_build
28−
29−###############################################################################
30−# Define `build` template
31−###############################################################################
32−.build_click:
33− stage: *stage_build
34− script:
35− - 'clickable build'
36− - 'clickable review'
37− artifacts:
38− expire_in: '1 week'
39−
40−###############################################################################
41−# `build` stage: build clicks for `armhf`, `arm64` & `amd64`
42−###############################################################################
43−xenial_armhf_click:
44− extends: '.build_click'
45− image: *image_clickable_armhf
46− artifacts:
47− paths: *paths_armhf
48−
49−xenial_arm64_click:
50− extends: '.build_click'
51− image: *image_clickable_arm64
52− artifacts:
53− paths: *paths_arm64
54−
55−xenial_amd64_click:
56− extends: '.build_click'
57− image: *image_clickable_amd64
58− artifacts:
59− paths: *paths_amd64
README.md+1−3
@@ -4,12 +4,10 @@ Cinny is a Matrix client focusing primarily on simple, elegant and secure interf
44
55## License
66
7−Cinny source package licensed under [MIT](https://github.com/ajbura/cinny/blob/dev/LICENSE) (c) 2021 Ajay Bura (ajbura) and contributors.
7+Cinny source package licensed under [MIT](https://github.com/cinnyapp/cinny/blob/dev/LICENSE) (c) 2021 Ajay Bura (ajbura) and contributors.
88
99[Graphics](/svg/) by Ajay Bura (ajbura) licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (c) by Ajay Bura (ajbura).
1010
11−Cinny mobile adaptation by [C0ffeeCode](https://github.com/C0ffeeCode/cinny/commits/adapt-mobile-width) under [MIT](https://github.com/ajbura/cinny/blob/dev/LICENSE) (c) 2021 Ajay Bura (ajbura) and contributors.
12−
1311Click packaging by [Marcel Alexandru Nitan](https://github.com/nitanmarcel/cinny-click-packaging) [GPLv3](https://github.com/nitanmarcel/cinny-click-packaging/blob/dev/LICENSE) (C) 2022 Marcel Alexandru Nitan.
1412
1513[![OpenStore](https://open-store.io/badges/en_US.png)](https://open-store.io/app/cinny.nitanmarcel)
manifest.json.in+1−1
@@ -15,7 +15,7 @@
1515 "push-helper": "push/push.json"
1616 }
1717 },
18− "version": "1.8.3",
18+ "version": "@CLICK_VERSION@",
1919 "maintainer": "Marcel Alexandru Nitan <nitan.marcel@protonmail.com>",
2020 "framework" : "@CLICK_FRAMEWORK@"
2121}
patches/0008-Set-push-notifications-to-UTs-push-hook.patch+27−23
@@ -1,41 +1,44 @@
1−From 920ca66972190687262e5539b0a841d9b8bda6e3 Mon Sep 17 00:00:00 2001
1+From fe881f37607a0d720b8a4d7f6b9d260173f621a5 Mon Sep 17 00:00:00 2001
22From: Marcel Alexandru Nitan <nitan.marcel@protonmail.com>
3−Date: Mon, 4 Apr 2022 21:19:30 +0300
4−Subject: [PATCH] Set push notifications to UTs push hook
3+Date: Thu, 16 Jun 2022 17:09:38 +0300
4+Subject: [PATCH] Add missing import in notification hook patch
55
66---
7− src/client/initMatrix.js | 35 +++++++++++++++++++++++++++++++++++
8− 1 file changed, 35 insertions(+)
7+ src/client/initMatrix.js | 32 ++++++++++++++++++++++++++++++++
8+ 1 file changed, 32 insertions(+)
99
1010diff --git a/src/client/initMatrix.js b/src/client/initMatrix.js
11−index f6fc9eb..663a2bf 100644
11+index aec2f3d..ac85e8e 100644
1212--- a/src/client/initMatrix.js
1313+++ b/src/client/initMatrix.js
14−@@ -17,6 +17,18 @@ class InitMatrix extends EventEmitter {
14+@@ -9,6 +9,8 @@ import RoomsInput from './state/RoomsInput';
15+ import Notifications from './state/Notifications';
16+ import { cryptoCallbacks } from './state/secretStorageKeys';
17+
18++import cons from './state/cons';
19++
20+ global.Olm = require('@matrix-org/olm');
21+
22+ // logger.disableAll();
23+@@ -18,6 +20,12 @@ class InitMatrix extends EventEmitter {
1524 await this.startClient();
1625 this.setupSync();
1726 this.listenEvents();
1827+
19−+ try {
20−+ this.setPush(QML.settings.pushToken, QML.settings.pushAppId)
21−+
22−+ QML.matrixPushTokenChanged.connect(async function (token) {
23−+ this.setPush(token, QML.settings.pushAppId)
28++ this.setPush(QML.settings.pushToken, QML.settings.pushAppId)
29++ QML.matrixPushTokenChanged.connect(async function (token) {
30++ this.setPush(token, QML.settings.pushAppId)
2431+
25−+ });
26−+ }
27−+ catch {
28−+ console.log("Failed to update push rules!")
29−+ }
32++ });
3033 }
3134
3235 async startClient() {
33−@@ -46,6 +58,29 @@ class InitMatrix extends EventEmitter {
36+@@ -51,6 +59,30 @@ class InitMatrix extends EventEmitter {
3437 this.matrixClient.setGlobalErrorOnUnknownDevices(false);
3538 }
3639
3740+ setPush(token, appId) {
38−+ var promises = []
41++ const promises = []
3942+
4043+ promises.push(
4144+ this.matrixClient.setPusher(
@@ -51,10 +54,11 @@ index f6fc9eb..663a2bf 100644
5154+ "kind": "http",
5255+ "profile_tag": "xxyyzz",
5356+ "pushkey": token
54−+ },
55−+ function () {}
56−+ ))
57−+ this.matrixClient.setPushRuleEnabled('global', 'content', '.m.rule.contains_user_name', true, function () {})
57++ }
58++ ));
59++ promises.push(this.matrixClient.setPushRuleEnabled('global', 'content', '.m.rule.contains_user_name', true));
60++ console.error("Set appID " + appId + "with token " + token)
61++ return Promise.all(promises);
5862+ }
5963+
6064 setupSync() {
patches/0013-Disable-cinny-s-notification-sound.patchnew file+36
@@ -0,0 +1,36 @@
1+From 39642c26fb08db515272c070c512ed477df0d228 Mon Sep 17 00:00:00 2001
2+From: Marcel Alexandru Nitan <nitan.marcel@protonmail.com>
3+Date: Thu, 16 Jun 2022 16:09:35 +0300
4+Subject: [PATCH] Disable cinny's notification sound
5+
6+This is controlled by the matrix push server now and not by cinny
7+---
8+ src/client/state/settings.js | 11 ++++++-----
9+ 1 file changed, 6 insertions(+), 5 deletions(-)
10+
11+diff --git a/src/client/state/settings.js b/src/client/state/settings.js
12+index 7454be3..71521a5 100644
13+--- a/src/client/state/settings.js
14++++ b/src/client/state/settings.js
15+@@ -136,12 +136,13 @@ class Settings extends EventEmitter {
16+ }
17+
18+ getIsNotificationSounds() {
19+- if (typeof this.isNotificationSounds === 'boolean') return this.isNotificationSounds;
20++ return false;
21++ // if (typeof this.isNotificationSounds === 'boolean') return this.isNotificationSounds;
22+
23+- const settings = getSettings();
24+- if (settings === null) return true;
25+- if (typeof settings.isNotificationSounds === 'undefined') return true;
26+- return settings.isNotificationSounds;
27++ // const settings = getSettings();
28++ // if (settings === null) return true;
29++ // if (typeof settings.isNotificationSounds === 'undefined') return true;
30++ // return settings.isNotificationSounds;
31+ }
32+
33+ setter(action) {
34+--
35+2.30.2
36+
po/cinny.nitanmarcel.pot+10−6
@@ -8,7 +8,7 @@ msgid ""
88msgstr ""
99"Project-Id-Version: cinny.nitanmarcel\n"
1010"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2022-04-01 20:14+0000\n"
11+"POT-Creation-Date: 2022-06-16 14:04+0000\n"
1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,26 +17,30 @@ msgstr ""
1717"Content-Type: text/plain; charset=CHARSET\n"
1818"Content-Transfer-Encoding: 8bit\n"
1919
20−#: ../qml/DownloadPage.qml:35 ../qml/UploadPage.qml:37
21−msgid "Content Picker"
20+#: ../qml/DownloadPage.qml:35
21+msgid "Save With"
2222msgstr ""
2323
2424#: ../qml/DownloadPage.qml:40 ../qml/UploadPage.qml:42
2525msgid "Back"
2626msgstr ""
2727
28−#: ../qml/Main.qml:180
28+#: ../qml/Main.qml:203
2929msgid "Javascript Dialog"
3030msgstr ""
3131
32−#: ../qml/Main.qml:192
32+#: ../qml/Main.qml:215
3333msgid "Yes"
3434msgstr ""
3535
36−#: ../qml/Main.qml:197
36+#: ../qml/Main.qml:220
3737msgid "Cancel"
3838msgstr ""
3939
40+#: ../qml/UploadPage.qml:37
41+msgid "Chose"
42+msgstr ""
43+
4044#: cinny.desktop.in.h:1
4145msgid "Cinny"
4246msgstr ""
prebuild.sh+10−2
@@ -3,17 +3,20 @@
33set -e
44
55export REPO_NAME="cinny"
6−export REPO_URL="https://github.com/ajbura/cinny"
6+export REPO_URL="https://github.com/cinnyapp/cinny"
77export REPO_BRANCH="dev"
88export APP_TARGET="dist"
99
10+export REPO_VERSION="2.0.4"
11+export CLICK_VERSION_PREFIX="notificationfix1"
12+
1013if [ -d "${ROOT}/${REPO_NAME}" ]; then
1114 echo "Cleaning up"
1215 rm -rf "${ROOT}/${REPO_NAME}" "${ROOT}/target"
1316fi
1417echo "Cloning source repo"
1518
16−git clone "${REPO_URL}" -b "${REPO_BRANCH}" "${ROOT}/${REPO_NAME}" --depth=1
19+git clone "${REPO_URL}" -b "${REPO_BRANCH}" "${ROOT}/${REPO_NAME}" --depth=1 --branch="v${REPO_VERSION}"
1720cd "${ROOT}/${REPO_NAME}"
1821
1922if [ -d "${ROOT}/patches" ]; then
@@ -33,4 +36,9 @@ echo "Run npm build"
3336npm run build
3437echo "Copying ${APP_TARGET}"
3538cp -r "${APP_TARGET}" "${ROOT}/target"
39+
40+sed -i "s/@CLICK_VERSION@/$REPO_VERSION$CLICK_VERSION_PREFIX/g" "${ROOT}/manifest.json.in"
41+
42+cat "${ROOT}/manifest.json.in"
43+
3644echo "Done. Creating click package."
qml/Main.qml+4−97
@@ -21,6 +21,7 @@ import Ubuntu.Components.Popups 1.3
2121import Ubuntu.PushNotifications 0.1
2222import Ubuntu.Content 1.3
2323import Ubuntu.DownloadManager 1.2
24+import QtQuick.Window 2.12
2425import QtQuick.Layouts 1.3
2526import Qt.labs.settings 1.0
2627import QtQml 2.12
@@ -42,7 +43,7 @@ MainView {
4243 ? UbuntuApplication
4344 .inputMethod
4445 .keyboardRectangle
45− .height / (units.gridUnit / 8)
46+ .height / Screen.devicePixelRatio
4647 : 0
4748 Behavior on bottomMargin {
4849 NumberAnimation {
@@ -62,11 +63,8 @@ MainView {
6263 }
6364
6465 Component.onCompleted: function () {
65− theme.name = "" // set system theme
66+ theme.name = ""
6667 appSettings.systemTheme = theme.name.substring(theme.name.lastIndexOf(".")+1)
67−
68− //appSettings.pushAppId = 'cinny.nitanmarcel_cinny'
69− console.log("appSettings.pushAppId " + appSettings.pushAppId)
7068 }
7169 onActiveChanged: () => {appSettings.windowActive = mainView.active}
7270
@@ -96,9 +94,8 @@ MainView {
9694 id : webView
9795 anchors.fill : parent
9896 focus : true
99− url : "http://localhost:19999/" // Qt.resolvedUrl(Backend.getIndexPath())
97+ url : "http://localhost:19999/"
10098 webChannel: channel
101− //zoomFactor : 2.5
10299 settings.pluginsEnabled : true
103100 settings.javascriptEnabled : true
104101 profile : WebEngineProfile {
@@ -107,8 +104,6 @@ MainView {
107104 persistentStoragePath : "/home/phablet/.local/share/cinny.nitanmarcel/QWebEngine"
108105
109106 onDownloadRequested: function (download) {
110− console.log("Downloading")
111− console.log(download.path)
112107 download.accept()
113108 }
114109
@@ -130,19 +125,6 @@ MainView {
130125 })
131126 }
132127
133− onJavaScriptDialogRequested: function (request) {
134− request.accepted = true;
135− var popup = PopupUtils.open(jsDialogComponent, this, {"title": request.title, "message": request.message})
136− popup.dialogAccepted.connect(function () {
137− request.dialogAccept()
138− PopupUtils.close(popup)
139− })
140− popup.dialogRejected.connect(function () {
141− request.dialogReject()
142− PopupUtils.close(popup)
143− })
144− }
145−
146128 onFullScreenRequested : function (request) {
147129 request.accept()
148130 if (request.toggleOn)
@@ -153,20 +135,6 @@ MainView {
153135
154136 }
155137
156− Connections {
157− target: UriHandler
158−
159− onOpened: {
160− console.log('Open from UriHandler')
161−
162− if (uris.length > 0) {
163− if (uris[0].match(/^cinny:\/\/sso\/\?loginToken=.*/)) {
164− webView.url = "http://localhost:19999/" + uris[0].replace("cinny://sso/", "");
165− }
166− }
167− }
168− }
169−
170138 WebChannel {
171139 id: channel
172140 registeredObjects: [webChannelObject]
@@ -191,36 +159,6 @@ MainView {
191159 setCurrentTheme(themeName)
192160 }
193161 }
194−
195− Component {
196− id: jsDialogComponent
197−
198− Dialog {
199−
200− id: jsDialog
201−
202− title: i18n.tr("Javascript Dialog")
203− property var message
204−
205− signal dialogAccepted()
206− signal dialogRejected()
207−
208− Label {
209− wrapMode: Text.WordWrap
210− text: jsDialog.message
211− }
212−
213− Button {
214− text: i18n.tr("Yes")
215− color: UbuntuColors.green
216− onClicked: () => dialogAccepted()
217− }
218− Button {
219− text: i18n.tr("Cancel")
220− onClicked: () => dialogRejected()
221− }
222− }
223− }
224162 }
225163 }
226164
@@ -232,36 +170,5 @@ MainView {
232170 appSettings.pushToken = token
233171 webChannelObject.matrixPushTokenChanged();
234172 }
235−
236− function sendPushNotification(icon, title, body) {
237− var req = new XMLHttpRequest();
238− req.open("post", "https://push.ubports.com/notify", true);
239− req.setRequestHeader("Content-type", "application/json");
240− req.onreadystatechange = function() {
241− if ( req.readyState === XMLHttpRequest.DONE ) {
242− console.log("✍ Answer:", req.responseText);
243− }
244− }
245− var approxExpire = new Date ();
246− approxExpire.setUTCMinutes(approxExpire.getUTCMinutes()+10);
247− req.send(JSON.stringify({
248− "appid" : "cinny.nitanmarcel_cinny",
249− "expire_on": approxExpire.toISOString(),
250− "token": appSettings.pushToken,
251− "data": {
252− "notification": {
253− "card": {
254− "icon": icon,
255− "summary": title,
256− "body": body,
257− "popup": true,
258− "persist": true
259− },
260− "vibrate": true,
261− "sound": true
262− }
263− }
264− }));
265− }
266173 }
267174}
qml/qml.qrc.dependsdeleted−7
@@ -1,7 +0,0 @@
1−<RCC>
2− <qresource prefix="/">
3− <file>Main.qml</file>
4− <file>DownloadPage.qml</file>
5− <file>UploadPage.qml</file>
6− </qresource>
7−</RCC>