netuoso - HiveDevs avatar

[Steemwatch] Do Not Send Notifications Related to Muted Users

netuoso

Published: 11 Nov 2017 › Updated: 11 Nov 2017[Steemwatch] Do Not Send Notifications Related to Muted Users

[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

Leave [Steemwatch] Do Not Send Notifications Related to Muted Users to:

Written by

Hive Witness | Founder of HiveDevs Discord | Graphene Blockchain Developer | Full-Stack Developer

Read more #utopian-io posts


Best Posts From netuoso - HiveDevs

We have not curated any of netuoso's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From netuoso - HiveDevs