Tidy + timeline embetterment (#38)

* tidy up timelines a bit + stub out some endpoints

* who's faved and who's boosted, reblog notifs

* linting

* Update progress with new endpoints
This commit is contained in:
Tobi Smethurst
2021-05-31 17:36:35 +02:00
committed by GitHub
parent 3d77f81c7f
commit 6ac6f8d614
23 changed files with 692 additions and 15 deletions

View File

@ -41,6 +41,8 @@ const (
MaxIDKey = "max_id"
// LimitKey is for specifying maximum number of notifications to return.
LimitKey = "limit"
// SinceIDKey is for specifying the minimum notification ID to return.
SinceIDKey = "since_id"
)
// Module implements the ClientAPIModule interface for every related to posting/deleting/interacting with notifications

View File

@ -62,7 +62,13 @@ func (m *Module) NotificationsGETHandler(c *gin.Context) {
maxID = maxIDString
}
notifs, errWithCode := m.processor.NotificationsGet(authed, limit, maxID)
sinceID := ""
sinceIDString := c.Query(SinceIDKey)
if sinceIDString != "" {
sinceID = sinceIDString
}
notifs, errWithCode := m.processor.NotificationsGet(authed, limit, maxID, sinceID)
if errWithCode != nil {
l.Debugf("error processing notifications get: %s", errWithCode.Error())
c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})