|
|
@ -200,6 +200,10 @@ export class AppImManager { |
|
|
|
this.applyCurrentTheme(); |
|
|
|
this.applyCurrentTheme(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rootScope.addEventListener('choosing_sticker', (choosing) => { |
|
|
|
|
|
|
|
this.setChoosingStickerTyping(!choosing); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
rootScope.addEventListener('instance_deactivated', () => { |
|
|
|
rootScope.addEventListener('instance_deactivated', () => { |
|
|
|
const popup = new PopupElement('popup-instance-deactivated', undefined, {overlayClosable: true}); |
|
|
|
const popup = new PopupElement('popup-instance-deactivated', undefined, {overlayClosable: true}); |
|
|
|
const c = document.createElement('div'); |
|
|
|
const c = document.createElement('div'); |
|
|
@ -1312,13 +1316,13 @@ export class AppImManager { |
|
|
|
|
|
|
|
|
|
|
|
private getTypingElement(action: SendMessageAction) { |
|
|
|
private getTypingElement(action: SendMessageAction) { |
|
|
|
const el = document.createElement('span'); |
|
|
|
const el = document.createElement('span'); |
|
|
|
el.classList.add('peer-typing'); |
|
|
|
let c = 'peer-typing'; |
|
|
|
|
|
|
|
el.classList.add(c); |
|
|
|
el.dataset.action = action._; |
|
|
|
el.dataset.action = action._; |
|
|
|
switch(action._) { |
|
|
|
switch(action._) { |
|
|
|
case 'sendMessageTypingAction': { |
|
|
|
case 'sendMessageTypingAction': { |
|
|
|
//default: {
|
|
|
|
//default: {
|
|
|
|
const c = 'peer-typing-text'; |
|
|
|
c += '-text'; |
|
|
|
el.classList.add(c); |
|
|
|
|
|
|
|
for(let i = 0; i < 3; ++i) { |
|
|
|
for(let i = 0; i < 3; ++i) { |
|
|
|
const dot = document.createElement('span'); |
|
|
|
const dot = document.createElement('span'); |
|
|
|
dot.className = c + '-dot'; |
|
|
|
dot.className = c + '-dot'; |
|
|
@ -1332,8 +1336,7 @@ export class AppImManager { |
|
|
|
case 'sendMessageUploadRoundAction': |
|
|
|
case 'sendMessageUploadRoundAction': |
|
|
|
case 'sendMessageUploadVideoAction': |
|
|
|
case 'sendMessageUploadVideoAction': |
|
|
|
case 'sendMessageUploadPhotoAction': { |
|
|
|
case 'sendMessageUploadPhotoAction': { |
|
|
|
const c = 'peer-typing-upload'; |
|
|
|
c += '-upload'; |
|
|
|
el.classList.add(c); |
|
|
|
|
|
|
|
/* const trail = document.createElement('span'); |
|
|
|
/* const trail = document.createElement('span'); |
|
|
|
trail.className = c + '-trail'; |
|
|
|
trail.className = c + '-trail'; |
|
|
|
el.append(trail); */ |
|
|
|
el.append(trail); */ |
|
|
@ -1343,12 +1346,23 @@ export class AppImManager { |
|
|
|
case 'sendMessageRecordAudioAction': |
|
|
|
case 'sendMessageRecordAudioAction': |
|
|
|
case 'sendMessageRecordRoundAction': |
|
|
|
case 'sendMessageRecordRoundAction': |
|
|
|
case 'sendMessageRecordVideoAction': { |
|
|
|
case 'sendMessageRecordVideoAction': { |
|
|
|
const c = 'peer-typing-record'; |
|
|
|
c += '-record'; |
|
|
|
el.classList.add(c); |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'sendMessageChooseStickerAction': { |
|
|
|
|
|
|
|
c += '-choosing-sticker'; |
|
|
|
|
|
|
|
for(let i = 0; i < 2; ++i) { |
|
|
|
|
|
|
|
const eye = document.createElement('div'); |
|
|
|
|
|
|
|
eye.className = c + '-eye'; |
|
|
|
|
|
|
|
el.append(eye); |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
el.classList.add(c); |
|
|
|
|
|
|
|
|
|
|
|
return el; |
|
|
|
return el; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1374,7 +1388,8 @@ export class AppImManager { |
|
|
|
'sendMessageRecordVideoAction': 'Peer.Activity.User.RecordingVideo', |
|
|
|
'sendMessageRecordVideoAction': 'Peer.Activity.User.RecordingVideo', |
|
|
|
'sendMessageRecordAudioAction': 'Peer.Activity.User.RecordingAudio', |
|
|
|
'sendMessageRecordAudioAction': 'Peer.Activity.User.RecordingAudio', |
|
|
|
'sendMessageRecordRoundAction': 'Peer.Activity.User.RecordingVideo', |
|
|
|
'sendMessageRecordRoundAction': 'Peer.Activity.User.RecordingVideo', |
|
|
|
'sendMessageGamePlayAction': 'Peer.Activity.User.PlayingGame' |
|
|
|
'sendMessageGamePlayAction': 'Peer.Activity.User.PlayingGame', |
|
|
|
|
|
|
|
'sendMessageChooseStickerAction': 'Peer.Activity.User.ChoosingSticker' |
|
|
|
}, |
|
|
|
}, |
|
|
|
chat: { |
|
|
|
chat: { |
|
|
|
'sendMessageTypingAction': 'Peer.Activity.Chat.TypingText', |
|
|
|
'sendMessageTypingAction': 'Peer.Activity.Chat.TypingText', |
|
|
@ -1386,7 +1401,8 @@ export class AppImManager { |
|
|
|
'sendMessageRecordVideoAction': 'Peer.Activity.Chat.RecordingVideo', |
|
|
|
'sendMessageRecordVideoAction': 'Peer.Activity.Chat.RecordingVideo', |
|
|
|
'sendMessageRecordAudioAction': 'Peer.Activity.Chat.RecordingAudio', |
|
|
|
'sendMessageRecordAudioAction': 'Peer.Activity.Chat.RecordingAudio', |
|
|
|
'sendMessageRecordRoundAction': 'Peer.Activity.Chat.RecordingVideo', |
|
|
|
'sendMessageRecordRoundAction': 'Peer.Activity.Chat.RecordingVideo', |
|
|
|
'sendMessageGamePlayAction': 'Peer.Activity.Chat.PlayingGame' |
|
|
|
'sendMessageGamePlayAction': 'Peer.Activity.Chat.PlayingGame', |
|
|
|
|
|
|
|
'sendMessageChooseStickerAction': 'Peer.Activity.Chat.ChoosingSticker' |
|
|
|
}, |
|
|
|
}, |
|
|
|
multi: { |
|
|
|
multi: { |
|
|
|
'sendMessageTypingAction': 'Peer.Activity.Chat.Multi.TypingText1', |
|
|
|
'sendMessageTypingAction': 'Peer.Activity.Chat.Multi.TypingText1', |
|
|
@ -1398,7 +1414,8 @@ export class AppImManager { |
|
|
|
'sendMessageRecordVideoAction': 'Peer.Activity.Chat.Multi.RecordingVideo1', |
|
|
|
'sendMessageRecordVideoAction': 'Peer.Activity.Chat.Multi.RecordingVideo1', |
|
|
|
'sendMessageRecordAudioAction': 'Peer.Activity.Chat.Multi.RecordingAudio1', |
|
|
|
'sendMessageRecordAudioAction': 'Peer.Activity.Chat.Multi.RecordingAudio1', |
|
|
|
'sendMessageRecordRoundAction': 'Peer.Activity.Chat.Multi.RecordingVideo1', |
|
|
|
'sendMessageRecordRoundAction': 'Peer.Activity.Chat.Multi.RecordingVideo1', |
|
|
|
'sendMessageGamePlayAction': 'Peer.Activity.Chat.Multi.PlayingGame1' |
|
|
|
'sendMessageGamePlayAction': 'Peer.Activity.Chat.Multi.PlayingGame1', |
|
|
|
|
|
|
|
'sendMessageChooseStickerAction': 'Peer.Activity.Chat.Multi.ChoosingSticker1' |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -1430,6 +1447,10 @@ export class AppImManager { |
|
|
|
container.classList.add('online', 'peer-typing-container'); |
|
|
|
container.classList.add('online', 'peer-typing-container'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(action._ === 'sendMessageChooseStickerAction') { |
|
|
|
|
|
|
|
container.classList.add('peer-typing-flex'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let typingElement = container.firstElementChild as HTMLElement; |
|
|
|
let typingElement = container.firstElementChild as HTMLElement; |
|
|
|
if(!typingElement) { |
|
|
|
if(!typingElement) { |
|
|
|
typingElement = this.getTypingElement(action); |
|
|
|
typingElement = this.getTypingElement(action); |
|
|
@ -1533,6 +1554,10 @@ export class AppImManager { |
|
|
|
replaceContent(element, subtitle || (useWhitespace ? '' : '')); |
|
|
|
replaceContent(element, subtitle || (useWhitespace ? '' : '')); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public setChoosingStickerTyping(cancel: boolean) { |
|
|
|
|
|
|
|
appMessagesManager.setTyping(this.chat.peerId, {_: cancel ? 'sendMessageCancelAction' : 'sendMessageChooseStickerAction'}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const appImManager = new AppImManager(); |
|
|
|
const appImManager = new AppImManager(); |
|
|
|