diff --git a/core/group_party.go b/core/group_party.go index cb7eccb..5fc6946 100644 --- a/core/group_party.go +++ b/core/group_party.go @@ -804,28 +804,30 @@ func (gp *groupParty) ClientDisconnected(msg string, callby *wshandler.Sender) { // 나를 먼저 룸에서 빼야 나한테 메시지가 안감 gp.leaveRoom(gid, callby.Accid) - gd := &partyDoc{ - rh: gp.rh, - id: gid, - } + if msg != "pending" { + gd := &partyDoc{ + rh: gp.rh, + id: gid, + } - if gd.getIncharge() == gd.tid(callby.Accid) { - // 방장이 나감. 방 폭파 - gp.sendUpstreamMessage(&wshandler.UpstreamMessage{ - Target: "#" + gidstr, - Body: bson.M{"gid": gid}, - Tag: []string{"GroupDocFull", gidstr}, - }) - gd.rh.Del(gd.rh.Context(), gd.strid()).Result() - } else if msg != "pending" { - // gid에는 제거 메시지 보냄 - gp.sendUpstreamMessage(&wshandler.UpstreamMessage{ - Target: "#" + gidstr, - Body: bson.M{ - makeTid(gid, callby.Accid): bson.M{}, - }, - Tag: []string{"MemberDocFull"}, - }) + if gd.getIncharge() == gd.tid(callby.Accid) { + // 방장이 나감. 방 폭파 + gp.sendUpstreamMessage(&wshandler.UpstreamMessage{ + Target: "#" + gidstr, + Body: bson.M{"gid": gid}, + Tag: []string{"GroupDocFull", gidstr}, + }) + gd.rh.Del(gd.rh.Context(), gd.strid()).Result() + } else { + // gid에는 제거 메시지 보냄 + gp.sendUpstreamMessage(&wshandler.UpstreamMessage{ + Target: "#" + gidstr, + Body: bson.M{ + makeTid(gid, callby.Accid): bson.M{}, + }, + Tag: []string{"MemberDocFull"}, + }) + } } } }