[Steemwatch] Do Not Send Notifications Related to Muted Users

[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

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now