Commit fbdb6a3a authored by zauberstuhl's avatar zauberstuhl

Change federation time layout

related to ganggo/federation#8
parent 069d290b
...@@ -249,9 +249,7 @@ func (c ApiComment) CreatePost() revel.Result { ...@@ -249,9 +249,7 @@ func (c ApiComment) CreatePost() revel.Result {
c.Log.Error(TAG, "db", err, "api", ERR_SERVER) c.Log.Error(TAG, "db", err, "api", ERR_SERVER)
return c.ApiError(http.StatusInternalServerError, ERR_SERVER) return c.ApiError(http.StatusInternalServerError, ERR_SERVER)
} }
entityComment.CreatedAt = federation.Time{ entityComment.CreatedAt.New(comment.CreatedAt)
Time: comment.CreatedAt,
}
dispatcher := jobs.Dispatcher{ dispatcher := jobs.Dispatcher{
User: c.CurrentUser, User: c.CurrentUser,
......
...@@ -195,10 +195,10 @@ func (p ApiPost) Create() revel.Result { ...@@ -195,10 +195,10 @@ func (p ApiPost) Create() revel.Result {
Text: postText, Text: postText,
Author: p.CurrentUser.Person.Author, Author: p.CurrentUser.Person.Author,
Guid: guid, Guid: guid,
CreatedAt: federation.Time{Time: time.Now()},
ProviderName: "GangGo", ProviderName: "GangGo",
Public: true, Public: true,
} }
entity.CreatedAt.New(time.Now())
// this one is a private message // this one is a private message
if aspectID > 0 { if aspectID > 0 {
entity.Public = false entity.Public = false
...@@ -458,10 +458,10 @@ func (p ApiPost) Reshare() revel.Result { ...@@ -458,10 +458,10 @@ func (p ApiPost) Reshare() revel.Result {
entity := federation.EntityReshare{ entity := federation.EntityReshare{
Author: p.CurrentUser.Person.Author, Author: p.CurrentUser.Person.Author,
Guid: guid, Guid: guid,
CreatedAt: federation.Time{Time: time.Now()},
RootAuthor: rootPost.Person.Author, RootAuthor: rootPost.Person.Author,
RootGuid: rootPost.Guid, RootGuid: rootPost.Guid,
} }
entity.CreatedAt.New(time.Now())
var post models.Post var post models.Post
err = post.Create(&entity) err = post.Create(&entity)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment