Support new /joinchat/ url format
This commit is contained in:
parent
730d79523f
commit
1d388fe62a
@ -308,12 +308,13 @@ export class AppImManager {
|
||||
}
|
||||
});
|
||||
|
||||
// Support old t.me/joinchat/asd and new t.me/+asd
|
||||
this.addAnchorListener<{pathnameParams: ['joinchat', string]}>({
|
||||
name: 'joinchat',
|
||||
callback: ({pathnameParams}) => {
|
||||
const link: InternalLink = {
|
||||
_: INTERNAL_LINK_TYPE.JOIN_CHAT,
|
||||
invite: pathnameParams[1]
|
||||
invite: pathnameParams[1] || decodeURIComponent(pathnameParams[0]).slice(1)
|
||||
};
|
||||
|
||||
this.processInternalLink(link);
|
||||
|
@ -847,6 +847,12 @@ namespace RichTextProcessor {
|
||||
url = 'tg://unsafe_url?url=' + encodeURIComponent(url);
|
||||
} else */if((tgMeMatch = url.match(/^(?:https?:\/\/)?t(?:elegram)?\.me\/(.+)/))) {
|
||||
const fullPath = tgMeMatch[1];
|
||||
|
||||
if(/^\W/.test(fullPath)) {
|
||||
onclick = 'joinchat';
|
||||
return {url, onclick};
|
||||
}
|
||||
|
||||
const path = fullPath.split('/');
|
||||
switch(path[0]) {
|
||||
case 'joinchat':
|
||||
|
Loading…
x
Reference in New Issue
Block a user