🐛 Fix wrong notify format

This commit is contained in:
LittleSheep 2024-06-28 23:21:29 +08:00
parent ed9487a709
commit edd02a03f7

View File

@ -2,12 +2,13 @@ package services
import ( import (
"fmt" "fmt"
"strings"
"git.solsynth.dev/hydrogen/messaging/pkg/internal/database" "git.solsynth.dev/hydrogen/messaging/pkg/internal/database"
"git.solsynth.dev/hydrogen/messaging/pkg/internal/models" "git.solsynth.dev/hydrogen/messaging/pkg/internal/models"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"github.com/samber/lo" "github.com/samber/lo"
"strings"
) )
func CountEvent(channel models.Channel) int64 { func CountEvent(channel models.Channel) int64 {
@ -131,12 +132,12 @@ func NotifyMessageEvent(members []models.ChannelMember, event models.Event) {
} }
if len(channelDisplay) == 0 { if len(channelDisplay) == 0 {
channelDisplay = event.Channel.Alias channelDisplay = fmt.Sprintf("#%s", event.Channel.Alias)
} }
err := NotifyAccountMessager(member.Account, err := NotifyAccountMessager(member.Account,
"incomingMessage", "incomingMessage",
fmt.Sprintf("%s in #%s", event.Sender.Account.Nick, channelDisplay), fmt.Sprintf("%s in %s", event.Sender.Account.Nick, channelDisplay),
fmt.Sprintf("%s", displayText), fmt.Sprintf("%s", displayText),
true, true,
false, false,