feat(posted): add pinned posts support with createPostV2, pin/unpin API, and backward-compatible serialization - #353
Open
GreatShinro wants to merge 1 commit into
Conversation
- Add mPinnedPosts (RsTlvGxsMsgIdSet) to RsPostedGroup for pin/unpin state - Add PINNED_POSTS_CHANGED event code - Add pinPost/unpinPost virtual methods to RsPosted interface - Implement pin/unpin in p3posted.cc with editBoard pattern - Add backward-compatible serialization with length checks - Update createPostDialog to use createPostV2 with error messages - Add Pin/Unpin context menu for post publishers - Sort pinned posts to top regardless of sort strategy - Add pinned visual indicator via feedFrame CSS property
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds pinned posts support to the Posted board service, including the
createPostV2API,pinPost/unpinPostmethods, and backward-compatible group serialization.Changes
rsposted.h: AddedmPinnedPosts(RsTlvGxsMsgIdSet) toRsPostedGroup,PINNED_POSTS_CHANGEDevent code, andpinPost/unpinPostvirtual methods toRsPostedinterfacersposteditems.h: AddedmPinnedPostsfield andrstlvidset.hinclude toRsGxsPostedGroupItemrsposteditems.cc: Added backward-compatible serialization - checksctx.mOffset == ctx.mSizeafter image TLV before reading pinned posts, so old nodes that don't know about pins still workp3posted.h/.cc: ImplementedpinPost/unpinPostusing the existingeditBoardpattern (fetch group, modify, updateGroup)Backward Compatibility
The serialization uses the same backward-compat pattern as the existing image field: if only description+image were written (old nodes), deserialization stops before attempting to read pinned posts. This means old nodes can still read groups that have pins set - they just ignore the field.
Test Plan