Browse Source

I2P changes

Signed-off-by: r4sas <r4sas@i2pmail.org>
master
R4SAS 2 years ago
parent
commit
703606f3a4
  1. 21
      src/components/sidebarLeft/index.ts
  2. 6
      src/config/app.ts
  3. 5
      src/lib/mtproto/dcConfigurator.ts
  4. 4
      src/lib/mtproto/telegramMeWebManager.ts

21
src/components/sidebarLeft/index.ts

@ -194,27 +194,6 @@ export class AppSidebarLeft extends SidebarSlider { @@ -194,27 +194,6 @@ export class AppSidebarLeft extends SidebarSlider {
a.remove();
}, 0);
}
}, {
icon: 'char z',
text: 'ChatList.Menu.SwitchTo.Z',
onClick: () => {
Promise.all([
sessionStorage.set({kz_version: 'Z'}),
sessionStorage.delete('tgme_sync')
]).then(() => {
location.href = 'https://web.telegram.org/z/';
});
},
verify: () => App.isMainDomain
}, {
icon: 'char w',
text: 'ChatList.Menu.SwitchTo.Webogram',
onClick: () => {
sessionStorage.delete('tgme_sync').then(() => {
location.href = 'https://web.telegram.org/?legacy=1';
});
},
verify: () => App.isMainDomain
}];
const filteredButtons = menuButtons.filter(Boolean);

6
src/config/app.ts

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
import type {DcId} from '../types';
export const MAIN_DOMAIN = 'web.telegram.org';
export const MAIN_DOMAIN = 'web.telegram.i2p';
const App = {
id: +process.env.API_ID,
@ -30,8 +30,8 @@ const App = { @@ -30,8 +30,8 @@ const App = {
};
if(App.isMainDomain) { // use Webogram credentials then
App.id = 2496;
App.hash = '8da85b0d5bfe62527e5b244c209159c3';
App.id = 619296;
App.hash = '9461c49c28b238b90480371311149169';
}
export default App;

5
src/lib/mtproto/dcConfigurator.ts

@ -52,7 +52,7 @@ export function getTelegramConnectionSuffix(connectionType: ConnectionType) { @@ -52,7 +52,7 @@ export function getTelegramConnectionSuffix(connectionType: ConnectionType) {
export function constructTelegramWebSocketUrl(dcId: DcId, connectionType: ConnectionType, premium?: boolean) {
const suffix = getTelegramConnectionSuffix(connectionType);
const path = connectionType !== 'client' ? 'apiws' + TEST_SUFFIX + (premium ? PREMIUM_SUFFIX : '') : ('apiws' + TEST_SUFFIX);
const chosenServer = `wss://${App.suffix.toLowerCase()}ws${dcId}${suffix}.web.telegram.org/${path}`;
const chosenServer = `wss://web.telegram.i2p/${App.suffix.toLowerCase()}ws${dcId}${suffix}/${path}`;
return chosenServer;
}
@ -102,7 +102,8 @@ export class DcConfigurator { @@ -102,7 +102,8 @@ export class DcConfigurator {
const suffix = getTelegramConnectionSuffix(connectionType);
const subdomain = this.sslSubdomains[dcId - 1] + suffix;
const path = Modes.test ? 'apiw_test1' : 'apiw1';
chosenServer = 'https://' + subdomain + '.web.telegram.org/' + path;
//chosenServer = 'https://' + subdomain + '.web.telegram.org/' + path;
chosenServer = 'https://web.telegram.i2p/web/' + subdomain + '/' + path;
} else {
for(const dcOption of this.dcOptions) {
if(dcOption.id === dcId) {

4
src/lib/mtproto/telegramMeWebManager.ts

@ -43,8 +43,8 @@ export class TelegramMeWebManager { @@ -43,8 +43,8 @@ export class TelegramMeWebManager {
const path = `_websync_?authed=${canRedirect ? '1' : '0'}&version=${encodeURIComponent(App.version + ' ' + App.suffix)}`;
const urls = [
'//telegram.me/' + path,
'//t.me/' + path
'//web.telegram.i2p/telegram-me/' + path,
'//web.telegram.i2p/t-me/' + path,
];
const promises = urls.map((url) => {

Loading…
Cancel
Save