From 73430beb5cee9d3fb1ac37fe4757eac68846bcb3 Mon Sep 17 00:00:00 2001 From: Pleroma Renovate Bot Date: Fri, 5 May 2023 09:04:29 +0000 Subject: [PATCH 001/139] Update dependency qrcode to v1.5.3 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5bf9aa90..d8b17a69 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "parse-link-header": "2.0.0", "phoenix": "1.6.2", "punycode.js": "2.3.0", - "qrcode": "1.5.1", + "qrcode": "1.5.3", "querystring-es3": "0.2.1", "url": "0.11.0", "utf8": "3.0.0", diff --git a/yarn.lock b/yarn.lock index 0e1afe5f..66411551 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7634,10 +7634,10 @@ qjobs@^1.2.0: resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== -qrcode@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.1.tgz#0103f97317409f7bc91772ef30793a54cd59f0cb" - integrity sha512-nS8NJ1Z3md8uTjKtP+SGGhfqmTCs5flU/xR623oI0JX+Wepz9R8UrRVCTBTJm3qGw3rH6jJ6MUHjkDx15cxSSg== +qrcode@1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.3.tgz#03afa80912c0dccf12bc93f615a535aad1066170" + integrity sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg== dependencies: dijkstrajs "^1.0.1" encode-utf8 "^1.0.3" From 064ff35822f761eee5ed8c0df1c5e18b2bc5bf7e Mon Sep 17 00:00:00 2001 From: Pleroma Renovate Bot Date: Tue, 23 May 2023 09:07:59 +0000 Subject: [PATCH 002/139] Update dependency mini-css-extract-plugin to v2.7.6 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4824df82..28dfc563 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "karma-spec-reporter": "0.0.36", "karma-webpack": "5.0.0", "lodash": "4.17.21", - "mini-css-extract-plugin": "2.7.5", + "mini-css-extract-plugin": "2.7.6", "mocha": "10.2.0", "nightwatch": "2.6.20", "opn": "5.5.0", diff --git a/yarn.lock b/yarn.lock index fdf6634d..079aba90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6523,10 +6523,10 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -mini-css-extract-plugin@2.7.5: - version "2.7.5" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.5.tgz#afbb344977659ec0f1f6e050c7aea456b121cfc5" - integrity sha512-9HaR++0mlgom81s95vvNjxkg52n2b5s//3ZTI1EtzFb98awsLSivs2LMsVqnQ3ay0PVhqWcGNyDaTE961FOcjQ== +mini-css-extract-plugin@2.7.6: + version "2.7.6" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.6.tgz#282a3d38863fddcd2e0c220aaed5b90bc156564d" + integrity sha512-Qk7HcgaPkGG6eD77mLvZS1nmxlao3j+9PkrT9Uc7HAE1id3F41+DdBRYRYkbyfNRGzm8/YWtzhw7nVPmwhqTQw== dependencies: schema-utils "^4.0.0" From 4bc7873e037dd4760c32e3dda4a94462696684e6 Mon Sep 17 00:00:00 2001 From: HJ <30-hj@users.noreply.git.pleroma.social> Date: Mon, 5 Jun 2023 19:04:30 +0000 Subject: [PATCH 003/139] Merge branch 'harden-parser' into 'develop' fix regex misinterpreting tag name in badly formed HTML See merge request pleroma/pleroma-fe!1835 (cherry picked from commit 624af7ed00b0edb2792f84cc83f6eeb7568798c4) 00b47e16 fix regex misinterpreting tag name in badly formed HTML, prevent rich 5e656cc0 Merge remote-tracking branch 'origin/develop' into harden-parser 10e28f6c changelog 0109724a case insensititvy --- changelog.d/parser.fix | 1 + src/components/rich_content/rich_content.jsx | 4 +++- src/services/html_converter/utility.service.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog.d/parser.fix diff --git a/changelog.d/parser.fix b/changelog.d/parser.fix new file mode 100644 index 00000000..13bac0bf --- /dev/null +++ b/changelog.d/parser.fix @@ -0,0 +1 @@ +fix regex issue in HTML parser/renderer diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index 7881e365..b16ab242 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -149,7 +149,9 @@ export default { // Handle tag nodes if (Array.isArray(item)) { const [opener, children, closer] = item - const Tag = getTagName(opener) + let Tag = getTagName(opener) + if (Tag.toLowerCase() === 'script') Tag = 'js-exploit' + if (Tag.toLowerCase() === 'style') Tag = 'css-exploit' const fullAttrs = getAttrs(opener, () => true) const attrs = getAttrs(opener) const previouslyMentions = currentMentions !== null diff --git a/src/services/html_converter/utility.service.js b/src/services/html_converter/utility.service.js index f1042971..a1301353 100644 --- a/src/services/html_converter/utility.service.js +++ b/src/services/html_converter/utility.service.js @@ -5,7 +5,7 @@ * @return {String} - tagname, i.e. "div" */ export const getTagName = (tag) => { - const result = /(?:<\/(\w+)>|<(\w+)\s?.*?\/?>)/gi.exec(tag) + const result = /(?:<\/(\w+)>|<(\w+)\s?.*?\/?>)/gis.exec(tag) return result && (result[1] || result[2]) } From 96ef76f1d76df7bd1e216524d5fe429830146aa6 Mon Sep 17 00:00:00 2001 From: tusooa Date: Sun, 18 Jun 2023 15:44:19 -0400 Subject: [PATCH 004/139] Make emoji picker buttons accessible --- src/components/emoji_picker/emoji_picker.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index 6972164b..3319dace 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -22,6 +22,7 @@ active: activeGroupView === group.id }" :title="group.text" + role="button" @click.prevent="highlight(group.id)" > From 16140c278ba68f4ad9817181c943477a8b367858 Mon Sep 17 00:00:00 2001 From: tusooa Date: Sun, 18 Jun 2023 15:46:05 -0400 Subject: [PATCH 005/139] Add changelog --- changelog.d/emoji-picker-button-accessible.fix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/emoji-picker-button-accessible.fix diff --git a/changelog.d/emoji-picker-button-accessible.fix b/changelog.d/emoji-picker-button-accessible.fix new file mode 100644 index 00000000..12898a1a --- /dev/null +++ b/changelog.d/emoji-picker-button-accessible.fix @@ -0,0 +1 @@ +Add alt text to emoji picker buttons From 067eefdb44ef953e54bd2f678b3526464627f7d4 Mon Sep 17 00:00:00 2001 From: Pleroma Renovate Bot Date: Tue, 11 Jul 2023 09:08:35 +0000 Subject: [PATCH 006/139] Update dependency phoenix to v1.7.7 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4824df82..12f749e2 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "js-cookie": "3.0.1", "localforage": "1.10.0", "parse-link-header": "2.0.0", - "phoenix": "1.6.2", + "phoenix": "1.7.7", "punycode.js": "2.3.0", "qrcode": "1.5.1", "querystring-es3": "0.2.1", diff --git a/yarn.lock b/yarn.lock index fdf6634d..6147702a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7141,10 +7141,10 @@ pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" -phoenix@1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/phoenix/-/phoenix-1.6.2.tgz#8d1d9f06e51cb893d08059e80488cd0de328e01a" - integrity sha512-VjR27NETvrLSj8rI6DlpVAfo7pCYth/9+1OCoTof4LKEbq0141ze/tdxFHHZzVQSok3gqJUo2h/tqbxR3r8eyw== +phoenix@1.7.7: + version "1.7.7" + resolved "https://registry.yarnpkg.com/phoenix/-/phoenix-1.7.7.tgz#829817ea65a83ef78a3a88e3e074125f502a034f" + integrity sha512-moAN6e4Z16x/x1nswUpnTR2v5gm7HsI7eluZ2YnYUUsBNzi3cY/5frmiJfXIEi877IQAafzTfp8hd6vEUMme+w== picocolors@^1.0.0: version "1.0.0" From 1c2048749480800e2d44b3876378beee421a79ba Mon Sep 17 00:00:00 2001 From: tusooa Date: Wed, 12 Jul 2023 20:45:44 -0400 Subject: [PATCH 007/139] Implement showing quotes --- src/components/status/status.js | 3 +++ src/components/status/status.scss | 6 ++++++ src/components/status/status.vue | 9 +++++++++ src/modules/statuses.js | 4 ++++ .../entity_normalizer/entity_normalizer.service.js | 4 ++++ 5 files changed, 26 insertions(+) diff --git a/src/components/status/status.js b/src/components/status/status.js index 9a9bca7a..c10c6cf5 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -401,6 +401,9 @@ const Status = { }, editingAvailable () { return this.$store.state.instance.editingAvailable + }, + quotedStatus () { + return this.status.quote_id ? this.$store.state.statuses.allStatusesObject[this.status.quote_id] : undefined } }, methods: { diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 44812867..4dfd1f87 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -422,4 +422,10 @@ } } } + + .quoted-status { + margin-top: 0.5em; + border: 1px solid var(--border, $fallback--border); + border-radius: var(--attachmentRadius, $fallback--attachmentRadius); + } } diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 35b15362..58fc0eca 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -364,6 +364,15 @@ @parseReady="setHeadTailLinks" /> +
+ +
+
{ output.thread_muted = pleroma.thread_muted output.emoji_reactions = pleroma.emoji_reactions output.parent_visible = pleroma.parent_visible === undefined ? true : pleroma.parent_visible + output.quote = pleroma.quote ? parseStatus(pleroma.quote) : undefined + output.quote_id = output.quote ? output.quote.id : undefined + output.quote_url = pleroma.quote_url + output.quote_visible = pleroma.quote_visible } else { output.text = data.content output.summary = data.spoiler_text From d72486f3e4f2af9db95535f3f93e6257c675e155 Mon Sep 17 00:00:00 2001 From: tusooa Date: Wed, 12 Jul 2023 21:34:19 -0400 Subject: [PATCH 008/139] Implement sending quote posts --- .../post_status_form/post_status_form.js | 31 ++++++++++-- .../post_status_form/post_status_form.vue | 50 +++++++++++++++++++ src/i18n/en.json | 2 + src/services/api/api.service.js | 4 ++ .../status_poster/status_poster.service.js | 2 + 5 files changed, 85 insertions(+), 4 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index b75fee69..73176132 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -156,7 +156,8 @@ const PostStatusForm = { poll: this.statusPoll || {}, mediaDescriptions: this.statusMediaDescriptions || {}, visibility: this.statusScope || scope, - contentType: statusContentType + contentType: statusContentType, + quoting: false } } @@ -265,6 +266,24 @@ const PostStatusForm = { isEdit () { return typeof this.statusId !== 'undefined' && this.statusId.trim() !== '' }, + quotable () { + if (!this.replyTo) { + return false + } + + const repliedStatus = this.$store.state.statuses.allStatusesObject[this.replyTo] + if (!repliedStatus) { + return false + } + + if (repliedStatus.visibility === 'public' || + repliedStatus.visibility === 'unlisted' || + repliedStatus.visibility === 'local') { + return true + } else if (repliedStatus.visibility === 'private') { + return repliedStatus.account.id === this.$store.state.users.currentUser.id + } + }, ...mapGetters(['mergedConfig']), ...mapState({ mobileLayout: state => state.interface.mobileLayout @@ -292,7 +311,8 @@ const PostStatusForm = { visibility: newStatus.visibility, contentType: newStatus.contentType, poll: {}, - mediaDescriptions: {} + mediaDescriptions: {}, + quoting: false } this.pollFormVisible = false this.$refs.mediaUpload && this.$refs.mediaUpload.clearFile() @@ -340,6 +360,8 @@ const PostStatusForm = { return } + const replyOrQuoteAttr = newStatus.quoting ? 'quoteId' : 'inReplyToStatusId' + const postingOptions = { status: newStatus.status, spoilerText: newStatus.spoilerText || null, @@ -347,7 +369,7 @@ const PostStatusForm = { sensitive: newStatus.nsfw, media: newStatus.files, store: this.$store, - inReplyToStatusId: this.replyTo, + [replyOrQuoteAttr]: this.replyTo, contentType: newStatus.contentType, poll, idempotencyKey: this.idempotencyKey @@ -373,6 +395,7 @@ const PostStatusForm = { } const newStatus = this.newStatus this.previewLoading = true + const replyOrQuoteAttr = newStatus.quoting ? 'quoteId' : 'inReplyToStatusId' statusPoster.postStatus({ status: newStatus.status, spoilerText: newStatus.spoilerText || null, @@ -380,7 +403,7 @@ const PostStatusForm = { sensitive: newStatus.nsfw, media: [], store: this.$store, - inReplyToStatusId: this.replyTo, + [replyOrQuoteAttr]: this.replyTo, contentType: newStatus.contentType, poll: {}, preview: true diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 86c1f907..e06b88b2 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -126,6 +126,42 @@ class="preview-status" />
+
+ + +
Date: Thu, 13 Jul 2023 00:37:57 -0400 Subject: [PATCH 009/139] Handle recursive quotes --- .../post_status_form/post_status_form.js | 2 +- src/components/status/status.js | 25 ++++++++++++++- src/components/status/status.scss | 12 +++++++ src/components/status/status.vue | 32 ++++++++++++++++++- src/i18n/en.json | 5 ++- .../entity_normalizer.service.js | 2 +- 6 files changed, 73 insertions(+), 5 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 73176132..17350998 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -281,7 +281,7 @@ const PostStatusForm = { repliedStatus.visibility === 'local') { return true } else if (repliedStatus.visibility === 'private') { - return repliedStatus.account.id === this.$store.state.users.currentUser.id + return repliedStatus.user.id === this.$store.state.users.currentUser.id } }, ...mapGetters(['mergedConfig']), diff --git a/src/components/status/status.js b/src/components/status/status.js index c10c6cf5..e722a635 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -133,6 +133,7 @@ const Status = { 'showPinned', 'inProfile', 'profileUserId', + 'inQuote', 'simpleTree', 'controlledThreadDisplayStatus', @@ -159,7 +160,8 @@ const Status = { uncontrolledMediaPlaying: [], suspendable: true, error: null, - headTailLinks: null + headTailLinks: null, + displayQuote: !this.inQuote } }, computed: { @@ -402,8 +404,17 @@ const Status = { editingAvailable () { return this.$store.state.instance.editingAvailable }, + hasVisibleQuote () { + return this.status.quote_url && this.status.quote_visible + }, + hasInvisibleQuote () { + return this.status.quote_url && !this.status.quote_visible + }, quotedStatus () { return this.status.quote_id ? this.$store.state.statuses.allStatusesObject[this.status.quote_id] : undefined + }, + shouldDisplayQuote () { + return this.quotedStatus && this.displayQuote } }, methods: { @@ -472,6 +483,18 @@ const Status = { window.scrollBy(0, rect.bottom - window.innerHeight + 50) } } + }, + toggleDisplayQuote () { + if (this.shouldDisplayQuote) { + this.displayQuote = false + } else if (!this.quotedStatus) { + this.$store.dispatch('fetchStatus', this.status.quote_id) + .then(() => { + this.displayQuote = true + }) + } else { + this.displayQuote = true + } } }, watch: { diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 4dfd1f87..760c6ac1 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -427,5 +427,17 @@ margin-top: 0.5em; border: 1px solid var(--border, $fallback--border); border-radius: var(--attachmentRadius, $fallback--attachmentRadius); + + &.-unavailable-prompt { + padding: 0.5em; + } + } + + .display-quoted-status-button { + margin: 0.5em; + + &-icon { + color: inherit; + } } } diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 58fc0eca..c49a9e7b 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -365,13 +365,43 @@ />
+
+

+ + + +

{ output.emoji_reactions = pleroma.emoji_reactions output.parent_visible = pleroma.parent_visible === undefined ? true : pleroma.parent_visible output.quote = pleroma.quote ? parseStatus(pleroma.quote) : undefined - output.quote_id = output.quote ? output.quote.id : undefined + output.quote_id = pleroma.quote_id ? pleroma.quote_id : (output.quote ? output.quote.id : undefined) output.quote_url = pleroma.quote_url output.quote_visible = pleroma.quote_visible } else { From 63f56cfb274165e157378888f5d448bfb194a52f Mon Sep 17 00:00:00 2001 From: tusooa Date: Thu, 13 Jul 2023 00:43:55 -0400 Subject: [PATCH 010/139] Add aria-labels for reply/quote selector --- src/components/post_status_form/post_status_form.js | 1 + src/components/post_status_form/post_status_form.vue | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 17350998..65066d54 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -162,6 +162,7 @@ const PostStatusForm = { } return { + randomSeed: `${Math.random()}`.replace('.', '-'), dropFiles: [], uploadingFiles: false, error: null, diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index e06b88b2..0d793885 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -135,6 +135,7 @@ class="reply-or-quote-option" tabindex="0" role="radio" + :aria-labelledby="`reply-or-quote-option-${randomSeed}-reply`" :aria-checked="!newStatus.quoting" @click="newStatus.quoting = false" > @@ -143,13 +144,16 @@ :checked="!newStatus.quoting" >
From 99cff7e28b6f99620e18936af8b4fe8f725eb156 Mon Sep 17 00:00:00 2001 From: tusooa Date: Mon, 17 Jul 2023 11:29:36 -0400 Subject: [PATCH 011/139] Add changelog for quote --- changelog.d/quote.add | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/quote.add diff --git a/changelog.d/quote.add b/changelog.d/quote.add new file mode 100644 index 00000000..b43b6aba --- /dev/null +++ b/changelog.d/quote.add @@ -0,0 +1 @@ +Implement quoting From 441eea36837a132b841d6c7423e146990b48ab16 Mon Sep 17 00:00:00 2001 From: tusooa Date: Mon, 17 Jul 2023 17:28:36 -0400 Subject: [PATCH 012/139] Do not show quote options for servers without quote support --- src/boot/after_store.js | 1 + src/components/post_status_form/post_status_form.js | 4 ++++ src/modules/instance.js | 1 + 3 files changed, 6 insertions(+) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 9c1f007b..395d4834 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -259,6 +259,7 @@ const getNodeInfo = async ({ store }) => { store.dispatch('setInstanceOption', { name: 'editingAvailable', value: features.includes('editing') }) store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits }) store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled }) + store.dispatch('setInstanceOption', { name: 'quotingAvailable', value: features.includes('quote_posting') }) const uploadLimits = metadata.uploadLimits store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) }) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 65066d54..97d3cb22 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -268,6 +268,10 @@ const PostStatusForm = { return typeof this.statusId !== 'undefined' && this.statusId.trim() !== '' }, quotable () { + if (!this.$store.state.instance.quotingAvailable) { + return false + } + if (!this.replyTo) { return false } diff --git a/src/modules/instance.js b/src/modules/instance.js index bb0292da..1ee64552 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -128,6 +128,7 @@ const defaultState = { mediaProxyAvailable: false, suggestionsEnabled: false, suggestionsWeb: '', + quotingAvailable: false, // Html stuff instanceSpecificPanelContent: '', From a314ad7ccca05c91d4a717d956c207a0b0c47005 Mon Sep 17 00:00:00 2001 From: tusooa Date: Mon, 17 Jul 2023 17:29:18 -0400 Subject: [PATCH 013/139] Add fallback return false for quotable judgements --- src/components/post_status_form/post_status_form.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 97d3cb22..ba49961d 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -288,6 +288,8 @@ const PostStatusForm = { } else if (repliedStatus.visibility === 'private') { return repliedStatus.user.id === this.$store.state.users.currentUser.id } + + return false }, ...mapGetters(['mergedConfig']), ...mapState({ From 35d3b8f27dace6efd5aab8915b2025d16bb7e7e7 Mon Sep 17 00:00:00 2001 From: tusooa Date: Tue, 18 Jul 2023 19:06:00 -0400 Subject: [PATCH 014/139] Fix pinned statuses gone when reloading user timeline --- changelog.d/reload-user-pinned.fix | 1 + src/components/timeline/timeline.js | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 changelog.d/reload-user-pinned.fix diff --git a/changelog.d/reload-user-pinned.fix b/changelog.d/reload-user-pinned.fix new file mode 100644 index 00000000..db241c20 --- /dev/null +++ b/changelog.d/reload-user-pinned.fix @@ -0,0 +1 @@ +Fix pinned statuses gone when reloading user timeline diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index b7414610..1050b87a 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -160,6 +160,9 @@ const Timeline = { if (this.timeline.flushMarker !== 0) { this.$store.commit('clearTimeline', { timeline: this.timelineName, excludeUserId: true }) this.$store.commit('queueFlush', { timeline: this.timelineName, id: 0 }) + if (this.timelineName === 'user') { + this.$store.dispatch('fetchPinnedStatuses', this.userId) + } this.fetchOlderStatuses() } else { this.blockClicksTemporarily() From 1b081a927288ff2f43025d688e2fa15cf6ce6be1 Mon Sep 17 00:00:00 2001 From: tusooa Date: Wed, 19 Jul 2023 17:00:46 -0400 Subject: [PATCH 015/139] Make reply-or-quote selection display as horizontal button group --- .../post_status_form/post_status_form.vue | 50 ++++++------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 0d793885..9b108a5a 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -129,44 +129,32 @@
- -
+
+ {{ $t('post_status.quote_option') }} +
Date: Fri, 21 Jul 2023 13:54:10 -0400 Subject: [PATCH 016/139] Fix parsing non-ascii tags --- changelog.d/nonascii-tags.fix | 1 + src/services/matcher/matcher.service.js | 7 +++++-- test/unit/specs/services/matcher/matcher.spec.js | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 changelog.d/nonascii-tags.fix diff --git a/changelog.d/nonascii-tags.fix b/changelog.d/nonascii-tags.fix new file mode 100644 index 00000000..e4c6dc82 --- /dev/null +++ b/changelog.d/nonascii-tags.fix @@ -0,0 +1 @@ +Fix parsing non-ascii tags diff --git a/src/services/matcher/matcher.service.js b/src/services/matcher/matcher.service.js index b6c4e909..54f02d31 100644 --- a/src/services/matcher/matcher.service.js +++ b/src/services/matcher/matcher.service.js @@ -14,8 +14,11 @@ export const mentionMatchesUrl = (attention, url) => { * @param {string} url */ export const extractTagFromUrl = (url) => { - const regex = /tag[s]*\/(\w+)$/g - const result = regex.exec(url) + const decoded = decodeURI(url) + // https://git.pleroma.social/pleroma/elixir-libraries/linkify/-/blob/master/lib/linkify/parser.ex + // https://www.pcre.org/original/doc/html/pcrepattern.html + const regex = /tag[s]*\/([\p{L}\p{N}_]*[\p{Alphabetic}_·\u{200c}][\p{L}\p{N}_·\p{M}\u{200c}]*)$/ug + const result = regex.exec(decoded) if (!result) { return false } diff --git a/test/unit/specs/services/matcher/matcher.spec.js b/test/unit/specs/services/matcher/matcher.spec.js index 7a2494f0..c6e9719d 100644 --- a/test/unit/specs/services/matcher/matcher.spec.js +++ b/test/unit/specs/services/matcher/matcher.spec.js @@ -78,5 +78,11 @@ describe('MatcherService', () => { expect(MatcherService.extractTagFromUrl(url)).to.eql(false) }) + + it('should return tag name from non-ascii tags', () => { + const url = encodeURI('https://website.com/tag/喵喵喵') + + expect(MatcherService.extractTagFromUrl(url)).to.eql('喵喵喵') + }) }) }) From 9baffbfbdeaaf52be95112c519e31ef5f2408180 Mon Sep 17 00:00:00 2001 From: Alexander Tumin Date: Wed, 31 May 2023 00:25:10 +0300 Subject: [PATCH 017/139] Fix HTML attribute parsing, discard attributes not strating with a letter --- changelog.d/html-attribute-parsing.fix | 1 + src/services/html_converter/utility.service.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/html-attribute-parsing.fix diff --git a/changelog.d/html-attribute-parsing.fix b/changelog.d/html-attribute-parsing.fix new file mode 100644 index 00000000..0952f773 --- /dev/null +++ b/changelog.d/html-attribute-parsing.fix @@ -0,0 +1 @@ +Fix HTML attribute parsing, discard attributes not strating with a letter diff --git a/src/services/html_converter/utility.service.js b/src/services/html_converter/utility.service.js index a1301353..f8e62dfe 100644 --- a/src/services/html_converter/utility.service.js +++ b/src/services/html_converter/utility.service.js @@ -22,7 +22,7 @@ export const getAttrs = (tag, filter) => { .replace(new RegExp('^' + getTagName(tag)), '') .replace(/\/?$/, '') .trim() - const attrs = Array.from(innertag.matchAll(/([a-z0-9-]+)(?:=("[^"]+?"|'[^']+?'))?/gi)) + const attrs = Array.from(innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=("[^"]+?"|'[^']+?'))?/gi)) .map(([trash, key, value]) => [key, value]) .map(([k, v]) => { if (!v) return [k, true] From 0d6a9e8a647be860b10506aecaafb4ff0f10150f Mon Sep 17 00:00:00 2001 From: tusooa Date: Sun, 13 Aug 2023 23:57:34 -0400 Subject: [PATCH 018/139] Display extra notifications on notifications column --- .../extra_notifications.js | 9 ++++ .../extra_notifications.vue | 42 +++++++++++++++++++ src/components/notifications/notifications.js | 7 +++- .../notifications/notifications.vue | 7 ++++ src/i18n/en.json | 4 +- 5 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 src/components/extra_notifications/extra_notifications.js create mode 100644 src/components/extra_notifications/extra_notifications.vue diff --git a/src/components/extra_notifications/extra_notifications.js b/src/components/extra_notifications/extra_notifications.js new file mode 100644 index 00000000..0bf904ba --- /dev/null +++ b/src/components/extra_notifications/extra_notifications.js @@ -0,0 +1,9 @@ +import { mapGetters } from 'vuex' + +const ExtraNotifications = { + computed: { + ...mapGetters(['unreadChatCount', 'unreadAnnouncementCount']) + } +} + +export default ExtraNotifications diff --git a/src/components/extra_notifications/extra_notifications.vue b/src/components/extra_notifications/extra_notifications.vue new file mode 100644 index 00000000..11eeb937 --- /dev/null +++ b/src/components/extra_notifications/extra_notifications.vue @@ -0,0 +1,42 @@ + + +