From 06159101cf417e81e0a37217331b17460f9f800a Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 25 Aug 2020 11:33:38 +0300 Subject: [PATCH 01/23] fix avatar overwrite classes in usercard --- src/components/user_card/user_card.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 07fce79ac..041bb80f3 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -354,7 +354,7 @@ align-items: flex-start; max-height: 56px; - .avatar { + .Avatar { flex: 1 0 100%; width: 56px; height: 56px; @@ -364,7 +364,7 @@ } } - &:hover .avatar { + &:hover .Avatar { --still-image-img: visible; --still-image-canvas: hidden; } From f0ac40a42805ff8ae614bec4afd1c0cacd15c3dc Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 25 Aug 2020 11:40:02 +0300 Subject: [PATCH 02/23] change more animated gif avatars to work properly --- src/components/chat_message/chat_message.scss | 2 +- src/components/notifications/notifications.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/chat_message/chat_message.scss b/src/components/chat_message/chat_message.scss index 240beea4e..7d4ff60cf 100644 --- a/src/components/chat_message/chat_message.scss +++ b/src/components/chat_message/chat_message.scss @@ -2,7 +2,7 @@ .chat-message-wrapper { &.hovered-message-chain { - .animated.avatar { + .animated.Avatar { canvas { display: none; } diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 1bd919953..c6b2a5b56 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -39,7 +39,7 @@ word-wrap: break-word; word-break: break-word; - &:hover .animated.avatar { + &:hover .animated.Avatar { canvas { display: none; } From c9ea2db69dbf0289f57cac53bf625bb44867943f Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 25 Aug 2020 12:17:42 +0300 Subject: [PATCH 03/23] fix long poll labels overflowing --- src/components/poll/poll.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/poll/poll.vue b/src/components/poll/poll.vue index ceba9eea4..1858f3e19 100644 --- a/src/components/poll/poll.vue +++ b/src/components/poll/poll.vue @@ -96,6 +96,7 @@ align-items: center; padding: 0.1em 0.25em; z-index: 1; + word-break: break-word; } .result-percentage { width: 3.5em; From f5e4ad601ac47f7b0a2f3cdc24e0f6be9be17d21 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Thu, 27 Aug 2020 16:46:23 +0300 Subject: [PATCH 04/23] wip start --- src/services/completion/completion.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/completion/completion.js b/src/services/completion/completion.js index df83d03d1..f74f8048e 100644 --- a/src/services/completion/completion.js +++ b/src/services/completion/completion.js @@ -4,6 +4,7 @@ export const replaceWord = (str, toReplace, replacement) => { return str.slice(0, toReplace.start) + replacement + str.slice(toReplace.end) } +// This seems to work fine export const wordAtPosition = (str, pos) => { const words = splitIntoWords(str) const wordsWithPosition = addPositionToWords(words) @@ -11,6 +12,7 @@ export const wordAtPosition = (str, pos) => { return find(wordsWithPosition, ({ start, end }) => start <= pos && end > pos) } +// This works fine export const addPositionToWords = (words) => { return reduce(words, (result, word) => { const data = { @@ -34,6 +36,7 @@ export const addPositionToWords = (words) => { }, []) } +// This needs to be altered, split words at space export const splitIntoWords = (str) => { // Split at word boundaries const regex = /\b/ From 0347d79bda97a90eab3afaf9ab6aafb784b2e10d Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 28 Aug 2020 12:02:52 +0300 Subject: [PATCH 05/23] Rewrite word split imperatively for control --- src/services/completion/completion.js | 53 +++++++++---------- .../services/completion/completion.spec.js | 43 ++++++++++----- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/src/services/completion/completion.js b/src/services/completion/completion.js index f74f8048e..8a6eba7e4 100644 --- a/src/services/completion/completion.js +++ b/src/services/completion/completion.js @@ -4,15 +4,13 @@ export const replaceWord = (str, toReplace, replacement) => { return str.slice(0, toReplace.start) + replacement + str.slice(toReplace.end) } -// This seems to work fine export const wordAtPosition = (str, pos) => { - const words = splitIntoWords(str) + const words = splitByWhitespaceBoundary(str) const wordsWithPosition = addPositionToWords(words) return find(wordsWithPosition, ({ start, end }) => start <= pos && end > pos) } -// This works fine export const addPositionToWords = (words) => { return reduce(words, (result, word) => { const data = { @@ -36,37 +34,36 @@ export const addPositionToWords = (words) => { }, []) } -// This needs to be altered, split words at space -export const splitIntoWords = (str) => { - // Split at word boundaries - const regex = /\b/ - const triggers = /[@#:]+$/ - - let split = str.split(regex) - - // Add trailing @ and # to the following word. - const words = reduce(split, (result, word) => { - if (result.length > 0) { - let previous = result.pop() - const matches = previous.match(triggers) - if (matches) { - previous = previous.replace(triggers, '') - word = matches[0] + word - } - result.push(previous) +export const splitByWhitespaceBoundary = (str) => { + let result = [] + let currentWord = '' + for (let i = 0; i < str.length; i++) { + const currentChar = str[i] + // Starting a new word + if (!currentWord) { + currentWord = currentChar + continue } - result.push(word) - - return result - }, []) - - return words + // current character is whitespace while word isn't, or vice versa: + // add our current word to results, start over the current word. + if (!!currentChar.trim() !== !!currentWord.trim()) { + result.push(currentWord) + currentWord = currentChar + continue + } + currentWord += currentChar + } + // Add the last word we were working on + if (currentWord) { + result.push(currentWord) + } + return result } const completion = { wordAtPosition, addPositionToWords, - splitIntoWords, + splitByWhitespaceBoundary, replaceWord } diff --git a/test/unit/specs/services/completion/completion.spec.js b/test/unit/specs/services/completion/completion.spec.js index 8a41c6537..81d3a26a2 100644 --- a/test/unit/specs/services/completion/completion.spec.js +++ b/test/unit/specs/services/completion/completion.spec.js @@ -1,8 +1,8 @@ -import { replaceWord, addPositionToWords, wordAtPosition, splitIntoWords } from '../../../../../src/services/completion/completion.js' +import { replaceWord, addPositionToWords, wordAtPosition, splitByWhitespaceBoundary } from '../../../../../src/services/completion/completion.js' describe('addPositiontoWords', () => { it('adds the position to a word list', () => { - const words = ['hey', 'this', 'is', 'fun'] + const words = ['hey', ' ', 'this', ' ', 'is', ' ', 'fun'] const expected = [ { @@ -11,19 +11,34 @@ describe('addPositiontoWords', () => { end: 3 }, { - word: 'this', + word: ' ', start: 3, - end: 7 + end: 4 }, { - word: 'is', - start: 7, + word: 'this', + start: 4, + end: 8 + }, + { + word: ' ', + start: 8, end: 9 }, { - word: 'fun', + word: 'is', start: 9, + end: 11 + }, + { + word: ' ', + start: 11, end: 12 + }, + { + word: 'fun', + start: 12, + end: 15 } ] @@ -33,11 +48,11 @@ describe('addPositiontoWords', () => { }) }) -describe('splitIntoWords', () => { +describe('splitByWhitespaceBoundary', () => { it('splits at whitespace boundaries', () => { - const str = 'This is a #nice @test for you, @idiot.' - const expected = ['This', ' ', 'is', ' ', 'a', ' ', '#nice', ' ', '@test', ' ', 'for', ' ', 'you', ', ', '@idiot', '.'] - const res = splitIntoWords(str) + const str = 'This is a #nice @test for you, @idiot@idiot.com' + const expected = ['This', ' ', 'is', ' ', 'a', ' ', '#nice', ' ', '@test', ' ', 'for', ' ', 'you,', ' ', '@idiot@idiot.com'] + const res = splitByWhitespaceBoundary(str) expect(res).to.eql(expected) }) @@ -57,13 +72,13 @@ describe('wordAtPosition', () => { describe('replaceWord', () => { it('replaces a word (with start and end) with another word in a given string', () => { - const str = 'hey @take, how are you' - const wordsWithPosition = addPositionToWords(splitIntoWords(str)) + const str = 'hey @take , how are you' + const wordsWithPosition = addPositionToWords(splitByWhitespaceBoundary(str)) const toReplace = wordsWithPosition[2] expect(toReplace.word).to.eql('@take') - const expected = 'hey @takeshitakenji, how are you' + const expected = 'hey @takeshitakenji , how are you' const res = replaceWord(str, toReplace, '@takeshitakenji') expect(res).to.eql(expected) }) From 82b872df44049dab892e6d9f2a37acac9a13a12f Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 28 Aug 2020 12:24:48 +0300 Subject: [PATCH 06/23] update changelog with 2.1.0, fix Add -> Added in older releases --- CHANGELOG.md | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86d1a97f6..43e53e603 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,21 +2,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + ## [Unreleased] -### Changed -- Greentext now has separate color slot for it -- Removed the use of with_move parameters when fetching notifications -- Push notifications now are the same as normal notfication, and are localized. -- Updated Notification Settings to match new BE API - -### Fixed -- Weird bug related to post being sent seemingly after pasting with keyboard (hopefully) -- Multiple issues with muted statuses/notifications - ## [Unreleased patch] -### Add -- Added private notifications option for push notifications -- 'Copy link' button for statuses (in the ellipsis menu) + +## [2.1.0] - 2020-08-28 +### Added - Autocomplete domains from list of known instances - 'Bot' settings option and badge - Added profile meta data fields that can be set in profile settings @@ -25,15 +16,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Added status preview option to preview your statuses before posting - When a post is a reply to an unavailable post, the 'Reply to'-text has a strike-through style - Added ability to see all favoriting or repeating users when hovering the number on highlighted statuses +- Bookmarks ### Changed -- Registration page no longer requires email if the server is configured not to require it - Change heart to thumbs up in reaction picker - Close the media modal on navigation events - Add colons to the emoji alt text, to make them copyable - Add better visual indication for drag-and-drop for files - When disabling attachments, the placeholder links now show an icon and the description instead of just IMAGE or VIDEO etc - Remove unnecessary options for 'automatic loading when loading older' and 'reply previews' +- Greentext now has separate color slot for it +- Removed the use of with_move parameters when fetching notifications +- Push notifications now are the same as normal notfication, and are localized. +- Updated Notification Settings to match new BE API ### Fixed - Custom Emoji will display in poll options now. @@ -52,6 +47,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Reply filtering options in Settings -> Filtering now work again using filtering on server - Don't show just blank-screen when cookies are disabled - Add status idempotency to prevent accidental double posting when posting returns an error +- Weird bug related to post being sent seemingly after pasting with keyboard (hopefully) +- Multiple issues with muted statuses/notifications + +## [2.0.5] - 2020-05-12 +### Added +- Added private notifications option for push notifications +- 'Copy link' button for statuses (in the ellipsis menu) + +### Changed +- Registration page no longer requires email if the server is configured not to require it + +### Fixed +- Status ellipsis menu closes properly when selecting certain options ## [2.0.3] - 2020-05-02 ### Fixed @@ -61,7 +69,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Emoji autocomplete will match any part of the word and not just start, for example :drool will now helpfully suggest :blobcatdrool: and :blobcatdroolreach: -### Add +### Added - Follow request notification support ## [2.0.2] - 2020-04-08 From 4da248f8bc592fc1b7d24fbc1e2021bab2663f29 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 28 Aug 2020 12:35:02 +0300 Subject: [PATCH 07/23] update changelog for autocomplete fixes --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e53e603..66abfa654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ## [Unreleased patch] +### Fixed +- Autocomplete won't stop at the second @, so it'll still work with "@lain@l" and not start over. +- Fixed weird autocomplete behavior when you write ":custom_emoji: ?" ## [2.1.0] - 2020-08-28 ### Added From b5d15eddcf6bb3a9dac4f4b3d4a063aa84a8c693 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 31 Aug 2020 11:50:26 +0300 Subject: [PATCH 08/23] hide poll when subject collapsed, but show poll icon --- src/components/status_content/status_content.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue index fb469a2f5..76fe32789 100644 --- a/src/components/status_content/status_content.vue +++ b/src/components/status_content/status_content.vue @@ -71,6 +71,10 @@ v-if="attachmentTypes.includes('unknown')" class="icon-doc" /> + -
+
From ca0ce902ea1f0c3d82da65de18ba53a3350d64c2 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 31 Aug 2020 11:54:27 +0300 Subject: [PATCH 09/23] add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e53e603..675c4b5bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ## [Unreleased patch] +### Changed +- Polls will be hidden with status content if "Collapse posts with subjects" is enabled and the post is collapsed. ## [2.1.0] - 2020-08-28 ### Added From 5809f33c860663165d1211d0251f0da4c2a374cd Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 1 Sep 2020 16:48:51 -0500 Subject: [PATCH 10/23] Password reset no longer informs user of errors or account existence --- src/components/password_reset/password_reset.js | 5 ----- src/i18n/de.json | 1 - src/i18n/en.json | 1 - src/i18n/eo.json | 1 - src/i18n/es.json | 1 - src/i18n/eu.json | 1 - src/i18n/fi.json | 1 - src/i18n/fr.json | 1 - src/i18n/it.json | 1 - src/i18n/ja_easy.json | 1 - src/i18n/ja_pedantic.json | 1 - src/i18n/nl.json | 1 - src/i18n/pl.json | 1 - src/i18n/ru.json | 1 - src/i18n/zh.json | 1 - 15 files changed, 19 deletions(-) diff --git a/src/components/password_reset/password_reset.js b/src/components/password_reset/password_reset.js index 62e74e30f..5d21d7205 100644 --- a/src/components/password_reset/password_reset.js +++ b/src/components/password_reset/password_reset.js @@ -47,11 +47,6 @@ const passwordReset = { if (status === 204) { this.success = true this.error = null - } else if (status === 404 || status === 400) { - this.error = this.$t('password_reset.not_found') - this.$nextTick(() => { - this.$refs.email.focus() - }) } else if (status === 429) { this.throttled = true this.error = this.$t('password_reset.too_many_requests') diff --git a/src/i18n/de.json b/src/i18n/de.json index 3014b8704..6fe6ab2c0 100644 --- a/src/i18n/de.json +++ b/src/i18n/de.json @@ -478,7 +478,6 @@ "placeholder": "Dein Benutzername oder die zugehörige E-Mail-Adresse", "check_email": "Im E-Mail-Posteingang des angebenen Kontos müsste sich jetzt (oder zumindest in Kürze) die E-Mail mit dem Link zum Passwortzurücksetzen befinden.", "return_home": "Zurück zur Heimseite", - "not_found": "Benutzername/E-Mail-Adresse nicht gefunden. Vertippt?", "too_many_requests": "Kurze Pause. Zu viele Versuche. Bitte, später nochmal probieren.", "password_reset_disabled": "Passwortzurücksetzen deaktiviert. Bitte Administrator kontaktieren.", "password_reset_required": "Passwortzurücksetzen erforderlich.", diff --git a/src/i18n/en.json b/src/i18n/en.json index e05ac907a..8540f551f 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -774,7 +774,6 @@ "placeholder": "Your email or username", "check_email": "Check your email for a link to reset your password.", "return_home": "Return to the home page", - "not_found": "We couldn't find that email or username.", "too_many_requests": "You have reached the limit of attempts, try again later.", "password_reset_disabled": "Password reset is disabled. Please contact your instance administrator.", "password_reset_required": "You must reset your password to log in.", diff --git a/src/i18n/eo.json b/src/i18n/eo.json index b66f557a6..e73ac2f8e 100644 --- a/src/i18n/eo.json +++ b/src/i18n/eo.json @@ -776,7 +776,6 @@ "password_reset_required": "Vi devas restarigi vian pasvorton por saluti.", "password_reset_disabled": "Restarigado de pasvortoj estas malŝaltita. Bonvolu kontakti la administranton de via nodo.", "too_many_requests": "Vi atingis la limon de provoj, reprovu pli poste.", - "not_found": "Ni ne trovis tiun retpoŝtadreson aŭ uzantonomon.", "return_home": "Reiri al la hejmpaĝo", "check_email": "Kontrolu vian retpoŝton pro ligilo por restarigi vian pasvorton.", "placeholder": "Via retpoŝtadreso aŭ uzantonomo", diff --git a/src/i18n/es.json b/src/i18n/es.json index 3f313eb32..50bdcfb4a 100644 --- a/src/i18n/es.json +++ b/src/i18n/es.json @@ -624,7 +624,6 @@ "placeholder": "Su correo electrónico o nombre de usuario", "check_email": "Revise su correo electrónico para obtener un enlace para restablecer su contraseña.", "return_home": "Volver a la página de inicio", - "not_found": "No pudimos encontrar ese correo electrónico o nombre de usuario.", "too_many_requests": "Has alcanzado el límite de intentos, vuelve a intentarlo más tarde.", "password_reset_disabled": "El restablecimiento de contraseñas está deshabilitado. Póngase en contacto con el administrador de su instancia." } diff --git a/src/i18n/eu.json b/src/i18n/eu.json index f04203f0c..ad3e02a02 100644 --- a/src/i18n/eu.json +++ b/src/i18n/eu.json @@ -626,7 +626,6 @@ "placeholder": "Zure e-posta edo erabiltzaile izena", "check_email": "Begiratu zure posta elektronikoa pasahitza berrezarri ahal izateko.", "return_home": "Itzuli hasierara", - "not_found": "Ezin izan dugu helbide elektroniko edo erabiltzaile hori aurkitu.", "too_many_requests": "Saiakera gehiegi burutu ditzu, saiatu berriro geroxeago.", "password_reset_disabled": "Pasahitza berrezartzea debekatuta dago. Mesedez, jarri harremanetan instantzia administratzailearekin.", "password_reset_required": "Pasahitza berrezarri behar duzu saioa hasteko.", diff --git a/src/i18n/fi.json b/src/i18n/fi.json index 510b22343..3832dcaa8 100644 --- a/src/i18n/fi.json +++ b/src/i18n/fi.json @@ -752,7 +752,6 @@ "password_reset": "Salasanan nollaus", "placeholder": "Sähköpostiosoite tai käyttäjänimi", "return_home": "Palaa etusivulle", - "not_found": "Sähköpostiosoitetta tai käyttäjänimeä ei löytynyt.", "too_many_requests": "Olet käyttänyt kaikki yritykset, yritä uudelleen myöhemmin.", "password_reset_required": "Sinun täytyy vaihtaa salasana kirjautuaksesi." }, diff --git a/src/i18n/fr.json b/src/i18n/fr.json index 794ed812c..3b7eefaf5 100644 --- a/src/i18n/fr.json +++ b/src/i18n/fr.json @@ -730,7 +730,6 @@ "instruction": "Entrer votre address de courriel ou votre nom utilisateur. Nous enverrons un lien pour changer votre mot de passe.", "placeholder": "Votre email ou nom d'utilisateur", "return_home": "Retourner à la page d'accueil", - "not_found": "Email ou nom d'utilisateur inconnu.", "too_many_requests": "Vos avez atteint la limite d'essais, essayez plus tard.", "password_reset_required": "Vous devez changer votre mot de passe pour vous authentifier." } diff --git a/src/i18n/it.json b/src/i18n/it.json index b88fdd294..474e7fde7 100644 --- a/src/i18n/it.json +++ b/src/i18n/it.json @@ -745,7 +745,6 @@ "password_reset_required": "Devi reimpostare la tua password per poter continuare.", "password_reset_disabled": "Non puoi azzerare la tua password. Contatta il tuo amministratore.", "too_many_requests": "Hai raggiunto il numero massimo di tentativi, riprova più tardi.", - "not_found": "Non ho trovato questa email o nome utente.", "return_home": "Torna alla pagina principale", "check_email": "Controlla la tua posta elettronica.", "placeholder": "La tua email o nome utente", diff --git a/src/i18n/ja_easy.json b/src/i18n/ja_easy.json index 255648e75..991f3762f 100644 --- a/src/i18n/ja_easy.json +++ b/src/i18n/ja_easy.json @@ -666,7 +666,6 @@ "placeholder": "あなたのメールアドレスかユーザーめい", "check_email": "パスワードをリセットするためのリンクがかかれたメールが、とどいているかどうか、みてください。", "return_home": "ホームページにもどる", - "not_found": "そのメールアドレスまたはユーザーめいを、みつけることができませんでした。", "too_many_requests": "パスワードリセットを、ためすことが、おおすぎます。しばらくしてから、ためしてください。", "password_reset_disabled": "このインスタンスでは、パスワードリセットは、できません。インスタンスのアドミニストレーターに、おといあわせください。", "password_reset_required": "ログインするには、パスワードをリセットしてください。", diff --git a/src/i18n/ja_pedantic.json b/src/i18n/ja_pedantic.json index 07fea45d5..e2de10669 100644 --- a/src/i18n/ja_pedantic.json +++ b/src/i18n/ja_pedantic.json @@ -625,7 +625,6 @@ "placeholder": "メールアドレスまたはユーザー名", "check_email": "パスワードをリセットするためのリンクが記載されたメールが届いているか確認してください。", "return_home": "ホームページに戻る", - "not_found": "メールアドレスまたはユーザー名が見つかりませんでした。", "too_many_requests": "試行回数の制限に達しました。しばらく時間を置いてから再試行してください。", "password_reset_disabled": "このインスタンスではパスワードリセットは無効になっています。インスタンスの管理者に連絡してください。" } diff --git a/src/i18n/nl.json b/src/i18n/nl.json index e7509f12f..a01e57a09 100644 --- a/src/i18n/nl.json +++ b/src/i18n/nl.json @@ -677,7 +677,6 @@ "password_reset_required": "Je dient je wachtwoord opnieuw in te stellen om in te kunnen loggen.", "password_reset_disabled": "Wachtwoord reset is uitgeschakeld. Neem contact op met de beheerder van deze instantie.", "too_many_requests": "Je hebt het maximaal aantal pogingen bereikt, probeer het later opnieuw.", - "not_found": "We kunnen die email of gebruikersnaam niet vinden.", "return_home": "Terugkeren naar de home pagina", "check_email": "Controleer je email inbox voor een link om je wachtwoord opnieuw in te stellen.", "placeholder": "Je email of gebruikersnaam", diff --git a/src/i18n/pl.json b/src/i18n/pl.json index 5863ba8e2..05a7edf7d 100644 --- a/src/i18n/pl.json +++ b/src/i18n/pl.json @@ -753,7 +753,6 @@ "placeholder": "Twój email lub nazwa użytkownika", "check_email": "Sprawdź pocztę, aby uzyskać link do zresetowania hasła.", "return_home": "Wróć do strony głównej", - "not_found": "Nie mogliśmy znaleźć tego emaila lub nazwy użytkownika.", "too_many_requests": "Przekroczyłeś(-aś) limit prób, spróbuj ponownie później.", "password_reset_disabled": "Resetowanie hasła jest wyłączone. Proszę skontaktuj się z administratorem tej instancji.", "password_reset_required": "Musisz zresetować hasło, by się zalogować.", diff --git a/src/i18n/ru.json b/src/i18n/ru.json index df1729354..3444a26d4 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -420,7 +420,6 @@ "placeholder": "Ваш email или имя пользователя", "check_email": "Проверьте ваш email и перейдите по ссылке для сброса пароля.", "return_home": "Вернуться на главную страницу", - "not_found": "Мы не смогли найти аккаунт с таким email-ом или именем пользователя.", "too_many_requests": "Вы исчерпали допустимое количество попыток, попробуйте позже.", "password_reset_disabled": "Сброс пароля отключен. Cвяжитесь с администратором вашего сервера." }, diff --git a/src/i18n/zh.json b/src/i18n/zh.json index 24b799df5..8c693f4d6 100644 --- a/src/i18n/zh.json +++ b/src/i18n/zh.json @@ -640,7 +640,6 @@ "placeholder": "你的电邮地址或者用户名", "check_email": "检查你的邮箱,会有一个链接用于重置密码。", "return_home": "回到首页", - "not_found": "我们无法找到匹配的邮箱地址或者用户名。", "too_many_requests": "你触发了尝试的限制,请稍后再试。", "password_reset_disabled": "密码重置已经被禁用。请联系你的实例管理员。" }, From f281663b4972ac82b0392b1ab31b2106f9dceac7 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Thu, 3 Sep 2020 15:45:13 +0300 Subject: [PATCH 11/23] Add hacky functionality to open specific settings tabs --- .../post_status_form/post_status_form.js | 3 ++ .../post_status_form/post_status_form.vue | 7 +++-- .../settings_modal/settings_modal_content.js | 28 +++++++++++++++++++ .../settings_modal/settings_modal_content.vue | 9 ++++++ src/components/tab_switcher/tab_switcher.js | 23 ++++++++------- src/modules/interface.js | 11 ++++++++ 6 files changed, 69 insertions(+), 12 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index e7094bec9..ad149506e 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -555,6 +555,9 @@ const PostStatusForm = { }, updateIdempotencyKey () { this.idempotencyKey = Date.now().toString() + }, + openProfileTab () { + this.$store.dispatch('openSettingsModalTab', 'profile') } } } diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 520c03ea1..d67d9ae9c 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -23,9 +23,12 @@ tag="p" class="visibility-notice" > - + {{ $t('post_status.account_not_locked_warning_link') }} - +

{ + return elm.data && elm.data.attrs['data-tab-name'] === targetTab + }) + if (tabIndex >= 0) { + this.$refs.tabSwitcher.setTab(tabIndex) + } + } + // Clear the state of target tab, so that next time settings is opened + // it doesn't force it. + this.$store.dispatch('clearSettingsModalTargetTab') + } + }, + mounted () { + this.onOpen() + }, + watch: { + open: function (value) { + if (value) this.onOpen() } } } diff --git a/src/components/settings_modal/settings_modal_content.vue b/src/components/settings_modal/settings_modal_content.vue index 2156844f2..bc30a0ff7 100644 --- a/src/components/settings_modal/settings_modal_content.vue +++ b/src/components/settings_modal/settings_modal_content.vue @@ -8,6 +8,7 @@

@@ -15,6 +16,7 @@ v-if="isLoggedIn" :label="$t('settings.profile_tab')" icon="user" + data-tab-name="profile" >
@@ -22,18 +24,21 @@ v-if="isLoggedIn" :label="$t('settings.security_tab')" icon="lock" + data-tab-name="security" >
@@ -41,6 +46,7 @@ v-if="isLoggedIn" :label="$t('settings.notifications')" icon="bell-ringing-o" + data-tab-name="notifications" > @@ -48,6 +54,7 @@ v-if="isLoggedIn" :label="$t('settings.data_import_export_tab')" icon="download" + data-tab-name="dataImportExport" > @@ -56,12 +63,14 @@ :label="$t('settings.mutes_and_blocks')" :fullHeight="true" icon="eye-off" + data-tab-name="mutesAndBlocks" >
diff --git a/src/components/tab_switcher/tab_switcher.js b/src/components/tab_switcher/tab_switcher.js index 40b5b3ca1..9c1da3545 100644 --- a/src/components/tab_switcher/tab_switcher.js +++ b/src/components/tab_switcher/tab_switcher.js @@ -60,16 +60,19 @@ export default Vue.component('tab-switcher', { } }, methods: { - activateTab (index) { + clickTab (index) { return (e) => { e.preventDefault() - if (typeof this.onSwitch === 'function') { - this.onSwitch.call(null, this.$slots.default[index].key) - } - this.active = index - if (this.scrollableTabs) { - this.$refs.contents.scrollTop = 0 - } + this.setTab(index) + } + }, + setTab (index) { + if (typeof this.onSwitch === 'function') { + this.onSwitch.call(null, this.$slots.default[index].key) + } + this.active = index + if (this.scrollableTabs) { + this.$refs.contents.scrollTop = 0 } } }, @@ -88,7 +91,7 @@ export default Vue.component('tab-switcher', {
@@ -359,7 +359,7 @@ />
@@ -740,57 +740,57 @@
{{ $t('settings.style.advanced_colors.chat.incoming') }}
{{ $t('settings.style.advanced_colors.chat.outgoing') }}
From afb2241a5ba057f5d21abb23fa5400e461ba8cf5 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 8 Sep 2020 16:29:10 +0300 Subject: [PATCH 18/23] change a eslint disable to nextline only --- src/components/poll/poll.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/poll/poll.vue b/src/components/poll/poll.vue index fedb92c89..5f54b4161 100644 --- a/src/components/poll/poll.vue +++ b/src/components/poll/poll.vue @@ -17,9 +17,8 @@ {{ percentageForOption(option.votes_count) }}% - + -
Date: Wed, 16 Sep 2020 05:08:12 +0300 Subject: [PATCH 19/23] Fix the chat list order and last message timestamp updates --- src/modules/chats.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/chats.js b/src/modules/chats.js index c76090180..aef16322d 100644 --- a/src/modules/chats.js +++ b/src/modules/chats.js @@ -143,6 +143,7 @@ const chats = { const isNewMessage = (chat.lastMessage && chat.lastMessage.id) !== (updatedChat.lastMessage && updatedChat.lastMessage.id) chat.lastMessage = updatedChat.lastMessage chat.unread = updatedChat.unread + chat.updated_at = updatedChat.updated_at if (isNewMessage && chat.unread) { newChatMessageSideEffects(updatedChat) } From 8c4514013d5a53218830a82a6ac46f5969edd69b Mon Sep 17 00:00:00 2001 From: eugenijm Date: Wed, 16 Sep 2020 02:34:19 +0300 Subject: [PATCH 20/23] Fix chat messages being missed when the streaming is disabled and the messages are sent by both participants simultaneously --- src/components/chat/chat.js | 12 +++++++---- src/modules/chats.js | 20 +++---------------- src/services/chat_service/chat_service.js | 17 +++++++++------- .../chat_service/chat_service.spec.js | 10 +++++----- 4 files changed, 26 insertions(+), 33 deletions(-) diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js index 9c4e5b055..803abf698 100644 --- a/src/components/chat/chat.js +++ b/src/components/chat/chat.js @@ -204,9 +204,9 @@ const Chat = { } }, readChat () { - if (!(this.currentChatMessageService && this.currentChatMessageService.lastMessage)) { return } + if (!(this.currentChatMessageService && this.currentChatMessageService.maxId)) { return } if (document.hidden) { return } - const lastReadId = this.currentChatMessageService.lastMessage.id + const lastReadId = this.currentChatMessageService.maxId this.$store.dispatch('readChat', { id: this.currentChat.id, lastReadId }) }, bottomedOut (offset) { @@ -244,7 +244,7 @@ const Chat = { const chatId = chatMessageService.chatId const fetchOlderMessages = !!maxId - const sinceId = fetchLatest && chatMessageService.lastMessage && chatMessageService.lastMessage.id + const sinceId = fetchLatest && chatMessageService.maxId this.backendInteractor.chatMessages({ id: chatId, maxId, sinceId }) .then((messages) => { @@ -303,7 +303,11 @@ const Chat = { return this.backendInteractor.sendChatMessage(params) .then(data => { - this.$store.dispatch('addChatMessages', { chatId: this.currentChat.id, messages: [data] }).then(() => { + this.$store.dispatch('addChatMessages', { + chatId: this.currentChat.id, + messages: [data], + updateMaxId: false + }).then(() => { this.$nextTick(() => { this.handleResize() // When the posting form size changes because of a media attachment, we need an extra resize diff --git a/src/modules/chats.js b/src/modules/chats.js index c76090180..e752c6df8 100644 --- a/src/modules/chats.js +++ b/src/modules/chats.js @@ -181,30 +181,16 @@ const chats = { setChatsLoading (state, { value }) { state.chats.loading = value }, - addChatMessages (state, { commit, chatId, messages }) { + addChatMessages (state, { chatId, messages, updateMaxId }) { const chatMessageService = state.openedChatMessageServices[chatId] if (chatMessageService) { - chatService.add(chatMessageService, { messages: messages.map(parseChatMessage) }) - commit('refreshLastMessage', { chatId }) + chatService.add(chatMessageService, { messages: messages.map(parseChatMessage), updateMaxId }) } }, - refreshLastMessage (state, { chatId }) { - const chatMessageService = state.openedChatMessageServices[chatId] - if (chatMessageService) { - const chat = getChatById(state, chatId) - if (chat) { - chat.lastMessage = chatMessageService.lastMessage - if (chatMessageService.lastMessage) { - chat.updated_at = chatMessageService.lastMessage.created_at - } - } - } - }, - deleteChatMessage (state, { commit, chatId, messageId }) { + deleteChatMessage (state, { chatId, messageId }) { const chatMessageService = state.openedChatMessageServices[chatId] if (chatMessageService) { chatService.deleteMessage(chatMessageService, messageId) - commit('refreshLastMessage', { chatId }) } }, resetChatNewMessageCount (state, _value) { diff --git a/src/services/chat_service/chat_service.js b/src/services/chat_service/chat_service.js index b60a889bd..95c694823 100644 --- a/src/services/chat_service/chat_service.js +++ b/src/services/chat_service/chat_service.js @@ -8,7 +8,7 @@ const empty = (chatId) => { lastSeenTimestamp: 0, chatId: chatId, minId: undefined, - lastMessage: undefined + maxId: undefined } } @@ -18,7 +18,7 @@ const clear = (storage) => { storage.newMessageCount = 0 storage.lastSeenTimestamp = 0 storage.minId = undefined - storage.lastMessage = undefined + storage.maxId = undefined } const deleteMessage = (storage, messageId) => { @@ -26,8 +26,9 @@ const deleteMessage = (storage, messageId) => { storage.messages = storage.messages.filter(m => m.id !== messageId) delete storage.idIndex[messageId] - if (storage.lastMessage && (storage.lastMessage.id === messageId)) { - storage.lastMessage = _.maxBy(storage.messages, 'id') + if (storage.maxId === messageId) { + const lastMessage = _.maxBy(storage.messages, 'id') + storage.maxId = lastMessage.id } if (storage.minId === messageId) { @@ -36,7 +37,7 @@ const deleteMessage = (storage, messageId) => { } } -const add = (storage, { messages: newMessages }) => { +const add = (storage, { messages: newMessages, updateMaxId = true }) => { if (!storage) { return } for (let i = 0; i < newMessages.length; i++) { const message = newMessages[i] @@ -48,8 +49,10 @@ const add = (storage, { messages: newMessages }) => { storage.minId = message.id } - if (!storage.lastMessage || message.id > storage.lastMessage.id) { - storage.lastMessage = message + if (!storage.maxId || message.id > storage.maxId) { + if (updateMaxId) { + storage.maxId = message.id + } } if (!storage.idIndex[message.id]) { diff --git a/test/unit/specs/services/chat_service/chat_service.spec.js b/test/unit/specs/services/chat_service/chat_service.spec.js index 3ee9839df..2eb89a2df 100644 --- a/test/unit/specs/services/chat_service/chat_service.spec.js +++ b/test/unit/specs/services/chat_service/chat_service.spec.js @@ -33,12 +33,12 @@ describe('chatService', () => { const chat = chatService.empty() chatService.add(chat, { messages: [ message1 ] }) - expect(chat.lastMessage.id).to.eql(message1.id) + expect(chat.maxId).to.eql(message1.id) expect(chat.minId).to.eql(message1.id) expect(chat.newMessageCount).to.eql(1) chatService.add(chat, { messages: [ message2 ] }) - expect(chat.lastMessage.id).to.eql(message2.id) + expect(chat.maxId).to.eql(message2.id) expect(chat.minId).to.eql(message1.id) expect(chat.newMessageCount).to.eql(2) @@ -60,15 +60,15 @@ describe('chatService', () => { chatService.add(chat, { messages: [ message2 ] }) chatService.add(chat, { messages: [ message3 ] }) - expect(chat.lastMessage.id).to.eql(message3.id) + expect(chat.maxId).to.eql(message3.id) expect(chat.minId).to.eql(message1.id) chatService.deleteMessage(chat, message3.id) - expect(chat.lastMessage.id).to.eql(message2.id) + expect(chat.maxId).to.eql(message2.id) expect(chat.minId).to.eql(message1.id) chatService.deleteMessage(chat, message1.id) - expect(chat.lastMessage.id).to.eql(message2.id) + expect(chat.maxId).to.eql(message2.id) expect(chat.minId).to.eql(message2.id) }) }) From d6fe4f6a4fa4c8fb928bcd187e605c76f985d06d Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 16 Sep 2020 10:27:31 +0300 Subject: [PATCH 21/23] update changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18dafa8e2..c56ac821a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ## [Unreleased patch] +### Fixed +- Fixed chats list not updating its order when new messages come in +- Fixed chat messages sometimes getting lost when you receive a message at the same time + + +## [2.1.1] - 2020-09-08 ### Changed - Polls will be hidden with status content if "Collapse posts with subjects" is enabled and the post is collapsed. @@ -13,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Autocomplete won't stop at the second @, so it'll still work with "@lain@l" and not start over. - Fixed weird autocomplete behavior when you write ":custom_emoji: ?" + ## [2.1.0] - 2020-08-28 ### Added - Autocomplete domains from list of known instances From 1b811d8b931706927d8fa096435b2c272eb0d7ef Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 16 Sep 2020 11:29:10 +0300 Subject: [PATCH 22/23] change side drawer to use shoutbox name --- src/components/side_drawer/side_drawer.vue | 2 +- src/i18n/en.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue index 0587ee02d..b17813c30 100644 --- a/src/components/side_drawer/side_drawer.vue +++ b/src/components/side_drawer/side_drawer.vue @@ -90,7 +90,7 @@ @click="toggleDrawer" > - {{ $t("nav.chat") }} + {{ $t("shoutbox.title") }} diff --git a/src/i18n/en.json b/src/i18n/en.json index 8540f551f..027e99bed 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -113,7 +113,6 @@ "about": "About", "administration": "Administration", "back": "Back", - "chat": "Local Chat", "friend_requests": "Follow Requests", "mentions": "Mentions", "interactions": "Interactions", From 20d33c2fbc1e3cf9cdbab94c26b138acd505d001 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 16 Sep 2020 11:53:54 +0300 Subject: [PATCH 23/23] change icon to a megaphone --- src/components/chat_panel/chat_panel.vue | 2 +- src/components/side_drawer/side_drawer.vue | 2 +- static/fontello.json | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue index ca529b5ab..570435e7d 100644 --- a/src/components/chat_panel/chat_panel.vue +++ b/src/components/chat_panel/chat_panel.vue @@ -63,7 +63,7 @@ @click.stop.prevent="togglePanel" >
- + {{ $t('shoutbox.title') }}
diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue index b17813c30..eda5a68c2 100644 --- a/src/components/side_drawer/side_drawer.vue +++ b/src/components/side_drawer/side_drawer.vue @@ -90,7 +90,7 @@ @click="toggleDrawer" > - {{ $t("shoutbox.title") }} + {{ $t("shoutbox.title") }} diff --git a/static/fontello.json b/static/fontello.json index 706800cdb..b0136fd90 100644 --- a/static/fontello.json +++ b/static/fontello.json @@ -405,6 +405,12 @@ "css": "block", "code": 59434, "src": "fontawesome" + }, + { + "uid": "3e674995cacc2b09692c096ea7eb6165", + "css": "megaphone", + "code": 59435, + "src": "fontawesome" } ] } \ No newline at end of file