mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-29 17:46:15 -06:00
little fixes
This commit is contained in:
parent
9b3e17b274
commit
e8a8dd1c27
3 changed files with 4 additions and 5 deletions
|
|
@ -70,9 +70,7 @@ func (m *Module) AuthorizeGETHandler(c *gin.Context) {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "no client_id found in session"})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": "no client_id found in session"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
app := >smodel.Application{
|
app := >smodel.Application{}
|
||||||
ClientID: clientID,
|
|
||||||
}
|
|
||||||
if err := m.db.GetWhere(c.Request.Context(), []db.Where{{Key: sessionClientID, Value: app.ClientID}}, app); err != nil {
|
if err := m.db.GetWhere(c.Request.Context(), []db.Where{{Key: sessionClientID, Value: app.ClientID}}, app); err != nil {
|
||||||
m.clearSession(s)
|
m.clearSession(s)
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("no application found for client id %s", clientID)})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("no application found for client id %s", clientID)})
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,9 @@ type Status struct {
|
||||||
EmojiIDs []string `bun:"emojis,array"`
|
EmojiIDs []string `bun:"emojis,array"`
|
||||||
Emojis []*Emoji `bun:"attached_emojis,m2m:status_to_emojis"` // https://bun.uptrace.dev/guide/relations.html#many-to-many-relation
|
Emojis []*Emoji `bun:"attached_emojis,m2m:status_to_emojis"` // https://bun.uptrace.dev/guide/relations.html#many-to-many-relation
|
||||||
// when was this status created?
|
// when was this status created?
|
||||||
CreatedAt time.Time `bun:",notnull,default:current_timestamp"`
|
CreatedAt time.Time `bun:",notnull,nullzero,default:current_timestamp"`
|
||||||
// when was this status updated?
|
// when was this status updated?
|
||||||
UpdatedAt time.Time `bun:",notnull,default:current_timestamp"`
|
UpdatedAt time.Time `bun:",notnull,nullzero,default:current_timestamp"`
|
||||||
// is this status from a local account?
|
// is this status from a local account?
|
||||||
Local bool
|
Local bool
|
||||||
// which account posted this status?
|
// which account posted this status?
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,7 @@ func (c *converter) ASStatusToStatus(ctx context.Context, statusable ap.Statusab
|
||||||
published, err := ap.ExtractPublished(statusable)
|
published, err := ap.ExtractPublished(statusable)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
status.CreatedAt = published
|
status.CreatedAt = published
|
||||||
|
status.UpdatedAt = published
|
||||||
}
|
}
|
||||||
|
|
||||||
// which account posted this status?
|
// which account posted this status?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue