focalboard/server/services/notify/notifysubscriptions/util.go
Doug Lauder 75bd409ba0
Notifications phase 1 (#1851)
Backend support for subscribing/unsubscribing to blocks, typically cards and boards. Notifies subscribers when changes are made to cards they are subscribed to.
2021-12-10 10:46:37 -05:00

32 lines
558 B
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package notifysubscriptions
import (
"strings"
"github.com/mattermost/focalboard/server/model"
)
func getBoardDescription(board *model.Block) string {
if board == nil {
return ""
}
descr, ok := board.Fields["description"]
if !ok {
return ""
}
description, ok := descr.(string)
if !ok {
return ""
}
return description
}
func stripNewlines(s string) string {
return strings.TrimSpace(strings.ReplaceAll(s, "\n", "¶ "))
}