Notifications with new Flutter app [Kinda work!]
This commit is contained in:
@@ -2,6 +2,7 @@ package models
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/sq"
|
||||
@@ -94,6 +95,14 @@ func (m Message) ShortContent() string {
|
||||
return (*m.Content)[0:ContentLengthShort-3] + "..."
|
||||
}
|
||||
|
||||
func (m Message) FormatNotificationTitle(user User, channel Channel) string {
|
||||
if m.ChannelInternalName == user.DefaultChannel() {
|
||||
return m.Title
|
||||
}
|
||||
|
||||
return fmt.Sprintf("[%s] %s", channel.DisplayName, m.Title)
|
||||
}
|
||||
|
||||
type MessageJSON struct {
|
||||
MessageID MessageID `json:"message_id"`
|
||||
SenderUserID UserID `json:"sender_user_id"`
|
||||
|
||||
Reference in New Issue
Block a user