diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index 56bf42ae..e4793679 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -1451,7 +1451,8 @@ export default class ChatBubbles { } const peerId = this.peerId; - const our = message.fromId == rootScope.myId; // * can't use 'message.pFlags.out' here because this check will be used to define side of message (left-right) + // * can't use 'message.pFlags.out' here because this check will be used to define side of message (left-right) + const our = message.fromId == rootScope.myId || (message.pFlags.out && this.appPeersManager.isMegagroup(this.peerId)); const messageDiv = document.createElement('div'); messageDiv.classList.add('message'); @@ -2185,11 +2186,15 @@ export default class ChatBubbles { bubble.classList.add('is-reply'); } - if(!bubble.classList.contains('sticker') && (peerId < 0 && peerId != message.fromId)) { + if(!bubble.classList.contains('sticker') && (peerId < 0 && (peerId != message.fromId || our)) && message.fromId !== rootScope.myId) { let nameDiv = document.createElement('div'); nameDiv.classList.add('name'); nameDiv.innerHTML = title; - nameDiv.style.color = this.appPeersManager.getPeerColorById(message.fromId, false); + + if(!our) { + nameDiv.style.color = this.appPeersManager.getPeerColorById(message.fromId, false); + } + nameDiv.dataset.peerId = message.fromId; nameContainer.append(nameDiv); } else /* if(!message.reply_to_mid) */ { diff --git a/src/components/popups/newMedia.ts b/src/components/popups/newMedia.ts index fd5c0e3c..33cf1210 100644 --- a/src/components/popups/newMedia.ts +++ b/src/components/popups/newMedia.ts @@ -267,6 +267,9 @@ export default class PopupNewMedia extends PopupElement { const docDiv = wrapDocument({ message: { _: 'message', + pFlags: { + is_outgoing: true + }, mid: 0, peerId: 0, media: { @@ -280,8 +283,7 @@ export default class PopupNewMedia extends PopupElement { url: params.objectURL } } - } as any, - uploading: true + } as any }); const finish = () => { diff --git a/src/components/wrappers.ts b/src/components/wrappers.ts index ee544e1a..f176ddf0 100644 --- a/src/components/wrappers.ts +++ b/src/components/wrappers.ts @@ -343,14 +343,15 @@ export const formatDate = (timestamp: number, monthShort = false, withYear = tru return str + ' at ' + date.getHours() + ':' + ('0' + date.getMinutes()).slice(-2); }; -export function wrapDocument({message, withTime, uploading, fontWeight}: { +export function wrapDocument({message, withTime, fontWeight}: { message: any, withTime?: boolean, - uploading?: boolean, fontWeight?: number }): HTMLElement { if(!fontWeight) fontWeight = 500; + const uploading = message.pFlags.is_outgoing; + const doc = message.media.document || message.media.webpage.document; if(doc.type == 'audio' || doc.type == 'voice') { const audioElement = new AudioElement(); diff --git a/src/scss/partials/_chatBubble.scss b/src/scss/partials/_chatBubble.scss index 6af7f5fa..4bce313e 100644 --- a/src/scss/partials/_chatBubble.scss +++ b/src/scss/partials/_chatBubble.scss @@ -1432,7 +1432,7 @@ $bubble-margin: .25rem; } &:not(.sticker):not(.emoji-big) { - &.hide-name, &:not(.is-group-first), &.is-out { + &.hide-name, &:not(.is-group-first)/* , &.is-out */ { .reply { margin-top: 6px; } @@ -1759,6 +1759,10 @@ $bubble-margin: .25rem; &, .poll-footer-button { border-radius: 12px 6px 6px 12px; } + + .name { + color: #50af4f; + } } &.is-group-first { @@ -1863,9 +1867,9 @@ $bubble-margin: .25rem; } } - &.is-reply .name { + /* &.is-reply .name { display: none; - } + } */ .document-ico:after { border-top-color: #eeffde;