Improve notification data format

This commit is contained in:
Tulir Asokan 2018-03-20 23:38:48 +02:00
parent bb58954f75
commit 9111073132

View File

@ -189,7 +189,12 @@ func (c *Container) Start() {
}
func (c *Container) NotifyMessage(room *rooms.Room, message *types.Message) {
notification.Send(room.GetTitle(), message.Text, false)
sender := fmt.Sprintf("%s (%s)", message.Sender, room.GetTitle())
if room.GetTitle() == message.Sender {
// 1:1 room, title is same as display name of other user.
sender = message.Sender
}
notification.Send(sender, message.Text, false)
}
func (c *Container) HandleMessage(evt *gomatrix.Event) {