Commit ee81d279 authored by zauberstuhl's avatar zauberstuhl

Add aspect ID to post create call

related to ganggo/ganggo#12
parent f8f2f3d8
......@@ -50,9 +50,11 @@ func (p ApiPost) Create() revel.Result {
var (
post models.Post
postText string
aspectID uint
)
p.Params.Bind(&postText, "post")
p.Params.Bind(&aspectID, "aspectID")
user, err := models.GetCurrentUser(p.Session["TOKEN"])
if err != nil {
......@@ -75,6 +77,10 @@ func (p ApiPost) Create() revel.Result {
ProviderName: "GangGo",
Public: true,
}
// this one is a private message
if aspectID > 0 {
entity.Public = false
}
// save post locally
err = post.Create(&entity, nil)
......@@ -85,7 +91,8 @@ func (p ApiPost) Create() revel.Result {
dispatcher := jobs.Dispatcher{
User: user,
Message: &entity,
AspectID: aspectID,
Message: entity,
}
go dispatcher.Run()
......
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