diff --git a/subscribe/auth_subscriber_handlers.go b/subscribe/auth_subscriber_handlers.go index 44a4f62..7f34da7 100644 --- a/subscribe/auth_subscriber_handlers.go +++ b/subscribe/auth_subscriber_handlers.go @@ -21,10 +21,10 @@ type authSubscriberHandlers struct { ctx context.Context } -func (h *authSubscriberHandlers) OnSubscribe(payload string) { - uid := "kdkdkd" - channel := "auth" - soc := server.GetSocket(channel, uid) - - soc.Write([]byte(payload)) +func (h *authSubscriberHandlers) OnSubscribe(channel string, message ofs.SubscribeMessage) { + for _, uid := range message.Targets { + if soc := server.GetSocket(channel, uid); nil != soc { + soc.Write(message.Message) + } + } } diff --git a/subscribe/probe_subscriber_handlers.go b/subscribe/probe_subscriber_handlers.go index 722487e..34ae792 100644 --- a/subscribe/probe_subscriber_handlers.go +++ b/subscribe/probe_subscriber_handlers.go @@ -21,10 +21,10 @@ type probeSubscriberHandlers struct { ctx context.Context } -func (h *probeSubscriberHandlers) OnSubscribe(payload string) { - uid := "kdkdkd" - channel := "auth" - soc := server.GetSocket(channel, uid) - - soc.Write([]byte(payload)) +func (h *probeSubscriberHandlers) OnSubscribe(channel string, message ofs.SubscribeMessage) { + for _, uid := range message.Targets { + if soc := server.GetSocket(channel, uid); nil != soc { + soc.Write(message.Message) + } + } }