diff --git a/config/notification.yaml b/config/notification.yaml index 92a9e3f8c..a9a214b6d 100644 --- a/config/notification.yaml +++ b/config/notification.yaml @@ -270,7 +270,7 @@ userInfoUpdated: #####################conversation######################### conversationChanged: - isSendMsg: true + isSendMsg: false reliabilityLevel: 1 unreadCount: false offlinePush: diff --git a/internal/msggateway/context.go b/internal/msggateway/context.go index 5006a01fd..cbb47fdfd 100644 --- a/internal/msggateway/context.go +++ b/internal/msggateway/context.go @@ -56,6 +56,9 @@ func newContext(respWriter http.ResponseWriter, req *http.Request) *UserConnCont ConnID: utils.Md5(req.RemoteAddr + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))), } } +func (c *UserConnContext) GetRemoteAddr() string { + return c.RemoteAddr +} func (c *UserConnContext) Query(key string) (string, bool) { var value string if value = c.Req.URL.Query().Get(key); value == "" { diff --git a/internal/msggateway/n_ws_server.go b/internal/msggateway/n_ws_server.go index 237c89666..8fab14a1c 100644 --- a/internal/msggateway/n_ws_server.go +++ b/internal/msggateway/n_ws_server.go @@ -132,7 +132,7 @@ func (ws *WsServer) registerClient(client *Client) { if clientOK { //已经有同平台的连接存在 ws.clients.Set(client.userID, client) ws.multiTerminalLoginChecker(cli) - log.ZInfo(client.ctx, "repeat login", "userID", client.userID, "platformID", client.platformID) + log.ZInfo(client.ctx, "repeat login", "userID", client.userID, "platformID", client.platformID, "old remote addr", getRemoteAdders(cli)) atomic.AddInt64(&ws.onlineUserConnNum, 1) } else { ws.clients.Set(client.userID, client) @@ -141,6 +141,17 @@ func (ws *WsServer) registerClient(client *Client) { } log.ZInfo(client.ctx, "user online", "online user Num", ws.onlineUserNum, "online user conn Num", ws.onlineUserConnNum) } +func getRemoteAdders(client []*Client) string { + var ret string + for i, c := range client { + if i == 0 { + ret = c.ctx.GetRemoteAddr() + } else { + ret += "@" + c.ctx.GetRemoteAddr() + } + } + return ret +} func (ws *WsServer) multiTerminalLoginChecker(client []*Client) {