mirror of
https://github.com/originalmk/archat-server.git
synced 2024-11-20 09:38:50 +00:00
Remove initiation after sending ChatFinishRequest
This commit is contained in:
parent
c95443f41f
commit
7b0f359a7f
@ -559,6 +559,7 @@ func testEcho(hdlCtx *HandlerContext) {
|
|||||||
|
|
||||||
func (ctx *Context) wsapiHandler(w http.ResponseWriter, r *http.Request) {
|
func (ctx *Context) wsapiHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
upgrader := websocket.Upgrader{}
|
upgrader := websocket.Upgrader{}
|
||||||
|
|
||||||
conn, err := upgrader.Upgrade(w, r, nil)
|
conn, err := upgrader.Upgrade(w, r, nil)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -675,6 +676,12 @@ func (srvCtx *Context) handleUDP(data []byte, addr net.Addr) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
srvCtx.initiations = slices.DeleteFunc(srvCtx.initiations,
|
||||||
|
func(i *common.Initiation) bool {
|
||||||
|
return i.AbAPunchCode == matchedInitation.AbAPunchCode ||
|
||||||
|
i.AbBPunchCode == matchedInitation.AbAPunchCode
|
||||||
|
})
|
||||||
|
|
||||||
err = abA.sendRequest(common.StartChatFinishRequest{
|
err = abA.sendRequest(common.StartChatFinishRequest{
|
||||||
OtherSideNickname: matchedInitation.AbBNick,
|
OtherSideNickname: matchedInitation.AbBNick,
|
||||||
OtherSideAddress: matchedInitation.AbBAddress,
|
OtherSideAddress: matchedInitation.AbBAddress,
|
||||||
|
Loading…
Reference in New Issue
Block a user