Skip to content

wallet: Return own addresses and per-chat unread state in getChats() - #2159

Open
profinch wants to merge 1 commit into
BeamMW:masterfrom
profinch:1253-chat-my-addresses
Open

profinch wants to merge 1 commit into
BeamMW:masterfrom
profinch:1253-chat-my-addresses

Conversation

@profinch

@profinch profinch commented Oct 8, 2026

Copy link
Copy Markdown

Needed for BeamMW/beam-ui#1253.

Summary

  • IWalletDB::getChats() now returns a ChatInfo per chat: the counterpart, the unread flag and the own addresses (mySbbs) used in the chat. This lets the UI hide chats with messages received on certain own addresses, e.g. addresses used by other SBBS tools like PriviMe, which clutter the Beam Messenger.
  • WalletClient::onGetChatList() receives std::vector<ChatInfo> accordingly. It's only overridden in beam-ui.
  • Fix the unread flag: it was computed with SELECT count(*) FROM IM WHERE is_read = 0, i.e. over all instant messages of the wallet, so a single unread message marked every chat as unread. It's now computed per chat.

Test plan

  • New TestChats in wallet_db_test: grouping by counterpart, own addresses per chat, per-chat unread flag
  • wallet_db_test built and passed locally (macOS, AppleClang)

🤖 Generated with Claude Code

Return a ChatInfo for each chat, containing the own addresses used in
the chat besides the counterpart and the unread flag. This allows the
UI to hide messages received on certain own addresses, e.g. used by
other SBBS tools (BeamMW/beam-ui#1253).

Also fix the unread flag, which was computed over all the instant
messages of the wallet instead of the messages of the chat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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