Fix popup forward load count

New bubble time layout
This commit is contained in:
morethanwords 2020-10-28 18:11:57 +02:00
parent 2db5fadcf9
commit c1a419909b
17 changed files with 160 additions and 193 deletions

View File

@ -301,7 +301,8 @@ export default class AppSelectPeers {
if(promises.length) { if(promises.length) {
promise.then(this.checkForTriggers); promise.then(this.checkForTriggers);
} }
return promise
return promise;
} }
private renderResults(peerIDs: number[]) { private renderResults(peerIDs: number[]) {

View File

@ -218,12 +218,12 @@ export class ChatInput {
if(!value.trim() && !this.serializeNodes(Array.from(this.messageInput.childNodes)).trim()) { if(!value.trim() && !this.serializeNodes(Array.from(this.messageInput.childNodes)).trim()) {
this.messageInput.innerHTML = ''; this.messageInput.innerHTML = '';
appMessagesManager.setTyping('sendMessageCancelAction'); appMessagesManager.setTyping($rootScope.selectedPeerID, 'sendMessageCancelAction');
} else { } else {
const time = Date.now(); const time = Date.now();
if(time - this.lastTimeType >= 6000) { if(time - this.lastTimeType >= 6000) {
this.lastTimeType = time; this.lastTimeType = time;
appMessagesManager.setTyping('sendMessageTypingAction'); appMessagesManager.setTyping($rootScope.selectedPeerID, 'sendMessageTypingAction');
} }
} }

View File

@ -8,7 +8,7 @@ export namespace MessageRender {
}; */ }; */
export const setTime = (message: Message, bubble: HTMLElement, bubbleContainer: HTMLElement, messageDiv: HTMLElement) => { export const setTime = (message: Message, bubble: HTMLElement, bubbleContainer: HTMLElement, messageDiv: HTMLElement) => {
let date = new Date(message.date * 1000); const date = new Date(message.date * 1000);
let time = ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2); let time = ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2);
if(message.views) { if(message.views) {
@ -16,7 +16,7 @@ export namespace MessageRender {
time = formatNumber(message.views, 1) + ' <i class="tgico-channelviews"></i> ' + time; time = formatNumber(message.views, 1) + ' <i class="tgico-channelviews"></i> ' + time;
if(!message.savedFrom) { if(!message.savedFrom) {
let forward = document.createElement('div'); const forward = document.createElement('div');
forward.classList.add('bubble-beside-button', 'forward'); forward.classList.add('bubble-beside-button', 'forward');
forward.innerHTML = ` forward.innerHTML = `
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
@ -35,14 +35,10 @@ export namespace MessageRender {
time = '<i class="edited">edited</i> ' + time; time = '<i class="edited">edited</i> ' + time;
} }
let timeSpan = document.createElement('span'); const timeSpan = document.createElement('span');
timeSpan.classList.add('time'); timeSpan.classList.add('time', 'tgico');
timeSpan.innerHTML = `${time}<div class="inner tgico">${time}</div>`;
let timeInner = document.createElement('div');
timeInner.classList.add('inner', 'tgico');
timeInner.innerHTML = time;
timeSpan.appendChild(timeInner);
messageDiv.append(timeSpan); messageDiv.append(timeSpan);
return timeSpan; return timeSpan;

View File

@ -24,6 +24,7 @@ export default class PopupForward extends PopupElement {
appImManager.chatInputC.initMessagesForward(mids.slice()); appImManager.chatInputC.initMessagesForward(mids.slice());
}, ['dialogs', 'contacts'], () => { }, ['dialogs', 'contacts'], () => {
this.show(); this.show();
this.selector.checkForTriggers(); // ! due to zero height before mounting
if(!isTouchSupported) { if(!isTouchSupported) {
this.selector.input.focus(); this.selector.input.focus();

View File

@ -320,13 +320,13 @@ export class AppChatsManager {
return this.cachedPhotoLocations[id]; return this.cachedPhotoLocations[id];
} }
public getChatString(id: number) { /* public getChatString(id: number) {
const chat = this.getChat(id); const chat = this.getChat(id);
if(this.isChannel(id)) { if(this.isChannel(id)) {
return (this.isMegagroup(id) ? 's' : 'c') + id + '_' + chat.access_hash; return (this.isMegagroup(id) ? 's' : 'c') + id + '_' + chat.access_hash;
} }
return 'g' + id; return 'g' + id;
} } */
public getChatMembersString(id: number) { public getChatMembersString(id: number) {
const chat = this.getChat(id); const chat = this.getChat(id);
@ -353,7 +353,7 @@ export class AppChatsManager {
chatFull.rAbout = RichTextProcessor.wrapRichText(chatFull.about, {noLinebreaks: true}); chatFull.rAbout = RichTextProcessor.wrapRichText(chatFull.about, {noLinebreaks: true});
} }
chatFull.peerString = this.getChatString(id); //chatFull.peerString = this.getChatString(id);
chatFull.chat = chat; chatFull.chat = chat;
return chatFull; return chatFull;
@ -487,15 +487,17 @@ export class AppChatsManager {
} }
} }
onChatUpdated = (chatID: number, updates: any) => { private onChatUpdated = (chatID: number, updates: any) => {
console.log('onChatUpdated', chatID, updates);
apiUpdatesManager.processUpdateMessage(updates); apiUpdatesManager.processUpdateMessage(updates);
if(updates && if(updates &&
updates.updates && /* updates.updates &&
updates.updates.length && updates.updates.length && */
this.isChannel(chatID)) { this.isChannel(chatID)) {
appProfileManager.invalidateChannelParticipants(chatID); appProfileManager.invalidateChannelParticipants(chatID);
} }
} };
public leaveChannel(id: number) { public leaveChannel(id: number) {
return apiManager.invokeApi('channels.leaveChannel', { return apiManager.invokeApi('channels.leaveChannel', {

View File

@ -1326,6 +1326,7 @@ export class AppImManager {
this.chatInput.style.display = ''; this.chatInput.style.display = '';
this.chatInput.classList.toggle('is-hidden', !canWrite); this.chatInput.classList.toggle('is-hidden', !canWrite);
this.bubblesContainer.classList.toggle('is-chat-input-hidden', !canWrite); this.bubblesContainer.classList.toggle('is-chat-input-hidden', !canWrite);
this.chatInputC.messageInput.toggleAttribute('contenteditable', canWrite);
// const noTransition = [this.columnEl/* appSidebarRight.sidebarEl, this.backgroundEl, // const noTransition = [this.columnEl/* appSidebarRight.sidebarEl, this.backgroundEl,
// this.bubblesContainer, this.chatInput, this.chatInner, // this.bubblesContainer, this.chatInput, this.chatInner,
@ -2140,23 +2141,13 @@ export class AppImManager {
}); });
} }
break;
} else if(doc.mime_type == 'audio/ogg') {
let docDiv = wrapDocument(doc, false, false, message.mid);
bubble.classList.remove('is-message-empty');
bubble.classList.add('bubble-audio');
messageDiv.append(docDiv);
processingWebPage = true;
break; break;
} else { } else {
let docDiv = wrapDocument(doc, false, false, message.mid); const docDiv = wrapDocument(doc, false, false, message.mid);
bubble.classList.remove('is-message-empty'); bubble.classList.remove('is-message-empty');
messageDiv.append(docDiv); messageDiv.append(docDiv);
messageDiv.classList.add((doc.type || 'document') + '-message'); messageDiv.classList.add((doc.type != 'photo' ? doc.type || 'document' : 'document') + '-message');
processingWebPage = true; processingWebPage = true;
break; break;
@ -2168,14 +2159,14 @@ export class AppImManager {
case 'messageMediaContact': { case 'messageMediaContact': {
//this.log('wrapping contact', message); //this.log('wrapping contact', message);
let contactDiv = document.createElement('div'); const contactDiv = document.createElement('div');
contactDiv.classList.add('contact'); contactDiv.classList.add('contact');
contactDiv.dataset.peerID = '' + messageMedia.user_id; contactDiv.dataset.peerID = '' + messageMedia.user_id;
messageDiv.classList.add('contact-message'); messageDiv.classList.add('contact-message');
processingWebPage = true; processingWebPage = true;
let texts = []; const texts = [];
if(message.media.first_name) texts.push(RichTextProcessor.wrapEmojiText(message.media.first_name)); if(message.media.first_name) texts.push(RichTextProcessor.wrapEmojiText(message.media.first_name));
if(message.media.last_name) texts.push(RichTextProcessor.wrapEmojiText(message.media.last_name)); if(message.media.last_name) texts.push(RichTextProcessor.wrapEmojiText(message.media.last_name));
@ -2185,13 +2176,14 @@ export class AppImManager {
<div class="contact-number">${message.media.phone_number ? '+' + formatPhoneNumber(message.media.phone_number).formatted : 'Unknown phone number'}</div> <div class="contact-number">${message.media.phone_number ? '+' + formatPhoneNumber(message.media.phone_number).formatted : 'Unknown phone number'}</div>
</div>`; </div>`;
let avatarElem = new AvatarElement(); const avatarElem = new AvatarElement();
avatarElem.setAttribute('peer', '' + message.media.user_id); avatarElem.setAttribute('peer', '' + message.media.user_id);
avatarElem.classList.add('contact-avatar'); avatarElem.classList.add('contact-avatar');
contactDiv.prepend(avatarElem); contactDiv.prepend(avatarElem);
bubble.classList.remove('is-message-empty'); bubble.classList.remove('is-message-empty');
messageDiv.classList.add('contact-message');
messageDiv.append(contactDiv); messageDiv.append(contactDiv);
break; break;
@ -2200,8 +2192,9 @@ export class AppImManager {
case 'messageMediaPoll': { case 'messageMediaPoll': {
bubble.classList.remove('is-message-empty'); bubble.classList.remove('is-message-empty');
let pollElement = wrapPoll(message.media.poll.id, message.mid); const pollElement = wrapPoll(message.media.poll.id, message.mid);
messageDiv.prepend(pollElement); messageDiv.prepend(pollElement);
messageDiv.classList.add('poll-message');
break; break;
} }

View File

@ -1,9 +1,9 @@
import ProgressivePreloader from "../../components/preloader"; import ProgressivePreloader from "../../components/preloader";
import { CancellablePromise, deferredPromise } from "../../helpers/cancellablePromise"; import { CancellablePromise, deferredPromise } from "../../helpers/cancellablePromise";
import { Dialog as MTDialog, DialogFilter, DialogPeer, DocumentAttribute, InputMessage, Message, MessagesDialogs, MessagesFilter, MessagesMessages, MessagesPeerDialogs, MethodDeclMap, PhotoSize, Update } from "../../layer"; import { Dialog as MTDialog, DialogFilter, DialogPeer, DocumentAttribute, InputMessage, Message, MessagesDialogs, MessagesFilter, MessagesMessages, MessagesPeerDialogs, MethodDeclMap, PhotoSize, SendMessageAction, Update } from "../../layer";
import { InvokeApiOptions, Modify } from "../../types"; import { InvokeApiOptions, Modify } from "../../types";
import { bigint, nextRandomInt } from "../bin_utils"; import { bigint, nextRandomInt } from "../bin_utils";
import { logger } from "../logger"; import { logger, LogLevels } from "../logger";
import type { ApiFileManager } from '../mtproto/apiFileManager'; import type { ApiFileManager } from '../mtproto/apiFileManager';
//import apiManager from '../mtproto/apiManager'; //import apiManager from '../mtproto/apiManager';
import apiManager from '../mtproto/mtprotoworker'; import apiManager from '../mtproto/mtprotoworker';
@ -507,7 +507,7 @@ export class AppMessagesManager {
folderID: 0 folderID: 0
}; };
private log = logger('MESSAGES'/* , LogLevels.error */); private log = logger('MESSAGES'/* , LogLevels.error | LogLevels.debug | LogLevels.log | LogLevels.warn */);
public dialogsStorage = new DialogsStorage(); public dialogsStorage = new DialogsStorage();
public filtersStorage = new FiltersStorage(); public filtersStorage = new FiltersStorage();
@ -1168,7 +1168,7 @@ export class AppMessagesManager {
uploadPromise: ReturnType<ApiFileManager['uploadFile']> = null; uploadPromise: ReturnType<ApiFileManager['uploadFile']> = null;
const invoke = (flags: number, inputMedia: any) => { const invoke = (flags: number, inputMedia: any) => {
this.setTyping('sendMessageCancelAction'); this.setTyping(peerID, 'sendMessageCancelAction');
return apiManager.invokeApi('messages.sendMedia', { return apiManager.invokeApi('messages.sendMedia', {
flags: flags, flags: flags,
@ -1261,7 +1261,7 @@ export class AppMessagesManager {
uploadPromise.addNotifyListener((progress: {done: number, total: number}) => { uploadPromise.addNotifyListener((progress: {done: number, total: number}) => {
this.log('upload progress', progress); this.log('upload progress', progress);
const percents = Math.max(1, Math.floor(100 * progress.done / progress.total)); const percents = Math.max(1, Math.floor(100 * progress.done / progress.total));
this.setTyping({_: actionName, progress: percents | 0}); this.setTyping(peerID, {_: actionName, progress: percents | 0});
}); });
uploadPromise.catch(err => { uploadPromise.catch(err => {
@ -1270,7 +1270,7 @@ export class AppMessagesManager {
deferred.resolve(); deferred.resolve();
this.cancelPendingMessage(randomIDS); this.cancelPendingMessage(randomIDS);
this.setTyping('sendMessageCancelAction'); this.setTyping(peerID, 'sendMessageCancelAction');
} }
}); });
@ -1457,7 +1457,7 @@ export class AppMessagesManager {
let inputPeer = appPeersManager.getInputPeerByID(peerID); let inputPeer = appPeersManager.getInputPeerByID(peerID);
let invoke = (multiMedia: any[]) => { let invoke = (multiMedia: any[]) => {
this.setTyping('sendMessageCancelAction'); this.setTyping(peerID, 'sendMessageCancelAction');
return apiManager.invokeApi('messages.sendMultiMedia', { return apiManager.invokeApi('messages.sendMultiMedia', {
flags: flags, flags: flags,
@ -1500,7 +1500,7 @@ export class AppMessagesManager {
uploadPromise.addNotifyListener((progress: {done: number, total: number}) => { uploadPromise.addNotifyListener((progress: {done: number, total: number}) => {
this.log('upload progress', progress); this.log('upload progress', progress);
const percents = Math.max(1, Math.floor(100 * progress.done / progress.total)); const percents = Math.max(1, Math.floor(100 * progress.done / progress.total));
this.setTyping({_: actionName, progress: percents | 0}); this.setTyping(peerID, {_: actionName, progress: percents | 0});
}); });
uploadPromise.catch(err => { uploadPromise.catch(err => {
@ -3960,7 +3960,7 @@ export class AppMessagesManager {
const foundDialog = this.getDialogByPeerID(peerID); const foundDialog = this.getDialogByPeerID(peerID);
const hasDialog = foundDialog.length > 0; const hasDialog = foundDialog.length > 0;
const canViewHistory = channel._ == 'channel' && (channel.username || !channel.pFlags.left && !channel.pFlags.kicked) && true || false; const canViewHistory = channel._ == 'channel' && (channel.username || !channel.pFlags.left && !channel.pFlags.kicked);
const hasHistory = this.historiesStorage[peerID] !== undefined; const hasHistory = this.historiesStorage[peerID] !== undefined;
if(canViewHistory != hasHistory) { if(canViewHistory != hasHistory) {
@ -3974,7 +3974,6 @@ export class AppMessagesManager {
} else { } else {
if(foundDialog[0]) { if(foundDialog[0]) {
this.dialogsStorage.dropDialog(peerID); this.dialogsStorage.dropDialog(peerID);
//this.dialogsStorage[foundDialog[0].folder_id].splice(foundDialog[1], 1);
$rootScope.$broadcast('dialog_drop', {peerID: peerID, dialog: foundDialog[0]}); $rootScope.$broadcast('dialog_drop', {peerID: peerID, dialog: foundDialog[0]});
} }
} }
@ -4486,17 +4485,13 @@ export class AppMessagesManager {
} }
} }
public setTyping(action: any): Promise<boolean> { public setTyping(peerID: number, _action: any): Promise<boolean> {
if(!$rootScope.myID) return Promise.resolve(false); if(!$rootScope.myID) return Promise.resolve(false);
if(typeof(action) == 'string') { const action: SendMessageAction = typeof(_action) == 'string' ? {_: _action} : _action;
action = {_: action};
}
let input = appPeersManager.getInputPeerByID($rootScope.myID);
return apiManager.invokeApi('messages.setTyping', { return apiManager.invokeApi('messages.setTyping', {
peer: input, peer: appPeersManager.getInputPeerByID(peerID),
action: action action
}) as Promise<boolean>; }) as Promise<boolean>;
} }
} }

View File

@ -87,12 +87,12 @@ export class AppPeersManager {
return {_: 'peerChat', chat_id: chatID}; return {_: 'peerChat', chat_id: chatID};
} }
public getPeerString(peerID: number) { /* public getPeerString(peerID: number) {
if(peerID > 0) { if(peerID > 0) {
return appUsersManager.getUserString(peerID); return appUsersManager.getUserString(peerID);
} }
return appChatsManager.getChatString(-peerID); return appChatsManager.getChatString(-peerID);
} } */
public getPeerUsername(peerID: number): string { public getPeerUsername(peerID: number): string {
if(peerID > 0) { if(peerID > 0) {

View File

@ -417,10 +417,10 @@ export class AppUsersManager {
return this.cachedPhotoLocations[id]; return this.cachedPhotoLocations[id];
} }
public getUserString(id: number) { /* public getUserString(id: number) {
const user = this.getUser(id); const user = this.getUser(id);
return 'u' + id + (user.access_hash ? '_' + user.access_hash : ''); return 'u' + id + (user.access_hash ? '_' + user.access_hash : '');
} } */
public getUserInput(id: number): InputUser { public getUserInput(id: number): InputUser {
const user = this.getUser(id); const user = this.getUser(id);

View File

@ -16,6 +16,16 @@ import { CancellablePromise, deferredPromise } from '../../helpers/cancellablePr
import $rootScope from '../rootScope'; import $rootScope from '../rootScope';
/// #endif /// #endif
/* var networker = apiManager.cachedNetworkers.websocket.upload[2];
networker.wrapMtpMessage({
_: 'msgs_state_req',
msg_ids: ["6888292542796810828"]
}, {
notContentRelated: true
}).then(res => {
console.log('status', res);
}); */
//console.error('apiManager included!'); //console.error('apiManager included!');
// TODO: если запрос словил флуд, нужно сохранять его параметры и возвращать тот же промис на новый такой же запрос, например - загрузка истории // TODO: если запрос словил флуд, нужно сохранять его параметры и возвращать тот же промис на новый такой же запрос, например - загрузка истории
@ -127,7 +137,17 @@ export class ApiManager {
} }
const connectionType: ConnectionType = options.fileDownload ? 'download' : (options.fileUpload ? 'upload' : 'client'); const connectionType: ConnectionType = options.fileDownload ? 'download' : (options.fileUpload ? 'upload' : 'client');
//const connectionType: ConnectionType = 'client';
/// #if MTPROTO_HTTP_UPLOAD
// @ts-ignore
const transportType: TransportType = connectionType == 'upload' ? 'https' : 'websocket'; const transportType: TransportType = connectionType == 'upload' ? 'https' : 'websocket';
//const transportType: TransportType = connectionType != 'client' ? 'https' : 'websocket';
/// #else
// @ts-ignore
const transportType = 'websocket';
/// #endif
const transport = dcConfigurator.chooseServer(dcID, connectionType, transportType); const transport = dcConfigurator.chooseServer(dcID, connectionType, transportType);
if(!this.cachedNetworkers.hasOwnProperty(transportType)) { if(!this.cachedNetworkers.hasOwnProperty(transportType)) {

View File

@ -48,7 +48,7 @@ export class DcConfigurator {
const path = Modes.test ? 'apiws_test' : 'apiws'; const path = Modes.test ? 'apiws_test' : 'apiws';
const chosenServer = 'wss://' + subdomain + '.web.telegram.org/' + path; const chosenServer = 'wss://' + subdomain + '.web.telegram.org/' + path;
const suffix = connectionType == 'upload' ? '-U' : connectionType == 'download' ? '-D' : ''; const suffix = connectionType == 'upload' ? '-U' : connectionType == 'download' ? '-D' : '';
return new Socket(dcID, chosenServer, connectionType != 'client' ? '-U' : ''); return new Socket(dcID, chosenServer, suffix);
}; };
private transportHTTP = (dcID: number, connectionType: ConnectionType) => { private transportHTTP = (dcID: number, connectionType: ConnectionType) => {

View File

@ -116,13 +116,13 @@ export default class MTPNetworker {
const suffix = this.options.fileUpload ? '-U' : this.options.fileDownload ? '-D' : ''; const suffix = this.options.fileUpload ? '-U' : this.options.fileDownload ? '-D' : '';
this.upload = this.options.fileUpload || this.options.fileDownload; this.upload = this.options.fileUpload || this.options.fileDownload;
//this.log = logger('NET-' + dcID + suffix, this.upload && this.dcID == 1 ? LogLevels.debug | LogLevels.warn | LogLevels.log | LogLevels.error : LogLevels.error); //this.log = logger('NET-' + dcID + suffix, this.upload && this.dcID == 2 ? LogLevels.debug | LogLevels.warn | LogLevels.log | LogLevels.error : LogLevels.error);
this.log = logger('NET-' + dcID + suffix, LogLevels.log | LogLevels.error); this.log = logger('NET-' + dcID + suffix, LogLevels.log | LogLevels.error);
this.log('constructor'/* , this.authKey, this.authKeyID, this.serverSalt */); this.log('constructor'/* , this.authKey, this.authKeyID, this.serverSalt */);
// Test resend after bad_server_salt // Test resend after bad_server_salt
/* if(this.dcID == 1 && this.upload) { /* if(this.dcID == 2 && this.upload) {
timeManager.applyServerTime((Date.now() / 1000 - 86400) | 0); //timeManager.applyServerTime((Date.now() / 1000 - 86400) | 0);
this.serverSalt[0] = 0; this.serverSalt[0] = 0;
} */ } */
@ -1284,7 +1284,10 @@ export default class MTPNetworker {
} }
delete this.sentMessages[sentMessageID]; delete this.sentMessages[sentMessageID];
} else {
this.log('Rpc result for unknown message:', sentMessageID);
} }
break; break;
} }

View File

@ -35,23 +35,30 @@ export default class Obfuscation {
} }
////////////////////////initPayload.subarray(60, 62).hex = dcID; ////////////////////////initPayload.subarray(60, 62).hex = dcID;
/* initPayload.set(new Uint8Array([161, 208, 67, 71, 118, 109, 20, 111, 113, 255, 134, 10, 159, 241, 7, 44, 217, 82, 187, 76, 108, 131, 200, 186, 33, 57, 177, 251, 52, 34, 18, 54, 65, 105, 37, 89, 38, 20, 47, 168, 126, 181, 24, 138, 212, 68, 60, 150, 225, 37, 181, 4, 201, 50, 72, 151, 168, 143, 204, 169, 81, 187, 241, 23]));
console.log('initPayload', initPayload); */
const reversedPayload = initPayload.slice().reverse(); const reversedPayload = initPayload.slice().reverse();
let encKey = initPayload.slice(8, 40); const encKey = initPayload.slice(8, 40);
let encIv = initPayload.slice(40, 56); const encIv = initPayload.slice(40, 56);
let decKey = reversedPayload.slice(8, 40); const decKey = reversedPayload.slice(8, 40);
let decIv = reversedPayload.slice(40, 56); const decIv = reversedPayload.slice(40, 56);
/* this.enc = new aesjs.ModeOfOperation.ctr(encKey, new aesjs.Counter(encIv as any)); /* this.enc = new aesjs.ModeOfOperation.ctr(encKey, new aesjs.Counter(encIv as any));
this.dec = new aesjs.ModeOfOperation.ctr(decKey, new aesjs.Counter(decIv as any)); */ this.dec = new aesjs.ModeOfOperation.ctr(decKey, new aesjs.Counter(decIv as any)); */
/* console.log('encKey', encKey, encIv);
console.log('decKey', decKey, decIv); */
this.encNew = new CTR(encKey, encIv); this.encNew = new CTR(encKey, encIv);
this.decNew = new CTR(decKey, decIv); this.decNew = new CTR(decKey, decIv);
initPayload.set(codec.obfuscateTag, 56); initPayload.set(codec.obfuscateTag, 56);
const encrypted = this.encode(initPayload); const encrypted = this.encode(initPayload);
//console.log('encrypted', encrypted);
initPayload.set(encrypted.slice(56, 64), 56); initPayload.set(encrypted.slice(56, 64), 56);
return initPayload; return initPayload;

View File

@ -2,7 +2,7 @@
position: relative; position: relative;
padding-left: 67px; padding-left: 67px;
min-height: 58px; min-height: 58px;
max-width: 244px; max-width: 258px;
overflow: visible!important; overflow: visible!important;
@include respond-to(handhelds) { @include respond-to(handhelds) {
@ -10,6 +10,7 @@
} }
&-toggle, &-download { &-toggle, &-download {
overflow: hidden;
border-radius: 50%; border-radius: 50%;
background-color: $color-blue; background-color: $color-blue;
font-size: 0; font-size: 0;

View File

@ -337,13 +337,6 @@ $bubble-margin: .25rem;
} }
} }
&.webpage {
.time {
float: none;
width: 0;
}
}
.preview-resizer { .preview-resizer {
display: flex; display: flex;
} }
@ -886,12 +879,6 @@ $bubble-margin: .25rem;
} */ } */
} }
.bubble__container .message.audio-message {
.time {
width: unset !important;
}
}
.message.contact-message { .message.contact-message {
min-width: 200px; min-width: 200px;
padding-left: 8px; padding-left: 8px;
@ -920,19 +907,11 @@ $bubble-margin: .25rem;
line-height: 1.4; line-height: 1.4;
} }
} }
.time {
width: unset;
}
} }
.message.document-message { .message.document-message {
max-width: 325px !important; max-width: 325px !important;
.time {
width: unset;
}
.document { .document {
padding-left: 66px; padding-left: 66px;
height: 58px; height: 58px;
@ -950,6 +929,21 @@ $bubble-margin: .25rem;
} }
} }
.message {
&.document-message, &.audio-message, &.voice-message, &.poll-message, &.contact-message {
.time {
position: absolute;
right: 0;
bottom: 0;
}
}
}
.message.voice-message {
// ! SAFARI FIX BLINK ON SELECTION TRANSFORM !
overflow: visible !important;
}
&.is-message-empty { &.is-message-empty {
.message { .message {
position: absolute; position: absolute;
@ -961,38 +955,28 @@ $bubble-margin: .25rem;
z-index: 2; z-index: 2;
.time { .time {
margin-left: 0;
color: #fff; color: #fff;
padding: 0;
display: flex; display: flex;
align-items: center; align-items: center;
width: auto !important; padding: 0 2.5px;
line-height: 20px;
.inner { .inner {
margin-bottom: 0; display: none;
position: relative;
padding: 0 2.5px;
bottom: 0;
} }
} }
} }
} }
.time { .time {
font-size: .8rem; color: transparent;
user-select: none;
float: right;
user-select: none;
height: 20px;
line-height: 20px;
.inner {
position: absolute;
bottom: 0;
right: 0;
font-size: 12px; font-size: 12px;
display: flex; user-select: none;
align-items: center;
line-height: 1; line-height: 1;
vertical-align: middle;
/* display: inline-flex;
align-items: center; */
i { i {
font-size: 1.15rem; font-size: 1.15rem;
@ -1004,6 +988,15 @@ $bubble-margin: .25rem;
overflow: visible; overflow: visible;
font-size: .8rem; font-size: .8rem;
} }
.inner {
position: absolute;
bottom: 0;
right: 0;
display: flex;
align-items: center;
line-height: 1;
padding: inherit;
} }
} }
@ -1036,27 +1029,6 @@ $bubble-margin: .25rem;
} }
} }
&.is-edited.channel-post .time {
min-width: calc(5rem + 46px);
}
&.channel-post .time {
width: 5rem;
}
&.is-edited {
.time {
width: 78px !important;
}
&.emoji-big, &.sticker {
.time {
/* width: 81px !important; */
min-width: unset;
}
}
}
&:not(.forwarded).hide-name, &.emoji-big { &:not(.forwarded).hide-name, &.emoji-big {
.name { .name {
display: none; display: none;
@ -1179,22 +1151,6 @@ $bubble-margin: .25rem;
} }
} }
.bubble-audio {
.message {
// ! SAFARI FIX BLINK ON SELECTION TRANSFORM !
overflow: visible !important;
}
.time {
width: unset !important;
padding-left: 14px !important;
@include respond-to(handhelds) {
padding-left: 0px !important;
}
}
}
.bubble.is-in { .bubble.is-in {
.bubble__container { .bubble__container {
margin-right: auto; margin-right: auto;
@ -1274,12 +1230,11 @@ $bubble-margin: .25rem;
} }
.time { .time {
color: #a3adb6; margin-left: -1px;
/* width: 36px; */ padding-right: 8px;
padding-left: 36px;
.inner { .inner {
padding: 0 7px 0 5px; color: #a3adb6;
margin-bottom: 4px; margin-bottom: 4px;
} }
} }
@ -1421,22 +1376,26 @@ $bubble-margin: .25rem;
} }
.time { .time {
color: $darkgreen; padding-right: 4px;
width: 50px; margin-left: -4px;
display: inline-block;
.inner { .inner {
padding: 0 4px 0 4px; color: $darkgreen;
bottom: 1px; bottom: 2px;
} }
.tgico:after { &:after, .inner:after {
font-size: 19px; font-size: 19px;
vertical-align: middle; //vertical-align: middle;
margin-left: 1px; margin-left: 1px;
line-height: 16px; // of message
} }
} }
/* &.is-message-empty .time:after {
margin-bottom: 1px;
} */
&.forwarded { &.forwarded {
.name { .name {
color: $darkgreen; color: $darkgreen;
@ -1444,19 +1403,19 @@ $bubble-margin: .25rem;
} }
&.is-read { &.is-read {
.time .tgico:after { .time:after, .time .inner:after {
content: $tgico-checks; content: $tgico-checks;
} }
} }
&.is-sent { &.is-sent {
.time .tgico:after { .time:after, .time .inner:after {
content: $tgico-check; content: $tgico-check;
} }
} }
&.is-sending { &.is-sending {
.time .tgico:after { .time:after, .time .inner:after {
content: $tgico-sending; content: $tgico-sending;
} }
} }
@ -1465,11 +1424,6 @@ $bubble-margin: .25rem;
display: none; display: none;
} }
&.is-edited .time {
/* width: 85px; */
width: 90px !important;
}
.document-ico:after { .document-ico:after {
border-top-color: #eeffde; border-top-color: #eeffde;
border-right-color: #eeffde; border-right-color: #eeffde;
@ -1819,7 +1773,7 @@ poll-element {
&-footer { &-footer {
text-align: center; text-align: center;
margin-top: 7px; margin-top: 7px;
height: 21px; height: 27px;
} }
&-footer-button { &-footer-button {
@ -1899,12 +1853,6 @@ poll-element {
cursor: pointer; cursor: pointer;
} }
& + .time {
height: unset !important;
padding-top: 0px !important;
padding-bottom: 7px !important;
}
.circle-hover { .circle-hover {
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@ -24,6 +24,17 @@
object-fit: contain; object-fit: contain;
} }
} }
.time {
float: right;
padding: 7px 0px 9px 14px;
font-size: 15px;
color: white;
@include respond-to(handhelds) {
padding: 7px 0px 9px 0px;
}
}
} }
&__overlay { &__overlay {
@ -385,17 +396,6 @@ input[type=range] {
align-items: center; align-items: center;
} }
.time {
float: right;
padding: 7px 0px 9px 14px;
font-size: 15px;
color: white;
@include respond-to(handhelds) {
padding: 7px 0px 9px 0px;
}
}
.circle .circle-time { .circle .circle-time {
color: #fff; color: #fff;
font-size: 13px; font-size: 13px;

View File

@ -624,18 +624,18 @@
.selector { .selector {
ul { ul {
li > .rp { li > .rp {
margin: 0 8px !important; margin: 0 .5rem;
padding: 7px 12px !important; padding: .5rem .75rem;
height: 62px; height: 3.875rem;
@include respond-to(handhelds) { @include respond-to(handhelds) {
margin: 0 !important; margin: 0;
} }
} }
.dialog-avatar { .dialog-avatar {
width: 46px; width: 2.875rem;
height: 46px; height: 2.875rem;
} }
.user-caption { .user-caption {