Fix returning from inner chats

Hidden user toast
Fix sending stickers from helper
This commit is contained in:
Eduard Kuzmenko 2021-04-05 20:11:15 +04:00
parent 6dda2a1d62
commit 22b3858864
6 changed files with 24 additions and 11 deletions

@ -51,6 +51,7 @@ import PeerTitle from "../peerTitle";
import { forEachReverse } from "../../helpers/array"; import { forEachReverse } from "../../helpers/array";
import findUpClassName from "../../helpers/dom/findUpClassName"; import findUpClassName from "../../helpers/dom/findUpClassName";
import findUpTag from "../../helpers/dom/findUpTag"; import findUpTag from "../../helpers/dom/findUpTag";
import { toast } from "../toast";
const USE_MEDIA_TAILS = false; const USE_MEDIA_TAILS = false;
const IGNORE_ACTIONS: Message.messageService['action']['_'][] = [/* 'messageActionHistoryClear' */]; const IGNORE_ACTIONS: Message.messageService['action']['_'][] = [/* 'messageActionHistoryClear' */];
@ -828,8 +829,8 @@ export default class ChatBubbles {
//appSidebarRight.forwardTab.open([mid]); //appSidebarRight.forwardTab.open([mid]);
return; return;
} else if(target.classList.contains('peer-title') || target.classList.contains('name')) { } else if(target.classList.contains('peer-title') || target.classList.contains('name')) {
target = findUpClassName(target, 'name');
const peerId = +target.dataset.peerId; const peerId = +target.dataset.peerId;
const savedFrom = target.dataset.savedFrom; const savedFrom = target.dataset.savedFrom;
if(savedFrom) { if(savedFrom) {
const splitted = savedFrom.split('_'); const splitted = savedFrom.split('_');
@ -840,6 +841,8 @@ export default class ChatBubbles {
} else { } else {
if(peerId) { if(peerId) {
this.chat.appImManager.setInnerPeer(peerId); this.chat.appImManager.setInnerPeer(peerId);
} else {
toast(I18n.format('HidAccount', true));
} }
} }
@ -849,6 +852,8 @@ export default class ChatBubbles {
if(peerId) { if(peerId) {
this.chat.appImManager.setInnerPeer(peerId); this.chat.appImManager.setInnerPeer(peerId);
} else {
toast(I18n.format('HidAccount', true));
} }
return; return;
@ -883,6 +888,8 @@ export default class ChatBubbles {
if(peerId) { if(peerId) {
this.chat.appImManager.setInnerPeer(peerId); this.chat.appImManager.setInnerPeer(peerId);
} else {
toast(I18n.format('HidAccount', true));
} }
} }
@ -2394,6 +2401,7 @@ export default class ChatBubbles {
///////this.log('message to render hidden', message); ///////this.log('message to render hidden', message);
title = document.createElement('span'); title = document.createElement('span');
title.innerHTML = RichTextProcessor.wrapEmojiText(message.fwd_from.from_name); title.innerHTML = RichTextProcessor.wrapEmojiText(message.fwd_from.from_name);
title.classList.add('peer-title');
//title = message.fwd_from.from_name; //title = message.fwd_from.from_name;
bubble.classList.add('hidden-profile'); bubble.classList.add('hidden-profile');
} else { } else {

@ -82,10 +82,7 @@ export default class StickersHelper {
private init() { private init() {
this.container = document.createElement('div'); this.container = document.createElement('div');
this.container.classList.add('stickers-helper', 'z-depth-1'); this.container.classList.add('stickers-helper', 'z-depth-1');
this.container.addEventListener('click', (e) => {
this.stickersContainer = document.createElement('div');
this.stickersContainer.classList.add('stickers-helper-stickers', 'super-stickers');
this.stickersContainer.addEventListener('click', (e) => {
if(!findUpClassName(e.target, 'super-sticker')) { if(!findUpClassName(e.target, 'super-sticker')) {
return; return;
} }
@ -93,6 +90,9 @@ export default class StickersHelper {
EmoticonsDropdown.onMediaClick(e, true); EmoticonsDropdown.onMediaClick(e, true);
}); });
this.stickersContainer = document.createElement('div');
this.stickersContainer.classList.add('stickers-helper-stickers', 'super-stickers');
this.container.append(this.stickersContainer); this.container.append(this.stickersContainer);
this.scrollable = new Scrollable(this.container); this.scrollable = new Scrollable(this.container);

@ -379,6 +379,7 @@ const lang = {
"one_value": "%1$d sticker", "one_value": "%1$d sticker",
"other_value": "%1$d stickers" "other_value": "%1$d stickers"
}, },
"HidAccount": "The account was hidden by the user",
// * macos // * macos
"AccountSettings.Filters": "Chat Folders", "AccountSettings.Filters": "Chat Folders",

@ -622,7 +622,8 @@ export class AppImManager {
spliced = this.chats.splice(fromIndex, this.chats.length - fromIndex); spliced = this.chats.splice(fromIndex, this.chats.length - fromIndex);
} }
for(let i = 0; i < spliced.length; ++i) { // * -1 because one item is being sliced when closing the chat by calling .removeByType
for(let i = 0; i < spliced.length - 1; ++i) {
appNavigationController.removeByType('chat', true); appNavigationController.removeByType('chat', true);
} }

@ -481,10 +481,6 @@ $chat-helper-size: 39px;
} }
} }
/* @include respond-to(not-handhelds) {
border-left: 1px solid var(--border-color);
} */
@include respond-to(floating-left-sidebar) { @include respond-to(floating-left-sidebar) {
position: fixed !important; position: fixed !important;
left: 0; left: 0;
@ -492,7 +488,10 @@ $chat-helper-size: 39px;
bottom: 0; bottom: 0;
right: 0; right: 0;
transform: translateZ(0); transform: translateZ(0);
transition: transform var(--layer-transition) !important;
@include animation-level(2) {
transition: transform var(--layer-transition);
}
body.is-left-column-shown & { body.is-left-column-shown & {
transform: translate3d(26.5rem, 0, 0); transform: translate3d(26.5rem, 0, 0);

@ -144,6 +144,10 @@ $bubble-margin: .25rem;
&:before, &:after { &:before, &:after {
display: none; display: none;
} }
.user-avatar {
z-index: 2;
}
} }
&.channel-post { &.channel-post {