Skip to content

feat(chat): adopt the flipcash2 0.21.0 contract - #1125

Merged
bmc08gt merged 3 commits into
mainfrom
feat/flipcash2-contract-0.21.0
Oct 23, 2026
Merged

bmc08gt merged 3 commits into
mainfrom
feat/flipcash2-contract-0.21.0

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Moves flipcash2-client-protocol to 0.21.0 (code-payments/flipcash2-client-protocol#29) and adapts the app to the new contract. The pin and Package.resolved move together in one commit, made with ./Scripts/bump-contract.sh. It adds no UI.

  • CashContent: ConversationMessage reads totalAmount and the recipient oneof. A single receiver still fills cashReceiverID. New cashPayments carries multi-receiver parts, and new paymentRequestID carries the request id.
  • Viewer state: ConversationViewerState gains silence, canSilence, canBan and isSilenced(at:). Database.schemaVersion goes from 54 to 55 because the persisted viewer state changed shape.
  • BANNED: .banned is appended to ErrorJoinChat (raw value 4) and ErrorEnterLobby (raw value 6), and Events.swift maps it.
  • Chat moderation: silence, unsilence, ban, unban and getRestrictedUsers are in ChatService and FlipClient+Chat.
  • PaymentRequest service: PaymentRequestService wraps its five RPCs, exposed through FlipClient+PaymentRequest. The domain type is GroupPaymentRequest, because FlipcashCore already has an unrelated PaymentRequest.
  • PaymentRequestWidget: mapped to .unrecognized until it has a renderer.
  • Tests: the new errors are registered in TransportClassificationTests. The mapping tests cover multi-receiver, payment_request_id and viewer moderation state.

…r moderation state

CashContent.amount/receiver became totalAmount and a recipient oneof. Map the
single receiver as before, carry multi-receiver payments and payment_request_id
on ConversationMessage, and surface ViewerState silence plus moderation
permissions. PaymentRequestWidget stays unrecognized until it has UI.
Bumps the database schema version for the new persisted viewer-state fields.
Add PaymentRequestService and FlipClient wrappers for the five paymentrequest.v1
RPCs, wrappers for silence/unsilence/ban/unban/get-restricted-users, and the
appended BANNED result cases for JoinChat and EnterLobby.
@bmc08gt
bmc08gt marked this pull request as ready for review October 23, 2026 20:48
@bmc08gt
bmc08gt merged commit f7f8cf5 into main Oct 23, 2026
5 checks passed
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