From e4b0f569e86da61589c4c2f66a2d26d26acb8595 Mon Sep 17 00:00:00 2001 From: mountain Date: Wed, 24 Jan 2024 18:16:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=91=EC=86=8D=20=EC=A2=85=EB=A3=8C?= =?UTF-8?q?=EC=8B=9C=20pending=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/group_party.go | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) 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"}, + }) + } } } }