Skip to content

Commit

Permalink
Merge branch 'openimsdk:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
withchao authored Oct 14, 2024
2 parents bcc7e77 + 87f79d3 commit f6133dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
5 changes: 0 additions & 5 deletions config/discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ etcd:
username: ''
password: ''

zookeeper:
schema: openim
address: [ localhost:12181 ]
username: ''
password: ''

14 changes: 1 addition & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,6 @@ services:
networks:
- openim

zookeeper:
image: "${ZOOKEEPER_IMAGE}"
container_name: zookeeper
ports:
- "12181:2181"
environment:
#JVMFLAGS: "-Xms32m -Xmx128m"
TZ: "Asia/Shanghai"
ALLOW_ANONYMOUS_LOGIN: "yes"
restart: always
networks:
- openim

etcd:
image: "${ETCD_IMAGE}"
container_name: etcd
Expand Down Expand Up @@ -142,6 +129,7 @@ services:
# image: ${PROMETHEUS_IMAGE}
# container_name: prometheus
# restart: always
# user: root
# volumes:
# - ./config/prometheus.yml:/etc/prometheus/prometheus.yml
# - ./config/instance-down-rules.yml:/etc/prometheus/instance-down-rules.yml
Expand Down
13 changes: 13 additions & 0 deletions internal/msggateway/online.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ func (ws *WsServer) ChangeOnlineStatus(concurrent int) {
if _, err := ws.userClient.Client.SetUserOnlineStatus(ctx, req); err != nil {
log.ZError(ctx, "update user online status", err)
}
for _, ss := range req.Status {
for _, online := range ss.Online {
client, _, _ := ws.clients.Get(ss.UserID, int(online))
back := false
if len(client) > 0 {
back = client[0].IsBackground
}
ws.webhookAfterUserOnline(ctx, &ws.msgGatewayConfig.WebhooksConfig.AfterUserOnline, ss.UserID, int(online), back, ss.ConnID)
}
for _, offline := range ss.Offline {
ws.webhookAfterUserOffline(ctx, &ws.msgGatewayConfig.WebhooksConfig.AfterUserOffline, ss.UserID, int(offline), ss.ConnID)
}
}
}

for i := 0; i < concurrent; i++ {
Expand Down

0 comments on commit f6133dd

Please sign in to comment.