Browse Source

Fix forward message fromID

master
morethanwords 4 years ago
parent
commit
1c6e90efa6
  1. 4
      src/lib/appManagers/appMessagesManager.ts
  2. 10
      src/lib/richtextprocessor.ts

4
src/lib/appManagers/appMessagesManager.ts

@ -2255,12 +2255,12 @@ export class AppMessagesManager { @@ -2255,12 +2255,12 @@ export class AppMessagesManager {
apiMessage.savedFrom = savedFromPeerID + '_' + savedFromMid;
}
apiMessage.fromID = fwdHeader.channel_id ? -fwdHeader.channel_id : appPeersManager.getPeerID(fwdHeader.from_id);
apiMessage.fromID = appPeersManager.getPeerID(deepEqual(apiMessage.from_id, fwdHeader.from_id) ? fwdHeader.from_id : apiMessage.from_id);
/* } else {
apiMessage.fwdPostID = fwdHeader.channel_post;
} */
apiMessage.fwdFromID = fwdHeader.channel_id ? -fwdHeader.channel_id : appPeersManager.getPeerID(fwdHeader.from_id);
apiMessage.fwdFromID = appPeersManager.getPeerID(fwdHeader.from_id);
fwdHeader.date -= serverTimeManager.serverTimeOffset;
}

10
src/lib/richtextprocessor.ts

@ -750,9 +750,9 @@ namespace RichTextProcessor { @@ -750,9 +750,9 @@ namespace RichTextProcessor {
var tgMeMatch;
var telescoPeMatch;
if(unsafe == 2) {
/* if(unsafe == 2) {
url = 'tg://unsafe_url?url=' + encodeURIComponent(url);
} else if((tgMeMatch = url.match(/^https?:\/\/t(?:elegram)?\.me\/(.+)/))) {
} else */if((tgMeMatch = url.match(/^https?:\/\/t(?:elegram)?\.me\/(.+)/))) {
var fullPath = tgMeMatch[1];
var path = fullPath.split('/');
switch(path[0]) {
@ -788,9 +788,9 @@ namespace RichTextProcessor { @@ -788,9 +788,9 @@ namespace RichTextProcessor {
}
} else if((telescoPeMatch = url.match(/^https?:\/\/telesco\.pe\/([^/?]+)\/(\d+)/))) {
url = 'tg://resolve?domain=' + telescoPeMatch[1] + '&post=' + telescoPeMatch[2];
} else if(unsafe) {
//url = 'tg://unsafe_url?url=' + encodeURIComponent(url);
}
}/* else if(unsafe) {
url = 'tg://unsafe_url?url=' + encodeURIComponent(url);
} */
return url;
}

Loading…
Cancel
Save