Browse Source

Maybe fixed message fromID again

master
morethanwords 4 years ago
parent
commit
56ce8020a9
  1. 18
      src/lib/appManagers/appMessagesManager.ts
  2. 4
      src/scss/partials/_chatBubble.scss

18
src/lib/appManagers/appMessagesManager.ts

@ -2285,8 +2285,8 @@ export class AppMessagesManager { @@ -2285,8 +2285,8 @@ export class AppMessagesManager {
const myID = appUsersManager.getSelf().id;
message.peerID = peerID;
if(message.peerID == myID && !message.from_id && !message.fwd_from) {
message.fromID = myID;
if(message.peerID == myID/* && !message.from_id && !message.fwd_from */) {
message.fromID = message.fwd_from?.from_id ? appPeersManager.getPeerID(message.fwd_from.from_id) : myID;
} else {
message.fromID = message.pFlags.post || (!message.pFlags.out && !message.from_id) ? peerID : appPeersManager.getPeerID(message.from_id);
}
@ -2301,9 +2301,9 @@ export class AppMessagesManager { @@ -2301,9 +2301,9 @@ export class AppMessagesManager {
message.savedFrom = savedFromPeerID + '_' + savedFromMid;
}
if(peerID < 0 || peerID == myID) {
/* if(peerID < 0 || peerID == myID) {
message.fromID = appPeersManager.getPeerID(!message.from_id || deepEqual(message.from_id, fwdHeader.from_id) ? fwdHeader.from_id : message.from_id);
}
} */
/* } else {
apiMessage.fwdPostID = fwdHeader.channel_post;
} */
@ -2466,10 +2466,10 @@ export class AppMessagesManager { @@ -2466,10 +2466,10 @@ export class AppMessagesManager {
message.totalEntities = RichTextProcessor.mergeEntities(myEntities, apiEntities, !message.pending);
}
if(!options.isEdited) {
//if(!options.isEdited) {
this.messagesStorage[mid] = message;
(this.messagesStorageByPeerID[peerID] ?? (this.messagesStorageByPeerID[peerID] = {}))[mid] = message;
}
//}
});
if(albums) {
@ -2543,11 +2543,11 @@ export class AppMessagesManager { @@ -2543,11 +2543,11 @@ export class AppMessagesManager {
// * 80 for chatlist in landscape orientation
text = limitSymbols(text, 75, 80);
let entities = RichTextProcessor.parseEntities(text.replace(/\n/g, ' '));
const entities = RichTextProcessor.parseEntities(text.replace(/\n/g, ' '));
messageWrapped = RichTextProcessor.wrapRichText(text, {
noLinebreaks: true,
entities: entities,
entities,
noLinks: true,
noTextFormat: true
});
@ -3777,7 +3777,7 @@ export class AppMessagesManager { @@ -3777,7 +3777,7 @@ export class AppMessagesManager {
}
// console.trace(dT(), 'edit message', message)
this.saveMessages([message], {isEdited: true});
this.saveMessages([message]/* , {isEdited: true} */);
safeReplaceObject(this.messagesStorage[mid], message);
const dialog = this.getDialogByPeerID(peerID)[0];

4
src/scss/partials/_chatBubble.scss

@ -813,8 +813,8 @@ $bubble-margin: .25rem; @@ -813,8 +813,8 @@ $bubble-margin: .25rem;
font-size: 16px;
//padding: 0 .6rem .2675rem .6rem;
padding: 0 .6rem 6px .6rem;
overflow: hidden;
text-overflow: ellipsis;
/* overflow: hidden;
text-overflow: ellipsis; */
max-width: 100%;
color: #000;
line-height: 21px;

Loading…
Cancel
Save