Skip to content

Feat/drag drop and bug fixes#4

Merged
erancybersec merged 2 commits intomasterfrom
feat/drag-drop-and-bug-fixes
Apr 10, 2026
Merged

Feat/drag drop and bug fixes#4
erancybersec merged 2 commits intomasterfrom
feat/drag-drop-and-bug-fixes

Conversation

@erancybersec
Copy link
Copy Markdown
Owner

No description provided.

erancybersec and others added 2 commits April 6, 2026 18:47
Unread badge persists after hard refresh:
- Track markedReadAt[jid] = lastMsgTimestamp when user reads a chat
- Persist markedReadAt to localStorage so it survives page reloads
- chatFetchConversations zeroes unreadCount for any jid where no newer
  message has arrived since it was marked read (normalised to ms for
  mixed ISO/Unix timestamp safety)
- Badge correctly reappears when a genuinely new message arrives

Group names showing individual person names instead of group subject:
- Root cause: findChats pushName = last sender's name, not group subject
- Fix fallback order: verifiedName → c.subject → c.name (pushName excluded)
- Persist _verifiedGroupNames to localStorage so correct names load
  instantly on hard refresh without waiting for async API call
- Remove one-time _groupSubjectsFetched gate; now retries only unverified
  groups each load so transient 404s are recovered on next visit
- All 14 groups now resolve to correct subject names immediately

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add WhatsApp-style delete modal with "Delete for everyone" / "Delete for me" / "Cancel"
- "Delete for everyone" disabled when any selected message is not fromMe
- "Delete for me" always removes locally regardless of API result
- Delete available from context menu (single msg) and select-mode toolbar (multi-select)
- Fix chatApiCall to send body on DELETE requests (was silently dropped)
- Fix chatState missing allFetchedMessages initialisation (crash before first convo)
- Fix modal not closing on conversation switch or close (wrong JID bug)
- Fix Escape key not dismissing delete modal
- Fix select toolbar delete button uses stable id instead of fragile attribute selector
- Fix RTL: add dir=auto to contact/poll/default/quoted message text elements
- Fix XSS: onerror avatar uses sibling-element pattern instead of innerHTML
- Fix XSS: quotedMsg.id sanitised before embedding in onclick
- Fix XSS: image lightbox uses data-src attribute instead of inline URL
- Fix crash: location case guards against null m.text + uses encodeURIComponent
- Fix: group name/subject/desc escaped with chatEsc() + dir=auto added
- Fix: FileReader base64 split guarded against missing comma
- Fix chatCopySelected / chatForwardSelected use Set.has() instead of Array.includes()
- Fix chatCloseConversation resets select mode state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@erancybersec erancybersec merged commit b019c0c into master Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant