🔒 SecureChat

Privacy-first peer-to-peer messaging

Don't have an account? Sign Up
👤

👋 Welcome to SecureChat

Search for a user or select a contact to start chatting

All messages are peer-to-peer and never stored on our server

; if (save && currentChatId) { if (!messageHistory[currentChatId]) messageHistory[currentChatId] = []; messageHistory[currentChatId].push({ text, type, time: Date.now() }); saveMessageHistory(); } } function onType() { if (!conn || !conn.open) return; conn.send({ type: 'typing', typing: true }); clearTimeout(typingTimeout); typingTimeout = setTimeout(() => { if (conn && conn.open) conn.send({ type: 'typing', typing: false }); }, 2000); } function sendEmoji(e) { if (!conn || !conn.open) return; conn.send({ type: 'emoji', emoji: e }); showEmoji(e, true); } function showEmoji(e, sent = false) { const m = document.getElementById('messages'); const div = document.createElement('div'); div.style.cssText = `text-align:${sent?'right':'left'};font-size:2em;padding:5px 0;`; div.textContent = e; m.appendChild(div); m.scrollTop = m.scrollHeight