|
@@ -117,9 +117,15 @@ func (h *Hub) remotelyEvent() {
|
|
|
}
|
|
|
|
|
|
func (h *Hub) OnPublishConnect(ctx context.Context, client *Client) error {
|
|
|
- return h.rdb.Publish(ctx, connectChannelEvent, client.UserId).Err()
|
|
|
+ if !client.isRemotely {
|
|
|
+ return h.rdb.Publish(ctx, connectChannelEvent, client.UserId).Err()
|
|
|
+ }
|
|
|
+ return nil
|
|
|
}
|
|
|
|
|
|
func (h *Hub) OnPublishDisconnect(ctx context.Context, client *Client) error {
|
|
|
- return h.rdb.Publish(ctx, disconnectChannelEvent, client.UserId).Err()
|
|
|
+ if !client.isRemotely {
|
|
|
+ return h.rdb.Publish(ctx, disconnectChannelEvent, client.UserId).Err()
|
|
|
+ }
|
|
|
+ return nil
|
|
|
}
|