webk 2.1.0.1
This commit is contained in:
@ -1,8 +1,8 @@
|
|||||||
VITE_API_ID=1025907
|
VITE_API_ID=1025907
|
||||||
VITE_API_HASH=452b0359b988148995f22ff0f4229750
|
VITE_API_HASH=452b0359b988148995f22ff0f4229750
|
||||||
VITE_VERSION=2.1.0
|
VITE_VERSION=2.1.0.1
|
||||||
VITE_VERSION_FULL=2.1.0 (520)
|
VITE_VERSION_FULL=2.1.0.1 (521)
|
||||||
VITE_BUILD=520
|
VITE_BUILD=521
|
||||||
VITE_MTPROTO_WORKER=1
|
VITE_MTPROTO_WORKER=1
|
||||||
VITE_MTPROTO_SW=
|
VITE_MTPROTO_SW=
|
||||||
VITE_MTPROTO_HTTP=
|
VITE_MTPROTO_HTTP=
|
||||||
|
6496
webk/pnpm-lock.yaml
generated
6496
webk/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
|||||||
2.1.0 (520)
|
2.1.0.1 (521)
|
@ -27,6 +27,7 @@ import EventListenerBase from '../helpers/eventListenerBase';
|
|||||||
import animationIntersector from './animationIntersector';
|
import animationIntersector from './animationIntersector';
|
||||||
import apiManagerProxy from '../lib/mtproto/mtprotoworker';
|
import apiManagerProxy from '../lib/mtproto/mtprotoworker';
|
||||||
import setCurrentTime from '../helpers/dom/setCurrentTime';
|
import setCurrentTime from '../helpers/dom/setCurrentTime';
|
||||||
|
import stealthMode from '../helpers/stealthMode';
|
||||||
|
|
||||||
// TODO: Safari: проверить стрим, включить его и сразу попробовать включить видео или другую песню
|
// TODO: Safari: проверить стрим, включить его и сразу попробовать включить видео или другую песню
|
||||||
// TODO: Safari: попробовать замаскировать подгрузку последнего чанка
|
// TODO: Safari: попробовать замаскировать подгрузку последнего чанка
|
||||||
@ -294,7 +295,7 @@ export class AppMediaPlaybackController extends EventListenerBase<{
|
|||||||
|
|
||||||
if(doc.type !== 'audio' && message?.pFlags.media_unread && message.fromId !== rootScope.myId) {
|
if(doc.type !== 'audio' && message?.pFlags.media_unread && message.fromId !== rootScope.myId) {
|
||||||
media.addEventListener('timeupdate', () => {
|
media.addEventListener('timeupdate', () => {
|
||||||
this.managers.appMessagesManager.readMessages(peerId, [mid]);
|
this.managers.appMessagesManager.readMessages(peerId, [mid], stealthMode.isEnabled());
|
||||||
}, {once: true});
|
}, {once: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,6 +185,7 @@ import safeWindowOpen from '../../helpers/dom/safeWindowOpen';
|
|||||||
import findAndSplice from '../../helpers/array/findAndSplice';
|
import findAndSplice from '../../helpers/array/findAndSplice';
|
||||||
import generatePhotoForExtendedMediaPreview from '../../lib/appManagers/utils/photos/generatePhotoForExtendedMediaPreview';
|
import generatePhotoForExtendedMediaPreview from '../../lib/appManagers/utils/photos/generatePhotoForExtendedMediaPreview';
|
||||||
import icon from '../icon';
|
import icon from '../icon';
|
||||||
|
import stealthMode from '../../helpers/stealthMode';
|
||||||
|
|
||||||
export const USER_REACTIONS_INLINE = false;
|
export const USER_REACTIONS_INLINE = false;
|
||||||
export const TEST_BUBBLES_DELETION = false;
|
export const TEST_BUBBLES_DELETION = false;
|
||||||
@ -2136,7 +2137,7 @@ export default class ChatBubbles {
|
|||||||
this.log('will readHistory by maxId:', maxId);
|
this.log('will readHistory by maxId:', maxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
callback = () => this.managers.appMessagesManager.readHistory(peerId, maxId, threadId);
|
callback = () => this.managers.appMessagesManager.readHistory(peerId, maxId, threadId, undefined, stealthMode.isEnabled());
|
||||||
} else {
|
} else {
|
||||||
const readContents: number[] = [];
|
const readContents: number[] = [];
|
||||||
for(const mid of this.unreadedContentSeen) {
|
for(const mid of this.unreadedContentSeen) {
|
||||||
@ -2150,7 +2151,7 @@ export default class ChatBubbles {
|
|||||||
this.log('will readMessages', readContents);
|
this.log('will readMessages', readContents);
|
||||||
}
|
}
|
||||||
|
|
||||||
callback = () => this.managers.appMessagesManager.readMessages(peerId, readContents);
|
callback = () => this.managers.appMessagesManager.readMessages(peerId, readContents, stealthMode.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
this[unreadedSeenKey].clear();
|
this[unreadedSeenKey].clear();
|
||||||
@ -4599,7 +4600,7 @@ export default class ChatBubbles {
|
|||||||
if(this.chat.type === ChatType.Chat || this.chat.type === ChatType.Discussion) {
|
if(this.chat.type === ChatType.Chat || this.chat.type === ChatType.Discussion) {
|
||||||
const {peerId, threadId} = this.chat;
|
const {peerId, threadId} = this.chat;
|
||||||
const historyMaxId = await this.chat.getHistoryMaxId();
|
const historyMaxId = await this.chat.getHistoryMaxId();
|
||||||
this.managers.appMessagesManager.readHistory(peerId, historyMaxId, threadId, true);
|
this.managers.appMessagesManager.readHistory(peerId, historyMaxId, threadId, true, stealthMode.isEnabled());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +127,7 @@ import createContextMenu from '../../helpers/dom/createContextMenu';
|
|||||||
import {Accessor, createEffect, createRoot, createSignal, Setter} from 'solid-js';
|
import {Accessor, createEffect, createRoot, createSignal, Setter} from 'solid-js';
|
||||||
import SelectedEffect from './selectedEffect';
|
import SelectedEffect from './selectedEffect';
|
||||||
import windowSize from '../../helpers/windowSize';
|
import windowSize from '../../helpers/windowSize';
|
||||||
|
import stealthMode from '../../helpers/stealthMode';
|
||||||
|
|
||||||
// console.log('Recorder', Recorder);
|
// console.log('Recorder', Recorder);
|
||||||
|
|
||||||
@ -713,7 +714,7 @@ export default class ChatInput {
|
|||||||
icon: 'readchats',
|
icon: 'readchats',
|
||||||
text: isReaction ? 'ReadAllReactions' : 'ReadAllMentions',
|
text: isReaction ? 'ReadAllReactions' : 'ReadAllMentions',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.managers.appMessagesManager.readMentions(this.chat.peerId, this.chat.threadId, isReaction);
|
this.managers.appMessagesManager.readMentions(this.chat.peerId, this.chat.threadId, isReaction, stealthMode.isEnabled());
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
listenTo: btn,
|
listenTo: btn,
|
||||||
|
@ -135,8 +135,8 @@ export default class ChatTranslation extends PinnedContainer {
|
|||||||
]});
|
]});
|
||||||
});
|
});
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => { // octt: force show translation menu on all chats, to curb some issues
|
||||||
this.toggle(!peerTranslation().shouldShow());
|
this.toggle(false); // (!peerTranslation().shouldShow());
|
||||||
});
|
});
|
||||||
|
|
||||||
const listenerSetter = new ListenerSetter();
|
const listenerSetter = new ListenerSetter();
|
||||||
@ -160,11 +160,11 @@ export default class ChatTranslation extends PinnedContainer {
|
|||||||
},
|
},
|
||||||
verify: isPremium,
|
verify: isPremium,
|
||||||
separatorDown: true
|
separatorDown: true
|
||||||
}, {
|
}, { // octt: make the disable translation button into a toggle button
|
||||||
icon: 'crossround',
|
icon: 'crossround',
|
||||||
text: 'Hide',
|
text: 'Toggle', // 'Hide',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.managers.appTranslationsManager.togglePeerTranslations(peerId(), true);
|
this.managers.appTranslationsManager.togglePeerTranslations(peerId(), peerTranslation().shouldShow()); // true);
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
listenerSetter
|
listenerSetter
|
||||||
|
@ -301,7 +301,7 @@ export default class DialogsContextMenu {
|
|||||||
if(!this.threadId) {
|
if(!this.threadId) {
|
||||||
this.managers.appMessagesManager.markDialogUnread(peerId, true);
|
this.managers.appMessagesManager.markDialogUnread(peerId, true);
|
||||||
} else {
|
} else {
|
||||||
this.managers.appMessagesManager.readHistory(peerId, dialog.top_message, this.threadId);
|
this.managers.appMessagesManager.readHistory(peerId, dialog.top_message, this.threadId, undefined, false);
|
||||||
}
|
}
|
||||||
} else if(!this.threadId) {
|
} else if(!this.threadId) {
|
||||||
this.managers.appMessagesManager.markDialogUnread(peerId);
|
this.managers.appMessagesManager.markDialogUnread(peerId);
|
||||||
|
@ -52,6 +52,7 @@ import mediaSizes from '../../helpers/mediaSizes';
|
|||||||
import {fastRaf} from '../../helpers/schedulers';
|
import {fastRaf} from '../../helpers/schedulers';
|
||||||
import {getInstallPrompt} from '../../helpers/dom/installPrompt';
|
import {getInstallPrompt} from '../../helpers/dom/installPrompt';
|
||||||
import liteMode from '../../helpers/liteMode';
|
import liteMode from '../../helpers/liteMode';
|
||||||
|
import stealthMode from '../../helpers/stealthMode';
|
||||||
import AppPowerSavingTab from './tabs/powerSaving';
|
import AppPowerSavingTab from './tabs/powerSaving';
|
||||||
import AppMyStoriesTab from './tabs/myStories';
|
import AppMyStoriesTab from './tabs/myStories';
|
||||||
import {joinDeepPath} from '../../helpers/object/setDeepProperty';
|
import {joinDeepPath} from '../../helpers/object/setDeepProperty';
|
||||||
@ -156,6 +157,14 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
themeCheckboxField.setValueSilently(themeController.getTheme().name === 'night');
|
themeCheckboxField.setValueSilently(themeController.getTheme().name === 'night');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const stealthCheckboxField = new CheckboxField({ // octt: //
|
||||||
|
toggle: true,
|
||||||
|
checked: stealthMode.isEnabled()
|
||||||
|
});
|
||||||
|
stealthCheckboxField.input.addEventListener('change', () => {
|
||||||
|
stealthMode.setState(stealthCheckboxField.checked);
|
||||||
|
});
|
||||||
|
|
||||||
const menuButtons: (ButtonMenuItemOptions & {verify?: () => boolean | Promise<boolean>})[] = [{
|
const menuButtons: (ButtonMenuItemOptions & {verify?: () => boolean | Promise<boolean>})[] = [{
|
||||||
icon: 'savedmessages',
|
icon: 'savedmessages',
|
||||||
text: 'SavedMessages',
|
text: 'SavedMessages',
|
||||||
@ -216,6 +225,17 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
this.createTab(AppPowerSavingTab).open();
|
this.createTab(AppPowerSavingTab).open();
|
||||||
},
|
},
|
||||||
verify: () => liteMode.isEnabled()
|
verify: () => liteMode.isEnabled()
|
||||||
|
}, { // octt: stealth mode
|
||||||
|
icon: 'deletedaccount',
|
||||||
|
text: 'PremiumStoriesStealth',
|
||||||
|
onClick: () => {},
|
||||||
|
checkboxField: stealthCheckboxField
|
||||||
|
}, { // octt: Spaccogram Channel
|
||||||
|
icon: 'help',
|
||||||
|
text: 'SpaccogramNewsInfo',
|
||||||
|
onClick: () => {
|
||||||
|
appImManager.openUrl('https://t.me/+ujaob63Vy705Mzgx');
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
icon: 'help',
|
icon: 'help',
|
||||||
text: 'TelegramFeatures',
|
text: 'TelegramFeatures',
|
||||||
@ -223,7 +243,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
const url = I18n.format('TelegramFeaturesUrl', true);
|
const url = I18n.format('TelegramFeaturesUrl', true);
|
||||||
appImManager.openUrl(url);
|
appImManager.openUrl(url);
|
||||||
}
|
}
|
||||||
}, {
|
}, /* { // octt: disable this, official devs must not get bug reports from noobs using my broken code
|
||||||
icon: 'bug',
|
icon: 'bug',
|
||||||
text: 'ReportBug',
|
text: 'ReportBug',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@ -236,7 +256,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
a.remove();
|
a.remove();
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
}, {
|
}, */ /* { // octt: disable switch to WebA
|
||||||
icon: 'char' as Icon,
|
icon: 'char' as Icon,
|
||||||
className: 'a',
|
className: 'a',
|
||||||
text: 'ChatList.Menu.SwitchTo.A',
|
text: 'ChatList.Menu.SwitchTo.A',
|
||||||
@ -249,7 +269,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
verify: () => App.isMainDomain
|
verify: () => App.isMainDomain
|
||||||
}, /* {
|
}, */ /* {
|
||||||
icon: 'char w',
|
icon: 'char w',
|
||||||
text: 'ChatList.Menu.SwitchTo.Webogram',
|
text: 'ChatList.Menu.SwitchTo.Webogram',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@ -300,9 +320,9 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
buttons.splice(3, 0, ...attachMenuBotsButtons);
|
buttons.splice(3, 0, ...attachMenuBotsButtons);
|
||||||
filteredButtons.splice(0, filteredButtons.length, ...buttons);
|
filteredButtons.splice(0, filteredButtons.length, ...buttons);
|
||||||
},
|
},
|
||||||
onOpen: (e, btnMenu) => {
|
onOpen: (e, btnMenu) => { // octt: branding
|
||||||
const btnMenuFooter = document.createElement('a');
|
const btnMenuFooter = document.createElement('a');
|
||||||
btnMenuFooter.href = 'https://github.com/morethanwords/tweb/blob/master/CHANGELOG.md';
|
// btnMenuFooter.href = 'https://github.com/morethanwords/tweb/blob/master/CHANGELOG.md';
|
||||||
setBlankToAnchor(btnMenuFooter);
|
setBlankToAnchor(btnMenuFooter);
|
||||||
btnMenuFooter.classList.add('btn-menu-footer');
|
btnMenuFooter.classList.add('btn-menu-footer');
|
||||||
btnMenuFooter.addEventListener(CLICK_EVENT_NAME, (e) => {
|
btnMenuFooter.addEventListener(CLICK_EVENT_NAME, (e) => {
|
||||||
@ -311,7 +331,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
});
|
});
|
||||||
const t = document.createElement('span');
|
const t = document.createElement('span');
|
||||||
t.classList.add('btn-menu-footer-text');
|
t.classList.add('btn-menu-footer-text');
|
||||||
t.textContent = 'Telegram Web' + App.suffix + ' '/* ' alpha ' */ + App.versionFull;
|
t.textContent = /* 'Telegram Web' */ 'Spaccogram Web' + App.suffix + ' '/* ' alpha ' */ + App.versionFull;
|
||||||
btnMenuFooter.append(t);
|
btnMenuFooter.append(t);
|
||||||
btnMenu.classList.add('has-footer');
|
btnMenu.classList.add('has-footer');
|
||||||
btnMenu.append(btnMenuFooter);
|
btnMenu.append(btnMenuFooter);
|
||||||
|
@ -11,7 +11,10 @@
|
|||||||
|
|
||||||
import type {TrueDcId} from '../types';
|
import type {TrueDcId} from '../types';
|
||||||
|
|
||||||
export const MAIN_DOMAINS = ['web.telegram.org', 'webk.telegram.org'];
|
export const MAIN_DOMAINS = [
|
||||||
|
'web.telegram.org', 'webk.telegram.org',
|
||||||
|
'tweb.octt.eu.org' // octt: fork domain
|
||||||
|
];
|
||||||
export const DEFAULT_BACKGROUND_SLUG = 'pattern';
|
export const DEFAULT_BACKGROUND_SLUG = 'pattern';
|
||||||
|
|
||||||
const threads = Math.min(4, navigator.hardwareConcurrency ?? 4);
|
const threads = Math.min(4, navigator.hardwareConcurrency ?? 4);
|
||||||
|
@ -109,7 +109,8 @@ export type State = {
|
|||||||
nightTheme?: boolean, // ! DEPRECATED
|
nightTheme?: boolean, // ! DEPRECATED
|
||||||
timeFormat: 'h12' | 'h23',
|
timeFormat: 'h12' | 'h23',
|
||||||
liteMode: {[key in LiteModeKey]: boolean},
|
liteMode: {[key in LiteModeKey]: boolean},
|
||||||
savedAsForum: boolean
|
savedAsForum: boolean,
|
||||||
|
stealthMode: boolean // octt: //
|
||||||
},
|
},
|
||||||
playbackParams: ReturnType<AppMediaPlaybackController['getPlaybackParams']>,
|
playbackParams: ReturnType<AppMediaPlaybackController['getPlaybackParams']>,
|
||||||
keepSigned: boolean,
|
keepSigned: boolean,
|
||||||
@ -305,26 +306,27 @@ export const STATE_INIT: State = {
|
|||||||
sound: false
|
sound: false
|
||||||
},
|
},
|
||||||
timeFormat: getTimeFormat(),
|
timeFormat: getTimeFormat(),
|
||||||
liteMode: {
|
liteMode: { // octt: many lite mode properties enabled by default
|
||||||
all: false,
|
all: false,
|
||||||
animations: false,
|
animations: true,
|
||||||
chat: false,
|
chat: true,
|
||||||
chat_background: false,
|
chat_background: true,
|
||||||
chat_spoilers: false,
|
chat_spoilers: true,
|
||||||
effects: false,
|
effects: true,
|
||||||
effects_premiumstickers: false,
|
effects_premiumstickers: true,
|
||||||
effects_reactions: false,
|
effects_reactions: true,
|
||||||
effects_emoji: false,
|
effects_emoji: true,
|
||||||
emoji: false,
|
emoji: true,
|
||||||
emoji_messages: false,
|
emoji_messages: true,
|
||||||
emoji_panel: false,
|
emoji_panel: true,
|
||||||
gif: false,
|
gif: false,
|
||||||
stickers: false,
|
stickers: false,
|
||||||
stickers_chat: false,
|
stickers_chat: false,
|
||||||
stickers_panel: false,
|
stickers_panel: true,
|
||||||
video: false
|
video: false
|
||||||
},
|
},
|
||||||
savedAsForum: false
|
savedAsForum: false,
|
||||||
|
stealthMode: false // octt: //
|
||||||
},
|
},
|
||||||
playbackParams: {
|
playbackParams: {
|
||||||
volume: 1,
|
volume: 1,
|
||||||
|
24
webk/src/helpers/stealthMode.ts
Normal file
24
webk/src/helpers/stealthMode.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* https://github.com/morethanwords/tweb
|
||||||
|
* Copyright (C) 2019-2021 Eduard Kuzmenko
|
||||||
|
* Copyright (C) 2024-2024 OctoSpacc, Spacc Inc.
|
||||||
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {MOUNT_CLASS_TO} from '../config/debug';
|
||||||
|
import rootScope from '../lib/rootScope';
|
||||||
|
import {joinDeepPath} from './object/setDeepProperty';
|
||||||
|
|
||||||
|
export class StealthMode {
|
||||||
|
public isEnabled() {
|
||||||
|
return !!(rootScope.settings && rootScope.settings.stealthMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public setState(state: boolean) {
|
||||||
|
return rootScope.managers.appStateManager.setByKey(joinDeepPath('settings', 'stealthMode'), state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const stealthMode = new StealthMode();
|
||||||
|
MOUNT_CLASS_TO && (MOUNT_CLASS_TO.stealthMode = stealthMode);
|
||||||
|
export default stealthMode;
|
@ -316,7 +316,7 @@ IMAGE_MIME_TYPES_SUPPORTED_PROMISE.then((mimeTypes) => {
|
|||||||
I18n.setTimeFormat(stateResult.state.settings.timeFormat);
|
I18n.setTimeFormat(stateResult.state.settings.timeFormat);
|
||||||
|
|
||||||
rootScope.managers.rootScope.getPremium().then((isPremium) => {
|
rootScope.managers.rootScope.getPremium().then((isPremium) => {
|
||||||
rootScope.premium = isPremium;
|
rootScope.premium = true; // isPremium; // octt: force premium to be enabled
|
||||||
});
|
});
|
||||||
|
|
||||||
themeController.setThemeListener();
|
themeController.setThemeListener();
|
||||||
|
@ -1122,6 +1122,7 @@ const lang = {
|
|||||||
},
|
},
|
||||||
'HidAccount': 'The account was hidden by the user',
|
'HidAccount': 'The account was hidden by the user',
|
||||||
'TelegramFeatures': 'Telegram Features',
|
'TelegramFeatures': 'Telegram Features',
|
||||||
|
'SpaccogramNewsInfo': 'Spaccogram News & Info',
|
||||||
'SetColor': 'Set a color',
|
'SetColor': 'Set a color',
|
||||||
'Open': 'Open',
|
'Open': 'Open',
|
||||||
'OpenUrlTitle': 'Open Link',
|
'OpenUrlTitle': 'Open Link',
|
||||||
@ -1478,6 +1479,7 @@ const lang = {
|
|||||||
'UsernameDeactivateLinkChannelMessage': 'Do you want to hide this link from the channel info page?',
|
'UsernameDeactivateLinkChannelMessage': 'Do you want to hide this link from the channel info page?',
|
||||||
'Hide': 'Hide',
|
'Hide': 'Hide',
|
||||||
'Show': 'Show',
|
'Show': 'Show',
|
||||||
|
'Toggle': 'Toggle', // octt
|
||||||
'UsernameActivateErrorTitle': 'Too many active links',
|
'UsernameActivateErrorTitle': 'Too many active links',
|
||||||
'UsernameActivateErrorMessage': 'Sorry, you have too many active public links already. Please hide one of your active public links first.',
|
'UsernameActivateErrorMessage': 'Sorry, you have too many active public links already. Please hide one of your active public links first.',
|
||||||
'ChannelSignMessages': 'Sign Messages',
|
'ChannelSignMessages': 'Sign Messages',
|
||||||
|
@ -1217,6 +1217,8 @@ export class AppImManager extends EventListenerBase<{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false; // octt: don't block copy
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const peerId = bubble.dataset.peerId.toPeerId();
|
const peerId = bubble.dataset.peerId.toPeerId();
|
||||||
const chat = apiManagerProxy.getChat(peerId.toChatId());
|
const chat = apiManagerProxy.getChat(peerId.toChatId());
|
||||||
|
@ -58,7 +58,7 @@ import getStickerEffectThumb from './utils/stickers/getStickerEffectThumb';
|
|||||||
import getDocumentInput from './utils/docs/getDocumentInput';
|
import getDocumentInput from './utils/docs/getDocumentInput';
|
||||||
import reactionsEqual from './utils/reactions/reactionsEqual';
|
import reactionsEqual from './utils/reactions/reactionsEqual';
|
||||||
import getPeerActiveUsernames from './utils/peers/getPeerActiveUsernames';
|
import getPeerActiveUsernames from './utils/peers/getPeerActiveUsernames';
|
||||||
import {BroadcastEvents} from '../rootScope';
|
import rootScope, {BroadcastEvents} from '../rootScope';
|
||||||
import setBooleanFlag from '../../helpers/object/setBooleanFlag';
|
import setBooleanFlag from '../../helpers/object/setBooleanFlag';
|
||||||
import getMessageThreadId from './utils/messages/getMessageThreadId';
|
import getMessageThreadId from './utils/messages/getMessageThreadId';
|
||||||
import callbackify from '../../helpers/callbackify';
|
import callbackify from '../../helpers/callbackify';
|
||||||
@ -78,6 +78,7 @@ import getMainGroupedMessage from './utils/messages/getMainGroupedMessage';
|
|||||||
import getUnreadReactions from './utils/messages/getUnreadReactions';
|
import getUnreadReactions from './utils/messages/getUnreadReactions';
|
||||||
import isMentionUnread from './utils/messages/isMentionUnread';
|
import isMentionUnread from './utils/messages/isMentionUnread';
|
||||||
import canMessageHaveFactCheck from './utils/messages/canMessageHaveFactCheck';
|
import canMessageHaveFactCheck from './utils/messages/canMessageHaveFactCheck';
|
||||||
|
import stealthMode from '../../helpers/stealthMode';
|
||||||
|
|
||||||
// console.trace('include');
|
// console.trace('include');
|
||||||
// TODO: если удалить диалог находясь в папке, то он не удалится из папки и будет виден в настройках
|
// TODO: если удалить диалог находясь в папке, то он не удалится из папки и будет виден в настройках
|
||||||
@ -5030,8 +5031,8 @@ export class AppMessagesManager extends AppManager {
|
|||||||
return Promise.all(promises).then(noop);
|
return Promise.all(promises).then(noop);
|
||||||
}
|
}
|
||||||
|
|
||||||
public readHistory(peerId: PeerId, maxId = 0, threadId?: number, force = false) {
|
public readHistory(peerId: PeerId, maxId = 0, threadId?: number, force = false, stealthMode: boolean = false) {
|
||||||
if(DO_NOT_READ_HISTORY) {
|
if(DO_NOT_READ_HISTORY || stealthMode) { // octt: //
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5321,8 +5322,8 @@ export class AppMessagesManager extends AppManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public readMessages(peerId: PeerId, msgIds: number[]) {
|
public readMessages(peerId: PeerId, msgIds: number[], stealthMode: boolean = false) {
|
||||||
if(DO_NOT_READ_HISTORY) {
|
if(DO_NOT_READ_HISTORY || stealthMode) { // octt: //
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5367,8 +5368,8 @@ export class AppMessagesManager extends AppManager {
|
|||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async readMentions(peerId: PeerId, threadId?: number, isReaction?: boolean): Promise<boolean> {
|
public async readMentions(peerId: PeerId, threadId?: number, isReaction?: boolean, stealthMode: boolean = false): Promise<boolean> {
|
||||||
if(DO_NOT_READ_HISTORY) {
|
if(DO_NOT_READ_HISTORY || stealthMode) { // octt: //
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,6 +304,7 @@ export class AppPeersManager extends AppManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public noForwards(peerId: PeerId) {
|
public noForwards(peerId: PeerId) {
|
||||||
|
return false; // octt: always allow forwards
|
||||||
if(peerId.isUser()) return false;
|
if(peerId.isUser()) return false;
|
||||||
else {
|
else {
|
||||||
const chat = this.appChatsManager.getChat(peerId.toChatId());
|
const chat = this.appChatsManager.getChat(peerId.toChatId());
|
||||||
|
@ -2,5 +2,6 @@ import {isRestricted} from '../../../../helpers/restrictions';
|
|||||||
import {Message} from '../../../../layer';
|
import {Message} from '../../../../layer';
|
||||||
|
|
||||||
export default function isMessageRestricted(message: Message.message) {
|
export default function isMessageRestricted(message: Message.message) {
|
||||||
|
return false; // octt: make no message appear restricted
|
||||||
return !!(message.restriction_reason && isRestricted(message.restriction_reason));
|
return !!(message.restriction_reason && isRestricted(message.restriction_reason));
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import {isRestricted} from '../../../../helpers/restrictions';
|
|||||||
import {Chat, User} from '../../../../layer';
|
import {Chat, User} from '../../../../layer';
|
||||||
|
|
||||||
export default function isPeerRestricted(peer: Chat | User) {
|
export default function isPeerRestricted(peer: Chat | User) {
|
||||||
|
return false; // octt: make no chat appear restricted
|
||||||
const restrictionReasons = (peer as Chat.channel)?.restriction_reason;
|
const restrictionReasons = (peer as Chat.channel)?.restriction_reason;
|
||||||
return !!(restrictionReasons && (peer as Chat.channel).pFlags.restricted && isRestricted(restrictionReasons));
|
return !!(restrictionReasons && (peer as Chat.channel).pFlags.restricted && isRestricted(restrictionReasons));
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ export class RootScope extends EventListenerBase<BroadcastEventsListeners> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getPremium() {
|
public getPremium() {
|
||||||
return this.premium;
|
return true; // this.premium; // octt: force premium enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispatchEventSingle(...args: any[]) {
|
public dispatchEventSingle(...args: any[]) {
|
||||||
|
@ -966,6 +966,7 @@
|
|||||||
"Stickers_other" = "%1$d stickers";
|
"Stickers_other" = "%1$d stickers";
|
||||||
"HidAccount" = "The account was hidden by the user";
|
"HidAccount" = "The account was hidden by the user";
|
||||||
"TelegramFeatures" = "Telegram Features";
|
"TelegramFeatures" = "Telegram Features";
|
||||||
|
"SpaccogramNewsInfo" = "Spaccogram News & Info";
|
||||||
"SetColor" = "Set a color";
|
"SetColor" = "Set a color";
|
||||||
"Open" = "Open";
|
"Open" = "Open";
|
||||||
"OpenUrlTitle" = "Open Link";
|
"OpenUrlTitle" = "Open Link";
|
||||||
@ -1296,6 +1297,7 @@
|
|||||||
"UsernameDeactivateLinkChannelMessage" = "Do you want to hide this link from the channel info page?";
|
"UsernameDeactivateLinkChannelMessage" = "Do you want to hide this link from the channel info page?";
|
||||||
"Hide" = "Hide";
|
"Hide" = "Hide";
|
||||||
"Show" = "Show";
|
"Show" = "Show";
|
||||||
|
"Toggle" = "Toggle";
|
||||||
"UsernameActivateErrorTitle" = "Too many active links";
|
"UsernameActivateErrorTitle" = "Too many active links";
|
||||||
"UsernameActivateErrorMessage" = "Sorry, you have too many active public links already. Please hide one of your active public links first.";
|
"UsernameActivateErrorMessage" = "Sorry, you have too many active public links already. Please hide one of your active public links first.";
|
||||||
"ChannelSignMessages" = "Sign Messages";
|
"ChannelSignMessages" = "Sign Messages";
|
||||||
|
@ -127,14 +127,18 @@ export default function usePeerLanguage(peerId: () => PeerId, onlyIfForeign?: bo
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// octt: fallback translation language, useful for reading restricted chats
|
||||||
|
// TODO add source language selection menu
|
||||||
|
const languageFallback = ('it' as TranslatableLanguageISO);
|
||||||
|
|
||||||
_createStore?.();
|
_createStore?.();
|
||||||
const current = state[_peerId];
|
const current = state[_peerId];
|
||||||
if(current && current.total < MIN_TOTAL_PROCESSED_MESSAGES && !current.isFull) {
|
if(current && current.total < MIN_TOTAL_PROCESSED_MESSAGES && !current.isFull) {
|
||||||
return;
|
return languageFallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(onlyIfForeign && current && (current.totalForeign / current.total) < MIN_FOREIGN_PERCENTAGE) {
|
if(onlyIfForeign && current && (current.totalForeign / current.total) < MIN_FOREIGN_PERCENTAGE) {
|
||||||
return;
|
return languageFallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
return current?.language;
|
return current?.language;
|
||||||
|
@ -12,12 +12,12 @@ import {ServerOptions} from 'vite';
|
|||||||
|
|
||||||
const rootDir = resolve(__dirname);
|
const rootDir = resolve(__dirname);
|
||||||
|
|
||||||
const handlebarsPlugin = handlebars({
|
const handlebarsPlugin = handlebars({ // octt: fork branding
|
||||||
context: {
|
context: {
|
||||||
title: 'Telegram Web',
|
title: 'Spaccogram Web', // 'Telegram Web',
|
||||||
description: 'Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.',
|
description: 'Spaccogram Web is an unofficial fork of Telegram Web made for advanced users and developers.', // 'Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.',
|
||||||
url: 'https://web.telegram.org/k/',
|
url: 'https://tweb.octt.eu.org/', // 'https://web.telegram.org/k/',
|
||||||
origin: 'https://web.telegram.org/'
|
origin: 'https://tweb.octt.eu.org/', // 'https://web.telegram.org/'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user