From 3896a907d843e03e19bf23de29da9a7c8981f89b Mon Sep 17 00:00:00 2001 From: octospacc Date: Wed, 14 Aug 2024 23:05:46 +0200 Subject: [PATCH] webk v2.1.0.2 --- webk/.env | 6 +- webk/index.html | 4 +- webk/public/assets/img/spacco.svg | 35 ++++++++++++ webk/public/changelogs/en_2.1.0.2.md | 1 + webk/public/langSign-CN-ja8rh.js | 4 +- webk/src/components/chat/input.ts | 2 +- webk/src/components/chat/reactionsMenu.ts | 3 +- webk/src/components/chat/translation.tsx | 15 +++-- webk/src/components/sidebarLeft/index.ts | 3 +- .../components/sidebarLeft/tabs/background.ts | 9 ++- .../sidebarLeft/tabs/generalSettings.ts | 57 +++++++++++++++++-- webk/src/config/state.ts | 10 +++- webk/src/helpers/stealthMode.ts | 14 +++-- webk/src/index.ts | 7 ++- webk/src/lang.ts | 2 + webk/src/langSign.ts | 4 +- webk/src/lib/appManagers/appDialogsManager.ts | 9 +++ webk/src/lib/appManagers/appImManager.ts | 1 + webk/src/lib/customEmoji/renderer.ts | 4 ++ webk/src/lib/mtproto/networker.ts | 3 +- .../src/lib/richTextProcessor/wrapRichText.ts | 21 +++---- webk/src/lib/rootScope.ts | 4 +- webk/src/scripts/out/langPack.strings | 6 +- webk/src/scss/partials/_chatBubble.scss | 9 +++ webk/src/scss/partials/_chatlist.scss | 9 +++ webk/src/scss/partials/_leftSidebar.scss | 13 +++++ 26 files changed, 207 insertions(+), 48 deletions(-) create mode 100644 webk/public/assets/img/spacco.svg create mode 100644 webk/public/changelogs/en_2.1.0.2.md diff --git a/webk/.env b/webk/.env index 3698e3b..048568d 100644 --- a/webk/.env +++ b/webk/.env @@ -1,8 +1,8 @@ VITE_API_ID=1025907 VITE_API_HASH=452b0359b988148995f22ff0f4229750 -VITE_VERSION=2.1.0.1 -VITE_VERSION_FULL=2.1.0.1 (521) -VITE_BUILD=521 +VITE_VERSION=2.1.0.2 +VITE_VERSION_FULL=2.1.0.2 (522) +VITE_BUILD=522 VITE_MTPROTO_WORKER=1 VITE_MTPROTO_SW= VITE_MTPROTO_HTTP= diff --git a/webk/index.html b/webk/index.html index e1ac8ba..b4684c0 100644 --- a/webk/index.html +++ b/webk/index.html @@ -95,9 +95,7 @@
- +
diff --git a/webk/public/assets/img/spacco.svg b/webk/public/assets/img/spacco.svg new file mode 100644 index 0000000..ae8902f --- /dev/null +++ b/webk/public/assets/img/spacco.svg @@ -0,0 +1,35 @@ + + + + diff --git a/webk/public/changelogs/en_2.1.0.2.md b/webk/public/changelogs/en_2.1.0.2.md new file mode 100644 index 0000000..98cff4f --- /dev/null +++ b/webk/public/changelogs/en_2.1.0.2.md @@ -0,0 +1 @@ +You can see the full list of new features and improvements here: https://t.me/c/2149281820/6 (https://t.me/+ujaob63Vy705Mzgx). diff --git a/webk/public/langSign-CN-ja8rh.js b/webk/public/langSign-CN-ja8rh.js index 9ad198b..b73ee8f 100644 --- a/webk/public/langSign-CN-ja8rh.js +++ b/webk/public/langSign-CN-ja8rh.js @@ -1,9 +1,9 @@ -const e={"Login.Title":"Sign in to Telegram","Login.PhoneLabel":"Phone Number","Login.PhoneLabelInvalid":"Phone Number Invalid","Login.KeepSigned":"Keep me signed in","Login.StartText":`Please confirm your country code +const e={"Login.Title":"Sign in to Spaccogram","Login.PhoneLabel":"Phone Number","Login.PhoneLabelInvalid":"Phone Number Invalid","Login.KeepSigned":"Keep me signed in","Login.StartText":`Please confirm your country code and enter your phone number.`,"Login.Code.SentSms":`We have sent you an SMS with the code.`,"Login.Code.SentInApp":`We have sent you a message in Telegram with the code.`,"Login.Code.SentCall":`We will call you and dictate the code.`,"Login.Code.SentUnknown":`Please check everything for a code (type: %s)`,"Login.Password.Title":"Enter Your Password","Login.Password.Subtitle":`Your account is protected with an additional password`,"Login.Register.Subtitle":`Enter your name and add -a profile photo`,PleaseWait:"Please wait...",Code:"Code",LoginPassword:"Password",YourName:"Your Name",FirstName:"First name (required)",LastName:"Last name (optional)",StartMessaging:"Start Messaging",Country:"Country","Contacts.PhoneNumber.Placeholder":"Phone Number","Login.Next":"Next","Login.ContinueOnLanguage":"Continue in English","Login.QR.Title":"Log in to Telegram by QR Code","Login.QR.Help1":"Open Telegram on your phone","Login.QR.Help2":"Go to **Settings** > **Devices** > **Link Desktop Device**","Login.QR.Help3":"Point your phone at this screen to confirm login","Login.QR.Cancel":"Log in by phone Number","Login.QR.Login":"Log in by QR Code","PhoneNumber.Code.Fragment.Info":"Get the code in the Anonymous Numbers section on [Fragment](%1$@)",PHONE_CODE_INVALID:"Invalid code",PHONE_CODE_EXPIRED:"Code expired",PASSWORD_HASH_INVALID:"Incorrect password"};export{e as default}; +a profile photo`,PleaseWait:"Please wait...",Code:"Code",LoginPassword:"Password",YourName:"Your Name",FirstName:"First name (required)",LastName:"Last name (optional)",StartMessaging:"Start Messaging",Country:"Country","Contacts.PhoneNumber.Placeholder":"Phone Number","Login.Next":"Next","Login.ContinueOnLanguage":"Continue in English","Login.QR.Title":"Log in to Spaccogram by QR Code","Login.QR.Help1":"Open Telegram on your phone","Login.QR.Help2":"Go to **Settings** > **Devices** > **Link Desktop Device**","Login.QR.Help3":"Point your phone at this screen to confirm login","Login.QR.Cancel":"Log in by phone Number","Login.QR.Login":"Log in by QR Code","PhoneNumber.Code.Fragment.Info":"Get the code in the Anonymous Numbers section on [Fragment](%1$@)",PHONE_CODE_INVALID:"Invalid code",PHONE_CODE_EXPIRED:"Code expired",PASSWORD_HASH_INVALID:"Incorrect password"};export{e as default}; //# sourceMappingURL=langSign-CN-ja8rh.js.map diff --git a/webk/src/components/chat/input.ts b/webk/src/components/chat/input.ts index ee95d69..b4ac165 100644 --- a/webk/src/components/chat/input.ts +++ b/webk/src/components/chat/input.ts @@ -2448,7 +2448,7 @@ export default class ChatInput { // this.updateSendBtn(); if((this.chat.type === ChatType.Chat || this.chat.type === ChatType.Discussion) && - this.chat.bubbles.scrollable.loadedAll.bottom) { + this.chat.bubbles.scrollable.loadedAll.bottom && !stealthMode.isEnabled()) { // octt: // this.managers.appMessagesManager.readAllHistory(this.chat.peerId, this.chat.threadId); } diff --git a/webk/src/components/chat/reactionsMenu.ts b/webk/src/components/chat/reactionsMenu.ts index 5861cec..ac754e1 100644 --- a/webk/src/components/chat/reactionsMenu.ts +++ b/webk/src/components/chat/reactionsMenu.ts @@ -237,7 +237,8 @@ export class ChatReactionsMenu { } this.reactions = peerAvailableReactions.reactions; - this.noPacks = this.noSearch = peerAvailableReactions.type !== 'chatReactionsAll'; + // octt: use full reaction panel even when not allowed, normal one is buggy (#281) + this.noPacks = this.noSearch = false; // peerAvailableReactions.type !== 'chatReactionsAll'; return this.renderReactions(peerAvailableReactions, availableReactions); }); diff --git a/webk/src/components/chat/translation.tsx b/webk/src/components/chat/translation.tsx index efb908f..a2ec98e 100644 --- a/webk/src/components/chat/translation.tsx +++ b/webk/src/components/chat/translation.tsx @@ -136,7 +136,7 @@ export default class ChatTranslation extends PinnedContainer { }); createEffect(() => { // octt: force show translation menu on all chats, to curb some issues - this.toggle(false); // (!peerTranslation().shouldShow()); + this.toggle(!isPremium()); // (!peerTranslation().shouldShow()); }); const listenerSetter = new ListenerSetter(); @@ -160,13 +160,13 @@ export default class ChatTranslation extends PinnedContainer { }, verify: isPremium, separatorDown: true - }, { // octt: make the disable translation button into a toggle button + } /* , { + // octt: TODO make this hide bar on click icon: 'crossround', - text: 'Toggle', // 'Hide', + text: 'Toggle', onClick: () => { - this.managers.appTranslationsManager.togglePeerTranslations(peerId(), peerTranslation().shouldShow()); // true); } - }], + } */ ], listenerSetter }); menu.classList.add('pinned-translation-menu', 'primary'); @@ -180,6 +180,11 @@ export default class ChatTranslation extends PinnedContainer { return; } + // octt: force enable translation on server config when disable, otherwise we can't use this + if(!peerTranslation().shouldShow()) { + this.managers.appTranslationsManager.togglePeerTranslations(peerId(), false); // true); + } + const translation = peerTranslation(); translation.toggle(!translation.enabled()); }} diff --git a/webk/src/components/sidebarLeft/index.ts b/webk/src/components/sidebarLeft/index.ts index 580b8e8..81b5452 100644 --- a/webk/src/components/sidebarLeft/index.ts +++ b/webk/src/components/sidebarLeft/index.ts @@ -322,7 +322,7 @@ export class AppSidebarLeft extends SidebarSlider { }, onOpen: (e, btnMenu) => { // octt: branding const btnMenuFooter = document.createElement('a'); - // btnMenuFooter.href = 'https://github.com/morethanwords/tweb/blob/master/CHANGELOG.md'; + btnMenuFooter.href = 'https://gitea.it/octospacc/Spaccogram/src/branch/main/webk'; setBlankToAnchor(btnMenuFooter); btnMenuFooter.classList.add('btn-menu-footer'); btnMenuFooter.addEventListener(CLICK_EVENT_NAME, (e) => { @@ -344,6 +344,7 @@ export class AppSidebarLeft extends SidebarSlider { noIcon: true }); this.toolsBtn.classList.add('sidebar-tools-button', 'is-visible'); + this.toolsBtn.appendChild(Object.assign(document.createElement('div'), {className: 'attention-dot'})); this.backBtn.parentElement.insertBefore(this.toolsBtn, this.backBtn); diff --git a/webk/src/components/sidebarLeft/tabs/background.ts b/webk/src/components/sidebarLeft/tabs/background.ts index 0c73c22..51b3aa0 100644 --- a/webk/src/components/sidebarLeft/tabs/background.ts +++ b/webk/src/components/sidebarLeft/tabs/background.ts @@ -201,7 +201,8 @@ export default class AppBackgroundTab extends SliderSuperTab { public static addWallPaper( wallPaper: WallPaper, - container = document.createElement('div') + container = document.createElement('div'), + renderComplexBackground = true ) { const colors = getColorsFromWallPaper(wallPaper); const hasFile = wallPaper._ === 'wallPaper'; @@ -232,6 +233,12 @@ export default class AppBackgroundTab extends SliderSuperTab { media.classList.add('background-item-media'); const loadPromises: Promise[] = []; + + // octt: don't show useless theme background preview in general settings, it makes them lag + if(!renderComplexBackground) { + return {container, media, loadPromise: Promise.all(loadPromises)}; + } + let wrapped: ReturnType, size: ReturnType; if(hasFile) { size = choosePhotoSize(doc, 200, 200); diff --git a/webk/src/components/sidebarLeft/tabs/generalSettings.ts b/webk/src/components/sidebarLeft/tabs/generalSettings.ts index 5d06ee5..a5e8660 100644 --- a/webk/src/components/sidebarLeft/tabs/generalSettings.ts +++ b/webk/src/components/sidebarLeft/tabs/generalSettings.ts @@ -106,8 +106,8 @@ export default class AppGeneralSettingsTab extends SliderSuperTabEventable { { const container = section('Settings'); - const range = new RangeSettingSelector('TextSize', 1, rootScope.settings.messagesTextSize, 12, 20); - range.onChange = (value) => { + const textSizeRange = new RangeSettingSelector('TextSize', 1, rootScope.settings.messagesTextSize, 12, 20); + textSizeRange.onChange = (value) => { rootScope.managers.appStateManager.setByKey(joinDeepPath('settings', 'messagesTextSize'), value); }; @@ -135,7 +135,6 @@ export default class AppGeneralSettingsTab extends SliderSuperTabEventable { checked: false, listenerSetter: this.listenerSetter }); - const animationsRow = new Row({ checkboxField: animationsCheckboxField, clickable: () => { @@ -156,15 +155,61 @@ export default class AppGeneralSettingsTab extends SliderSuperTabEventable { listenerSetter: this.listenerSetter }); + // octt: new config fields + + const chatCheckmarksRow = new Row({ + checkboxField: (new CheckboxField({ + text: 'ShowMessageCheckmarks', + name: 'chatCheckmarks', + stateKey: joinDeepPath('settings', 'chatCheckmarks'), + checked: rootScope.settings.chatCheckmarks, + listenerSetter: this.listenerSetter + })), + listenerSetter: this.listenerSetter + }); + const chatCheckmarksInput = chatCheckmarksRow.container.querySelector('input'); + chatCheckmarksInput.onchange = (() => { + const showCheckmarks = chatCheckmarksInput.checked; + rootScope.settings.chatCheckmarks = showCheckmarks; + document.body.classList[showCheckmarks ? 'remove' : 'add']('hide-chat-checkmarks'); + }); + + const forcePremiumRow = new Row({ + title: 'Force Local Premium', + checkboxField: (new CheckboxField({ + name: 'forcePremium', + stateKey: joinDeepPath('settings', 'forcePremium'), + checked: rootScope.settings.forcePremium, + listenerSetter: this.listenerSetter, + toggle: true + })), + listenerSetter: this.listenerSetter + }); + const forcePremiumInput = forcePremiumRow.container.querySelector('input'); + forcePremiumInput.onchange = (() => { + const forcePremium = forcePremiumInput.checked; + if(forcePremium) { + rootScope.premiumBak = rootScope.premium; + rootScope.premium = forcePremium; + } else { + rootScope.premium = rootScope.premiumBak; + } + rootScope.dispatchEvent('premium_toggle', rootScope.premium); + }); + + // ... // + onUpdate(); this.listenerSetter.add(rootScope)('settings_updated', onUpdate); container.append( - range.container, + textSizeRange.container, chatBackgroundButton, + chatCheckmarksRow.container, animationsRow.container, - liteModeRow.container + liteModeRow.container, + forcePremiumRow.container ); } @@ -270,7 +315,7 @@ export default class AppGeneralSettingsTab extends SliderSuperTabEventable { .filter((themeSettings) => availableBaseThemes.has(themeSettings.base_theme._)) .map((themeSettings) => { const wallPaper = themeSettings.wallpaper; - const result = AppBackgroundTab.addWallPaper(wallPaper); + const result = AppBackgroundTab.addWallPaper(wallPaper, document.createElement('div'), false); k.wallPaperContainers[themeSettings.base_theme._] = result.container; return result; }); diff --git a/webk/src/config/state.ts b/webk/src/config/state.ts index c597b7c..49f5876 100644 --- a/webk/src/config/state.ts +++ b/webk/src/config/state.ts @@ -110,7 +110,10 @@ export type State = { timeFormat: 'h12' | 'h23', liteMode: {[key in LiteModeKey]: boolean}, savedAsForum: boolean, - stealthMode: boolean // octt: // + // octt: new config fields + chatCheckmarks: boolean, + forcePremium: boolean, + stealthMode: boolean }, playbackParams: ReturnType, keepSigned: boolean, @@ -326,7 +329,10 @@ export const STATE_INIT: State = { video: false }, savedAsForum: false, - stealthMode: false // octt: // + // octt: new config fields + chatCheckmarks: true, + forcePremium: true, + stealthMode: false }, playbackParams: { volume: 1, diff --git a/webk/src/helpers/stealthMode.ts b/webk/src/helpers/stealthMode.ts index 9e78927..f5b5ac4 100644 --- a/webk/src/helpers/stealthMode.ts +++ b/webk/src/helpers/stealthMode.ts @@ -1,8 +1,7 @@ /* - * https://github.com/morethanwords/tweb - * Copyright (C) 2019-2021 Eduard Kuzmenko + * https://gitea.it/octospacc/Spaccogram * Copyright (C) 2024-2024 OctoSpacc, Spacc Inc. - * https://github.com/morethanwords/tweb/blob/master/LICENSE + * https://gitea.it/octospacc/Spaccogram/src/branch/main/webk/LICENSE */ import {MOUNT_CLASS_TO} from '../config/debug'; @@ -11,12 +10,19 @@ import {joinDeepPath} from './object/setDeepProperty'; export class StealthMode { public isEnabled() { - return !!(rootScope.settings && rootScope.settings.stealthMode); + const state = !!(rootScope.settings && rootScope.settings.stealthMode); + this.setBodyClass(state); + return state; } public setState(state: boolean) { + this.setBodyClass(state); return rootScope.managers.appStateManager.setByKey(joinDeepPath('settings', 'stealthMode'), state); } + + private setBodyClass(state: boolean) { + document.body.classList[state ? 'add' : 'remove']('stealthmode-enabled'); + } } const stealthMode = new StealthMode(); diff --git a/webk/src/index.ts b/webk/src/index.ts index fd24dbb..aab5b88 100644 --- a/webk/src/index.ts +++ b/webk/src/index.ts @@ -316,7 +316,7 @@ IMAGE_MIME_TYPES_SUPPORTED_PROMISE.then((mimeTypes) => { I18n.setTimeFormat(stateResult.state.settings.timeFormat); rootScope.managers.rootScope.getPremium().then((isPremium) => { - rootScope.premium = true; // isPremium; // octt: force premium to be enabled + rootScope.premium = isPremium; }); themeController.setThemeListener(); @@ -427,8 +427,9 @@ IMAGE_MIME_TYPES_SUPPORTED_PROMISE.then((mimeTypes) => { case 'authStateSignIn': pagePromise = (await import('./pages/pageSignIn')).default.mount(); break; - case 'authStateSignQr': - pagePromise = (await import('./pages/pageSignQR')).default.mount(); + case 'authStateSignQr': // octt: force standard login view on boot instead of QR code + pagePromise = (await import('./pages/pageSignIn')).default.mount(); + // pagePromise = (await import('./pages/pageSignQR')).default.mount(); break; case 'authStateAuthCode': pagePromise = (await import('./pages/pageAuthCode')).default.mount(authState.sentCode); diff --git a/webk/src/lang.ts b/webk/src/lang.ts index 050f8a8..4490dea 100644 --- a/webk/src/lang.ts +++ b/webk/src/lang.ts @@ -891,6 +891,8 @@ const lang = { 'TextSize': 'Message Text Size', 'ChatBackground': 'Chat Wallpaper', 'EnableAnimations': 'Enable Animations', + 'ShowMessageCheckmarks': 'Show Message Checkmarks', + 'ForceLocalPremium': 'Force Local Premium', 'AutoDownloadMedia': 'Auto-Download Media', 'AutodownloadContacts': 'Contacts', 'AutodownloadPrivateChats': 'Private Chats', diff --git a/webk/src/langSign.ts b/webk/src/langSign.ts index 69f5cc6..b4f01e8 100644 --- a/webk/src/langSign.ts +++ b/webk/src/langSign.ts @@ -1,5 +1,5 @@ const lang = { - 'Login.Title': 'Sign in to Telegram', + 'Login.Title': 'Sign in to Spaccogram', 'Login.PhoneLabel': 'Phone Number', 'Login.PhoneLabelInvalid': 'Phone Number Invalid', 'Login.KeepSigned': 'Keep me signed in', @@ -26,7 +26,7 @@ const lang = { 'Contacts.PhoneNumber.Placeholder': 'Phone Number', 'Login.Next': 'Next', 'Login.ContinueOnLanguage': 'Continue in English', - 'Login.QR.Title': 'Log in to Telegram by QR Code', + 'Login.QR.Title': 'Log in to Spaccogram by QR Code', 'Login.QR.Help1': 'Open Telegram on your phone', 'Login.QR.Help2': 'Go to **Settings** > **Devices** > **Link Desktop Device**', 'Login.QR.Help3': 'Point your phone at this screen to confirm login', diff --git a/webk/src/lib/appManagers/appDialogsManager.ts b/webk/src/lib/appManagers/appDialogsManager.ts index c193403..477dd73 100644 --- a/webk/src/lib/appManagers/appDialogsManager.ts +++ b/webk/src/lib/appManagers/appDialogsManager.ts @@ -2284,6 +2284,15 @@ export class AppDialogsManager { await (await m(loadDialogsPromise)).renderPromise.catch(noop); this.managers.appMessagesManager.fillConversations(); + + if(!rootScope.settings.chatCheckmarks) { // octt: hide message checkmarks + document.body.classList.add('hide-chat-checkmarks'); + } + + if(!rootScope.premium) { // octt: force local premium + rootScope.premium = rootScope.settings.forcePremium; + rootScope.dispatchEvent('premium_toggle', rootScope.premium); + } } /* private getOffset(side: 'top' | 'bottom'): {index: number, pos: number} { diff --git a/webk/src/lib/appManagers/appImManager.ts b/webk/src/lib/appManagers/appImManager.ts index 485baa2..0303848 100644 --- a/webk/src/lib/appManagers/appImManager.ts +++ b/webk/src/lib/appManagers/appImManager.ts @@ -239,6 +239,7 @@ export class AppImManager extends EventListenerBase<{ this.selectTab(APP_TABS.CHATLIST); + // octt: TODO modify this to implement online status obfuscation idleController.addEventListener('change', (idle) => { this.offline = idle; this.updateStatus(); diff --git a/webk/src/lib/customEmoji/renderer.ts b/webk/src/lib/customEmoji/renderer.ts index b2512b8..8738f98 100644 --- a/webk/src/lib/customEmoji/renderer.ts +++ b/webk/src/lib/customEmoji/renderer.ts @@ -25,6 +25,7 @@ import CustomEmojiElement, {CustomEmojiElements} from './element'; import assumeType from '../../helpers/assumeType'; import {IS_WEBM_SUPPORTED} from '../../environment/videoSupport'; import {observeResize, unobserveResize} from '../../components/resizeObserver'; +import liteMode from '../../helpers/liteMode'; const globalLazyLoadQueue = new LazyLoadQueue(); @@ -214,6 +215,9 @@ export class CustomEmojiRendererElement extends HTMLElement { if(!frame) { continue; } + if(!(liteMode.isAvailable('animations') && liteMode.isAvailable('emoji_panel'))) { + player.pause(); + } const isImageData = frame instanceof ImageData; let frameWidth: number, frameHeight: number; diff --git a/webk/src/lib/mtproto/networker.ts b/webk/src/lib/mtproto/networker.ts index 5de0e1c..0d7e24f 100644 --- a/webk/src/lib/mtproto/networker.ts +++ b/webk/src/lib/mtproto/networker.ts @@ -362,7 +362,8 @@ export default class MTPNetworker { serializer.storeInt(App.id, 'api_id'); serializer.storeString(getEnvironment().USER_AGENT || 'Unknown UserAgent', 'device_model'); serializer.storeString(navigator.platform || 'Unknown Platform', 'system_version'); - serializer.storeString(App.version + (App.isMainDomain ? ' ' + App.suffix : ''), 'app_version'); + // octt: remove the last version digit, to not leak the fact we're using a strange version + serializer.storeString(App.version.split('.').slice(0, -1).join('.') + (App.isMainDomain ? ' ' + App.suffix : ''), 'app_version'); serializer.storeString(navigator.language || 'en', 'system_lang_code'); serializer.storeString(App.langPack, 'lang_pack'); serializer.storeString(this.networkerFactory.language, 'lang_code'); diff --git a/webk/src/lib/richTextProcessor/wrapRichText.ts b/webk/src/lib/richTextProcessor/wrapRichText.ts index 2b8dcd2..95c805e 100644 --- a/webk/src/lib/richTextProcessor/wrapRichText.ts +++ b/webk/src/lib/richTextProcessor/wrapRichText.ts @@ -518,16 +518,17 @@ export default function wrapRichText(text: string, options: WrapRichTextOptions url = wrapped.url; onclick = wrapped.onclick; - if(options.whitelistedDomains) { - try { - const hostname = new URL(url).hostname; - if(!options.whitelistedDomains.includes(hostname)) { - break; - } - } catch(err) { - break; - } - } + // octt: no domain restrictions on rich text links + // if(options.whitelistedDomains) { + // try { + // const hostname = new URL(url).hostname; + // if(!options.whitelistedDomains.includes(hostname)) { + // break; + // } + // } catch(err) { + // break; + // } + // } if(entity._ === 'messageEntityTextUrl') { if(nextEntity?._ === 'messageEntityUrl' && diff --git a/webk/src/lib/rootScope.ts b/webk/src/lib/rootScope.ts index e9d7edb..611461b 100644 --- a/webk/src/lib/rootScope.ts +++ b/webk/src/lib/rootScope.ts @@ -209,6 +209,7 @@ export class RootScope extends EventListenerBase { public settings: State['settings']; public managers: AppManagers; public premium: boolean; + public premiumBak: boolean; constructor() { super(); @@ -216,6 +217,7 @@ export class RootScope extends EventListenerBase { this.myId = NULL_PEER_ID; this.connectionStatus = {}; this.premium = false; + this.premiumBak = this.premium; // octt: force local premium this.addEventListener('user_auth', ({id}) => { this.myId = id.toPeerId(); @@ -249,7 +251,7 @@ export class RootScope extends EventListenerBase { } public getPremium() { - return true; // this.premium; // octt: force premium enabled + return this.premium; } public dispatchEventSingle(...args: any[]) { diff --git a/webk/src/scripts/out/langPack.strings b/webk/src/scripts/out/langPack.strings index ef68ec2..6b1b095 100644 --- a/webk/src/scripts/out/langPack.strings +++ b/webk/src/scripts/out/langPack.strings @@ -749,6 +749,8 @@ "TextSize" = "Message Text Size"; "ChatBackground" = "Chat Wallpaper"; "EnableAnimations" = "Enable Animations"; +"ShowMessageCheckmarks" = "Show Message Checkmarks"; +"ForceLocalPremium" = "Force Local Premium"; "AutoDownloadMedia" = "Auto-Download Media"; "AutodownloadContacts" = "Contacts"; "AutodownloadPrivateChats" = "Private Chats"; @@ -2489,7 +2491,7 @@ "Input.Quote.Expanded" = "Quote text will be fully visible"; "CopyRestricted.Channel" = "Sorry, copying from this channel is disabled by its admins."; "CopyRestricted.Group" = "Sorry, copying from this group is disabled by its admins."; -"Login.Title" = "Sign in to Telegram"; +"Login.Title" = "Sign in to Spaccogram"; "Login.PhoneLabel" = "Phone Number"; "Login.PhoneLabelInvalid" = "Phone Number Invalid"; "Login.KeepSigned" = "Keep me signed in"; @@ -2512,7 +2514,7 @@ "Contacts.PhoneNumber.Placeholder" = "Phone Number"; "Login.Next" = "Next"; "Login.ContinueOnLanguage" = "Continue in English"; -"Login.QR.Title" = "Log in to Telegram by QR Code"; +"Login.QR.Title" = "Log in to Spaccogram by QR Code"; "Login.QR.Help1" = "Open Telegram on your phone"; "Login.QR.Help2" = "Go to **Settings** > **Devices** > **Link Desktop Device**"; "Login.QR.Help3" = "Point your phone at this screen to confirm login"; diff --git a/webk/src/scss/partials/_chatBubble.scss b/webk/src/scss/partials/_chatBubble.scss index 4360c5d..413d1d5 100644 --- a/webk/src/scss/partials/_chatBubble.scss +++ b/webk/src/scss/partials/_chatBubble.scss @@ -101,6 +101,15 @@ flex-wrap: wrap; //flex-direction: column; // fix 'Unread messages', still need to refactor it + // octt: hide checkmarks option + body.hide-chat-checkmarks & { + &.is-sent, &.is-read { + .time-sending-status { + display: none; + } + } + } + &.is-sponsored { --max-width: calc(80% - var(--message-beside-button-margin) * -1) !important; width: 100%; diff --git a/webk/src/scss/partials/_chatlist.scss b/webk/src/scss/partials/_chatlist.scss index ab7833c..cc390e4 100644 --- a/webk/src/scss/partials/_chatlist.scss +++ b/webk/src/scss/partials/_chatlist.scss @@ -248,6 +248,15 @@ ul.chatlist { } } + // octt: hide checkmarks option + body.hide-chat-checkmarks & { + .sending-status-icon { + &-check, &-checks { + display: none; + } + } + } + @include respond-to(not-handhelds) { &.active { --background: var(--primary-color) !important; diff --git a/webk/src/scss/partials/_leftSidebar.scss b/webk/src/scss/partials/_leftSidebar.scss index 34f0f23..7d07d5d 100644 --- a/webk/src/scss/partials/_leftSidebar.scss +++ b/webk/src/scss/partials/_leftSidebar.scss @@ -313,6 +313,19 @@ opacity: 1; visibility: visible; } + + body.stealthmode-enabled & { + .attention-dot { + width: 8px; + height: 8px; + background-color: red; + border-radius: 100%; + bottom: 0; + left: 0; + position: absolute; + margin: 1em; + } + } } @include respond-to(handhelds) {