diff --git a/src/components/friends/views/messenger/FriendsMessengerView.tsx b/src/components/friends/views/messenger/FriendsMessengerView.tsx index 819f315..42123bc 100644 --- a/src/components/friends/views/messenger/FriendsMessengerView.tsx +++ b/src/components/friends/views/messenger/FriendsMessengerView.tsx @@ -103,105 +103,30 @@ export const FriendsMessengerView: FC<{}> = props => } }, [ isVisible, activeThread, lastThreadId, visibleThreads, setActiveThreadId ]); - if(!isVisible) return null; - function showSubMenuConsola(){ - document.getElementById("submenuChatConsola").style.display = "flex"; - document.getElementById("chatmasinfogen").style.display = "none"; - } - - function hideSubMenuConsola(){ - document.getElementById("submenuChatConsola").style.display = "none"; - document.getElementById("chatmasinfogen").style.display = "block"; - } - - var mediaRecorderConsola; - var audioChunksConsola = []; - var microphoneConsoeOn = document.getElementById("microphoneConsoeOn"); - var microphoneConsoeOff = document.getElementById("microphoneConsoeOff"); - var deleteAudioConsola = document.getElementById("deleteAudioConsola"); - - var deletedAudioConsola = false; -function startRecordingConsola(){ - - microphoneConsoeOn.style.display = "none"; - microphoneConsoeOff.style.display = "inline-block"; - deleteAudioConsola.style.display = "inline-block"; - - navigator.mediaDevices.getUserMedia({audio:true}) - .then(stream=> { - mediaRecorderConsola = new MediaRecorder(stream); - mediaRecorderConsola.start(); - - mediaRecorderConsola.addEventListener("dataavailable", event => { - audioChunksConsola.push(event.data); - }); - - mediaRecorderConsola.addEventListener("stop", () => { - microphoneConsoeOn.style.display = "inline-block"; - microphoneConsoeOff.style.display = "none"; - deleteAudioConsola.style.display = "none"; - - if(!deletedAudioConsola){ - const audioBlob = new Blob(audioChunksConsola); - var fd = new FormData(); - fd.append("audio", audioBlob); - fetch("https://int.habbeh.net/audio.php", {method:"POST", body: fd}) - .then((response) => response.text()) - .then((resp) => { - sendMessage(activeThread, GetSessionDataManager().userId, "https://int.habbeh.net/audios/" + resp + ".mp3"); - }); - } - - deletedAudioConsola = false; - audioChunksConsola = []; - }); - }); -} - - - function stopRecordingConsola(){ - microphoneConsoeOn.style.display = "inline-block"; - microphoneConsoeOff.style.display = "none"; - deleteAudioConsola.style.display = "none"; - mediaRecorderConsola.stop(); - } - - function deleteRecordingConsola(){ - microphoneConsoeOn.style.display = "inline-block"; - microphoneConsoeOff.style.display = "none"; - deleteAudioConsola.style.display = "none"; - deletedAudioConsola = true; - mediaRecorderConsola.stop(); - } - return ( - setIsVisible(false) } /> - + setIsVisible(false) } /> + - { LocalizeText('toolbar.icon.label.messenger') } - { visibleThreads && (visibleThreads.length > 0) && visibleThreads.map(thread => - { + { visibleThreads && (visibleThreads.length > 0) && visibleThreads.map(thread => { return ( - setActiveThreadId(thread.threadId) }> - { thread.unread && - } - - - { (thread.participant.id > 0) && - } - { (thread.participant.id <= 0) && - } - - { thread.participant.name } - - + setActiveThreadId(thread.threadId) }> + { thread.unread && } + + + 0 ? thread.participant.figure : thread.participant.id <= 0 && thread.participant.figure === 'ADM' ? 'ha-3409-1413-70.lg-285-89.ch-3032-1334-109.sh-3016-110.hd-185-1359.ca-3225-110-62.wa-3264-62-62.fa-1206-90.hr-3322-1403' : thread.participant.figure + } headOnly={true} direction={thread.participant.id > 0 ? 2 : 3} /> + + { thread.participant.name } + + ); }) } @@ -212,20 +137,18 @@ function startRecordingConsola(){ <> { LocalizeText('messenger.window.separator', [ 'FRIEND_NAME' ], [ activeThread.participant.name ]) } - - - - - - - - + + + + + )} + @@ -235,8 +158,7 @@ function startRecordingConsola(){ - setMessageText(event.target.value) } onKeyDown={ onKeyDown } style={{paddingRight: 35}}/> -
showSubMenuConsola()} className="masiconstoolgen icon chatmas-icon" id="chatmasinfogen" style={{ position: 'relative', width: '40px', height: '27px', marginTop: '4px', marginRight: '0px', marginLeft: '0px', float: 'inherit', right: '0px', }}/> + setMessageText(event.target.value) } onKeyDown={ onKeyDown } /> @@ -247,4 +169,4 @@ function startRecordingConsola(){ ); -} +} \ No newline at end of file diff --git a/src/components/friends/views/messenger/messenger-thread/FriendsMessengerThreadGroup.tsx b/src/components/friends/views/messenger/messenger-thread/FriendsMessengerThreadGroup.tsx index c75db43..62bc04b 100644 --- a/src/components/friends/views/messenger/messenger-thread/FriendsMessengerThreadGroup.tsx +++ b/src/components/friends/views/messenger/messenger-thread/FriendsMessengerThreadGroup.tsx @@ -1,25 +1,9 @@ -import * as joypixels from 'emoji-toolkit'; import { FC, useMemo } from 'react'; import { GetGroupChatData, GetSessionDataManager, LocalizeText, MessengerGroupType, MessengerThread, MessengerThreadChat, MessengerThreadChatGroup } from '../../../../../api'; import { Base, Flex, LayoutAvatarImageView } from '../../../../../common'; export const FriendsMessengerThreadGroup: FC<{ thread: MessengerThread, group: MessengerThreadChatGroup }> = props => { - const encodeHTML = (str: string) => -{ - return str.replace(/([\u00A0-\u9999<>&])(.|$)/g, (full, char, next) => - { - if(char !== '&' || next !== '#') - { - if(/[\u00A0-\u9999<>&]/.test(next)) next = '&#' + next.charCodeAt(0) + ';'; - - return '&#' + char.charCodeAt(0) + ';' + next; - } - - return full; - }); -} - const { thread = null, group = null } = props; const groupChatData = useMemo(() => ((group.type === MessengerGroupType.GROUP_CHAT) && GetGroupChatData(group.chats[0].extraData)), [ group ]); @@ -73,45 +57,11 @@ export const FriendsMessengerThreadGroup: FC<{ thread: MessengerThread, group: M } -
- {group.chats.map((chat, index) => { - - let verifscript = chat.message; - - if (verifscript.toLowerCase().includes("