mirror of
https://github.com/pushbits/server.git
synced 2025-08-03 08:39:09 +02:00
Restructure project layout
This commit is contained in:
parent
a49db216d5
commit
9a4a096526
32 changed files with 35 additions and 35 deletions
19
internal/dispatcher/notification.go
Normal file
19
internal/dispatcher/notification.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package dispatcher
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/pushbits/server/internal/model"
|
||||
)
|
||||
|
||||
// SendNotification sends a notification to the specified user.
|
||||
func (d *Dispatcher) SendNotification(a *model.Application, n *model.Notification) error {
|
||||
log.Printf("Sending notification to room %s.\n", a.MatrixID)
|
||||
|
||||
text := fmt.Sprintf("%s\n\n%s", n.Title, n.Message)
|
||||
|
||||
_, err := d.client.SendText(a.MatrixID, text)
|
||||
|
||||
return err
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue