mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-31 23:22:24 -05:00
Notifications (#34)
Notifications working for: * Mentions * Faves * New follow requests * New followers
This commit is contained in:
parent
e670c32a91
commit
40add68691
42 changed files with 2096 additions and 1194 deletions
24
internal/message/notificationsprocess.go
Normal file
24
internal/message/notificationsprocess.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package message
|
||||
|
||||
import (
|
||||
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
)
|
||||
|
||||
func (p *processor) NotificationsGet(authed *oauth.Auth, limit int, maxID string) ([]*apimodel.Notification, ErrorWithCode) {
|
||||
notifs, err := p.db.GetNotificationsForAccount(authed.Account.ID, limit, maxID)
|
||||
if err != nil {
|
||||
return nil, NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
mastoNotifs := []*apimodel.Notification{}
|
||||
for _, n := range notifs {
|
||||
mastoNotif, err := p.tc.NotificationToMasto(n)
|
||||
if err != nil {
|
||||
return nil, NewErrorInternalError(err)
|
||||
}
|
||||
mastoNotifs = append(mastoNotifs, mastoNotif)
|
||||
}
|
||||
|
||||
return mastoNotifs, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue