Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[r/boards] initialize reposting #3227

Closed
10 tasks
salmad3 opened this issue Nov 28, 2024 · 4 comments
Closed
10 tasks

[r/boards] initialize reposting #3227

salmad3 opened this issue Nov 28, 2024 · 4 comments
Assignees

Comments

@salmad3
Copy link
Member

salmad3 commented Nov 28, 2024

Context:

Reposting lets users share content across boards or within the same board while being able to add their own commentary. This feature ensures clear links to the original post for easy navigation and preserves context for all participants.

Acceptance Criteria:

  • Replaces reposting functionality that exists in v1.

  • Includes a Repost function that allows users to repost both threads and comments:

    • Users can repost content to the same board or a different board.
    • A new thread is created for each repost, embedding the original content.

    Example
    func (bp *BoardsRealm) Repost(user User, originalPostID string, targetBoardName string, additionalText string) error {
        if !bp.HasPermission(user, "repost", []interface{}{originalPostID, targetBoardName}) {
            return errors.New("user does not have permission to repost")
        }
    
        originalPost := bp.GetPost(originalPostID)
        newPost := &Post{
            BoardID:     bp.GetBoardID(targetBoardName),
            Author:      user.Address,
            Content:     additionalText,
            OriginalID:  originalPostID,
            RepostType:  originalPost.ParentID == 0 ? "thread" : "comment",
            Timestamp:   time.Now(),
        }
    
        bp.AddPost(newPost)
        return nil
    }
  • Ensures reposted content is clearly marked as a repost and provides easy navigation to the original content.

  • Allows users to add optional text when reposting.

  • Accounts for permission checks to ensure users have the right to repost content.

  • Shows both the original post and any additional text added by the reposter.

  • Adds a "Repost" button or option in the UI for both threads and comments.

  • Tracks and displays repost counts for original content.

  • Ensures that reposting respects privacy settings of the original content (e.g., cannot repost from a private board to a public board).

  • Includes Unit tests to verify reposting functionality, including permission checks and content creation.

Notes:

  • X is a good reference for reposting.
  • The MVP will focus on basic reposting functionality without complex features like repost chains or analytics.
  • Consider implementing notifications (Dogfood r/boards on portal loop #3018) for original authors when their content is reposted in future versions.
@jefft0
Copy link
Contributor

jefft0 commented Nov 28, 2024

Hello @salmad3 . You propose a Repost function but there is already support for AddRepostTo. Is this a modification of the existing repost support?

func (post *Post) AddRepostTo(creator std.Address, title, body string, dst *Board) *Post {

@salmad3
Copy link
Member Author

salmad3 commented Nov 28, 2024

Thanks @jefft0. It wouldn't necessarily modify AddRepostTo; it was initially added based on a more general idea. However, we recently discussed reposting criteria, so the issue aims to capture how to expand and clarify the requirements.

@salmad3
Copy link
Member Author

salmad3 commented Jan 8, 2025

@x1unix will take on

@x1unix
Copy link
Contributor

x1unix commented Jan 8, 2025

@salmad3

Ensures that reposting respects privacy settings of the original content (e.g., cannot repost from a private board to a public board).

We don't have this functionality yet, all posts and boards are public.

Accounts for permission checks to ensure users have the right to repost content.

Existing permission interface will be used to check whether user has write access to a destination board.
Also atm I assume any post is repost-able and there are no restrictions on reposting it.

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

No branches or pull requests

4 participants