Claude/mark message read 011 cu lz6 jdq2ufi lflr5 wh17 #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add unified message read status tracking and control
Summary
This PR adds comprehensive message read status tracking and control to webex-rust, unifying features from two separate branches into a cohesive implementation.
Features Added
1. Message Read/Unread Control
mark_message_as_read(message_id, room_id)- Mark messages as read on servermark_message_as_unread(message_id, room_id)- Mark messages as unread for later review2. Read Status Tracking
get_room_with_read_status(room_id)- Get room with read status infolist_rooms_with_read_status()- List all rooms with read statusReadStatusstruct for tracking last seen messages and unread state3. Membership API Support
Membershiptype now implementsGettabletraitget_room_memberships(room_id)- Get all members in a roomget_person_memberships(person_id)- Get all rooms for a personlist<Membership>(),get<Membership>(id)4. WebSocket Event Support
MembershipActivityenum for membership eventsmemberships:seenevents (read receipts)Seen,Created,Updated,DeletedAPI Integration
The new API complements the existing API perfectly with zero duplication:
How It Integrates
Generic API Extension (follows existing pattern):
Convenience Methods (mirrors existing pattern):
Enhancement Pattern (doesn't replace existing):
New Capabilities (orthogonal functionality):
Implementation Details
Data Structures
Unified Membership struct:
ReadStatus tracking:
MembershipActivity events:
How Mark as Read/Unread Works
Mark as Read:
lastSeenIdfield to the target message ID/v1/memberships/{membershipId}Mark as Unread:
lastSeenIdto that previous message IDExamples
Example 1: Interactive Read/Unread Bot
examples/mark-as-read.rs- Bot that responds to commands:Example 2: Read Status Tracking
examples/read-status.rs- Demonstrates:Documentation
MESSAGE_READ_STATUS.md- Comprehensive feature documentationREADME.mdwith new capabilitiesTesting
To test:
Fulfills README Promise
The original README claimed:
But this was never implemented. This PR delivers on that promise and adds bonus read/unread functionality.
Breaking Changes
None. All existing APIs continue to work unchanged.
Commits
Related Work
This PR unifies and supersedes:
claude/webex-message-status-011CULyyyEDqD3obksGqKZ4s(read status tracking)Files Changed
src/types.rs- Added Membership, ReadStatus, RoomWithReadStatus structs; MembershipActivity enumsrc/lib.rs- Added 6 new public methods for memberships and read statusREADME.md- Updated feature listMESSAGE_READ_STATUS.md- Comprehensive documentationexamples/mark-as-read.rs- Interactive mark as read/unread exampleexamples/read-status.rs- Read status tracking example🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com