[Steemwatch] Do Not Send Notifications Related to Muted UserssteemCreated with Sketch.

in utopian-io •  7 years ago 

[Steemwatch] Do Not Send Notifications Related to Muted Users

image.png


Issue

Currently when you mute a user on the blockchain, Steemwatch will still send alerts about their comments on your posts (if you have that feature turned on).

Recommendation

Please do not send notifications to a user if the generating user has been muted. For instance, if Bob mutes Alice on the blockchain and Alice comments on Bob's post, Bob will receive a Steemwatch alert for Alice's comment. What should happen in reality is that Bob is not notified via any of the methods Steemwatch is configured for.

Pseudo-code

// CommentPublished

func renderCommentPublishedEvent(event *events.CommentPublished) string {
    c := event.Content

    // return if user is muted by account

    commentLines := make([]string, 0, 5)
    scanner := bufio.NewScanner(strings.NewReader(c.Body))
    for scanner.Scan() {
        commentLines = append(commentLines, scanner.Text())
    }

    extractLines := commentLines
    if len(extractLines) > 5 {
        extractLines = extractLines[:5]
    }

    extract := strings.Join(extractLines, "\n")
    if len(commentLines) > 5 {
        extract += fmt.Sprintf("\n<https://steemit.com%v|Read more...>", c.URL)
    }

    return fmt.Sprintf(`
**-----**
%v commented on @%v/%v.

**Content:** %v
`,
        steemitLink(c.Author),
        c.URL,
        c.ParentAuthor,
        c.ParentPermlink,
        extract,
    )
}

Links



Open Source Contribution posted via Utopian.io

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order: