diff --git a/src/components/sidebarLeft/index.ts b/src/components/sidebarLeft/index.ts index 64b83b68..315d8a0f 100644 --- a/src/components/sidebarLeft/index.ts +++ b/src/components/sidebarLeft/index.ts @@ -173,14 +173,14 @@ export class AppSidebarLeft extends SidebarSlider { onClick: () => { location.href = 'https://web.telegram.org/z/'; }, - verify: () => location.hostname === 'web.telegram.org' + verify: () => App.isMainDomain }, { icon: 'char w', text: 'ChatList.Menu.SwitchTo.Webogram', onClick: () => { location.href = 'https://web.telegram.org/'; }, - verify: () => location.hostname === 'web.telegram.org' + verify: () => App.isMainDomain }]; this.toolsBtn = ButtonMenuToggle({}, 'bottom-right', menuButtons, (e) => { @@ -201,7 +201,7 @@ export class AppSidebarLeft extends SidebarSlider { btnMenuFooter.classList.add('btn-menu-footer'); const t = document.createElement('span'); t.classList.add('btn-menu-footer-text'); - t.innerHTML = 'Telegram WebK alpha ' + App.version; + t.innerHTML = 'Telegram Web' + App.suffix + ' alpha ' + App.version; btnMenuFooter.append(t); btnMenu.classList.add('has-footer'); btnMenu.append(btnMenuFooter); diff --git a/src/config/app.ts b/src/config/app.ts index a50451a6..06f0a5d3 100644 --- a/src/config/app.ts +++ b/src/config/app.ts @@ -17,7 +17,14 @@ const App = { langPack: 'macos', langPackCode: 'en', domains: [] as string[], - baseDcId: 2 + baseDcId: 2, + isMainDomain: location.hostname === 'web.telegram.org', + suffix: 'K' }; +if(App.isMainDomain) { // use Webogram credentials then + App.id = 2496; + App.hash = '8da85b0d5bfe62527e5b244c209159c3'; +} + export default App; diff --git a/src/lib/mtproto/networker.ts b/src/lib/mtproto/networker.ts index e32d095b..237e67c5 100644 --- a/src/lib/mtproto/networker.ts +++ b/src/lib/mtproto/networker.ts @@ -304,7 +304,7 @@ export default class MTPNetworker { serializer.storeInt(App.id, 'api_id'); serializer.storeString(navigator.userAgent || 'Unknown UserAgent', 'device_model'); serializer.storeString(navigator.platform || 'Unknown Platform', 'system_version'); - serializer.storeString(App.version, 'app_version'); + serializer.storeString(App.version + (App.isMainDomain ? ' ' + App.suffix : ''), 'app_version'); serializer.storeString(navigator.language || 'en', 'system_lang_code'); serializer.storeString(App.langPack, 'lang_pack'); serializer.storeString(navigator.language || 'en', 'lang_code');