UpdatePartyDocumentDirect를 PartyOwner만 동작하도록 함
This commit is contained in:
@ -164,8 +164,6 @@ func (gc *groupChat) EnterPrivateChannel(ctx wshandler.ApiCallContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
gc.enterRoom(channel, ctx.CallBy.Accid)
|
gc.enterRoom(channel, ctx.CallBy.Accid)
|
||||||
} else {
|
|
||||||
// 내가 이미 private channel에 있다는 것을 다른 사람들에게 알려주기 위함
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gc.sendUpstreamMessage(&wshandler.UpstreamMessage{
|
gc.sendUpstreamMessage(&wshandler.UpstreamMessage{
|
||||||
|
|||||||
@ -710,7 +710,6 @@ func (gp *groupParty) ClientDisconnected(ctx wshandler.ApiCallContext) {
|
|||||||
Tag: []string{"MemberDocFull"},
|
Tag: []string{"MemberDocFull"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,9 +721,27 @@ func (gp *groupParty) UpdatePartyMemberDocumentDirect(ctx wshandler.ApiCallConte
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gp *groupParty) UpdatePartyDocumentDirect(ctx wshandler.ApiCallContext) {
|
func (gp *groupParty) UpdatePartyDocumentDirect(ctx wshandler.ApiCallContext) {
|
||||||
|
// 파티 오너만 가능
|
||||||
gidobj, _ := primitive.ObjectIDFromHex(ctx.Arguments[0].(string))
|
gidobj, _ := primitive.ObjectIDFromHex(ctx.Arguments[0].(string))
|
||||||
doc := ctx.Arguments[1].(map[string]any)
|
doc := ctx.Arguments[1].(map[string]any)
|
||||||
|
|
||||||
|
gd := groupDoc{
|
||||||
|
id: gidobj,
|
||||||
|
rh: gp.rh,
|
||||||
|
}
|
||||||
|
|
||||||
|
incharge, err := gp.rh.JSONGet(gd.strid(), "$._incharge")
|
||||||
|
if err != nil {
|
||||||
|
logger.Println("UpdatePartyDocumentDirect failed. gp.rh.JSONGet returns err :", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if !strings.Contains(incharge.(string), gd.tid(ctx.CallBy.Accid)) {
|
||||||
|
// incharge가 아니네?
|
||||||
|
logger.Println("UpdatePartyDocumentDirect failed. caller is not incharge")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
gp.updatePartyDocument(gidobj, doc)
|
gp.updatePartyDocument(gidobj, doc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user