--- a/src/pyams_notify_ws/subscribe.py Wed Jun 26 11:13:45 2019 +0200
+++ b/src/pyams_notify_ws/subscribe.py Wed Jun 26 18:58:19 2019 +0200
@@ -35,8 +35,9 @@
subscription) for which we subscribe for a list of events types
"""
- def __init__(self, principal):
+ def __init__(self, principal, host):
self.principal = principal
+ self.host = host
self.contexts = {}
def update_contexts(self, new_contexts):
@@ -81,7 +82,7 @@
async with users_lock:
subscription = users.get(self.ws)
if subscription is None:
- subscription = WebsocketSubscription(principal)
+ subscription = WebsocketSubscription(principal, message.get('host'))
subscription.update_contexts(message.get('context'))
users[self.ws] = subscription