git.iko.soy/cinny-click-packaging
on main help sign in
15 files changed+212−196
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−56 README.md+3−3 cinny.apparmor+2 manifest.json.in+1−1 patches/0008-Set-push-notifications-to-UTs-push-hook.patch+27−23 patches/0011-Remove-unused-elements.patch+2−2 patches/0012-Rename-session-name-to-Cinny-Ubuntu-Touch.patch+25 patches/0013-Disable-cinny-s-notification-sound.patch+36 po/cinny.nitanmarcel.pot+10−6 prebuild.sh+11−3 qml/Main.qml+10−95 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−56
@@ -1,56 +0,0 @@
1−---
2−###############################################################################
3−# Define all YAML node anchors
4−###############################################################################
5−.node_anchors:
6− # `stage`
7− stage_build: &stage_build 'build'
8− # `image`
9− image_clickable_amd64: &image_clickable_amd64 'clickable/ci-16.04-amd64'
10− image_clickable_arm64: &image_clickable_arm64 'clickable/ci-16.04-arm64'
11− image_clickable_armhf: &image_clickable_armhf 'clickable/ci-16.04-armhf'
12− # `artifacts.paths`
13− paths_amd64: &paths_amd64
14− - 'build/x86_64-linux-gnu/app/*.click'
15− paths_arm64: &paths_arm64
16− - 'build/aarch64-linux-gnu/app/*.click'
17− paths_armhf: &paths_armhf
18− - 'build/arm-linux-gnueabihf/app/*.click'
19−
20−###############################################################################
21−# Define stages
22−###############################################################################
23−stages:
24− - *stage_build
25−
26−###############################################################################
27−# Define `build` template
28−###############################################################################
29−.build_click:
30− stage: *stage_build
31− script:
32− - 'clickable build'
33− - 'clickable review'
34− artifacts:
35− expire_in: '1 week'
36−
37−###############################################################################
38−# `build` stage: build clicks for `armhf`, `arm64` & `amd64`
39−###############################################################################
40−xenial_armhf_click:
41− extends: '.build_click'
42− image: *image_clickable_armhf
43− artifacts:
44− paths: *paths_armhf
45−
46−xenial_arm64_click:
47− extends: '.build_click'
48− image: *image_clickable_arm64
49− artifacts:
50− paths: *paths_arm64
51−
52−xenial_amd64_click:
53− extends: '.build_click'
54− image: *image_clickable_amd64
55− artifacts:
56− paths: *paths_amd64
README.md+3−3
@@ -4,11 +4,11 @@ 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
13+[![OpenStore](https://open-store.io/badges/en_US.png)](https://open-store.io/app/cinny.nitanmarcel)
14+
cinny.apparmor+2
@@ -2,6 +2,8 @@
22 "policy_groups": [
33 "networking",
44 "content_exchange",
5+ "audio",
6+ "video",
57 "content_exchange_source",
68 "keep-display-on",
79 "webview",
manifest.json.in+1−1
@@ -15,7 +15,7 @@
1515 "push-helper": "push/push.json"
1616 }
1717 },
18− "version": "1.8.2",
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/0011-Remove-unused-elements.patch+2−2
@@ -21,13 +21,13 @@ index c55032a..8c92b8c 100644
2121- disabled: false,
2222- render: () => <NotificationsSection />,
2323-}, {
24−+},
24++},
2525+// {
2626+// text: tabText.NOTIFICATIONS,
2727+// iconSrc: BellIC,
2828+// disabled: false,
2929+// render: () => <NotificationsSection />,
30−+// },
30++// },
3131+{
3232 text: tabText.SECURITY,
3333 iconSrc: LockIC,
patches/0012-Rename-session-name-to-Cinny-Ubuntu-Touch.patchnew file+25
@@ -0,0 +1,25 @@
1+From 4f199154c309bfe6e89f3882605e4ae993a547cb Mon Sep 17 00:00:00 2001
2+From: Marcel Alexandru Nitan <nitan.marcel@protonmail.com>
3+Date: Sun, 24 Apr 2022 22:42:06 +0300
4+Subject: [PATCH] Rename session name to 'Cinny Ubuntu Touch'
5+
6+---
7+ src/client/state/cons.js | 2 +-
8+ 1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+diff --git a/src/client/state/cons.js b/src/client/state/cons.js
11+index 34a3a92..825f010 100644
12+--- a/src/client/state/cons.js
13++++ b/src/client/state/cons.js
14+@@ -6,7 +6,7 @@ const cons = {
15+ USER_ID: 'cinny_user_id',
16+ BASE_URL: 'cinny_hs_base_url',
17+ },
18+- DEVICE_DISPLAY_NAME: 'Cinny Web',
19++ DEVICE_DISPLAY_NAME: 'Cinny Ubuntu Touch',
20+ IN_CINNY_SPACES: 'in.cinny.spaces',
21+ tabs: {
22+ HOME: 'home',
23+--
24+2.30.2
25+
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+11−3
@@ -3,17 +3,20 @@
33set -e
44
55export REPO_NAME="cinny"
6−export REPO_URL="https://github.com/C0ffeeCode/cinny"
7−export REPO_BRANCH="adapt-mobile-width"
6+export REPO_URL="https://github.com/cinnyapp/cinny"
7+export 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+10−95
@@ -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,35 +125,16 @@ 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− })
128+ onFullScreenRequested : function (request) {
129+ request.accept()
130+ if (request.toggleOn)
131+ window.showFullScreen()
132+ else
133+ window.showNormal()
144134 }
145135
146136 }
147137
148− Connections {
149− target: UriHandler
150−
151− onOpened: {
152− console.log('Open from UriHandler')
153−
154− if (uris.length > 0) {
155− if (uris[0].match(/^cinny:\/\/sso\/\?loginToken=.*/)) {
156− webView.url = "http://localhost:19999/" + uris[0].replace("cinny://sso/", "");
157− }
158− }
159− }
160− }
161−
162138 WebChannel {
163139 id: channel
164140 registeredObjects: [webChannelObject]
@@ -183,36 +159,6 @@ MainView {
183159 setCurrentTheme(themeName)
184160 }
185161 }
186−
187− Component {
188− id: jsDialogComponent
189−
190− Dialog {
191−
192− id: jsDialog
193−
194− title: i18n.tr("Javascript Dialog")
195− property var message
196−
197− signal dialogAccepted()
198− signal dialogRejected()
199−
200− Label {
201− wrapMode: Text.WordWrap
202− text: jsDialog.message
203− }
204−
205− Button {
206− text: i18n.tr("Yes")
207− color: UbuntuColors.green
208− onClicked: () => dialogAccepted()
209− }
210− Button {
211− text: i18n.tr("Cancel")
212− onClicked: () => dialogRejected()
213− }
214− }
215− }
216162 }
217163 }
218164
@@ -224,36 +170,5 @@ MainView {
224170 appSettings.pushToken = token
225171 webChannelObject.matrixPushTokenChanged();
226172 }
227−
228− function sendPushNotification(icon, title, body) {
229− var req = new XMLHttpRequest();
230− req.open("post", "https://push.ubports.com/notify", true);
231− req.setRequestHeader("Content-type", "application/json");
232− req.onreadystatechange = function() {
233− if ( req.readyState === XMLHttpRequest.DONE ) {
234− console.log("✍ Answer:", req.responseText);
235− }
236− }
237− var approxExpire = new Date ();
238− approxExpire.setUTCMinutes(approxExpire.getUTCMinutes()+10);
239− req.send(JSON.stringify({
240− "appid" : "cinny.nitanmarcel_cinny",
241− "expire_on": approxExpire.toISOString(),
242− "token": appSettings.pushToken,
243− "data": {
244− "notification": {
245− "card": {
246− "icon": icon,
247− "summary": title,
248− "body": body,
249− "popup": true,
250− "persist": true
251− },
252− "vibrate": true,
253− "sound": true
254− }
255− }
256− }));
257− }
258173 }
259174}
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>