모듈 업데이트
This commit is contained in:
@ -268,12 +268,17 @@ func (iv *invitation) InviteAsFriend(w http.ResponseWriter, r *http.Request) {
|
||||
_, newid, err := iv.mongoClient.Update(invitation_collection_name, bson.M{
|
||||
"_id": combineObjectID(ivdoc.From, ivdoc.To),
|
||||
}, bson.M{"$setOnInsert": ivdoc}, options.Update().SetUpsert(true))
|
||||
if err != nil || newid == nil {
|
||||
if err != nil {
|
||||
logger.Println("InviteAsFriend failed:", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
if newid == nil {
|
||||
// 이미 보낸 초대 요청
|
||||
return
|
||||
}
|
||||
|
||||
ivdoc.Id = newid.(primitive.ObjectID)
|
||||
if !ivdoc.Blocked {
|
||||
iv.wsh.SendUpstreamMessage(&wshandler.UpstreamMessage{
|
||||
|
||||
Reference in New Issue
Block a user