aboutsummaryrefslogtreecommitdiffstats
path: root/alias_server/component.py
diff options
context:
space:
mode:
Diffstat (limited to 'alias_server/component.py')
-rw-r--r--alias_server/component.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/alias_server/component.py b/alias_server/component.py
index ae238ed..1770c20 100644
--- a/alias_server/component.py
+++ b/alias_server/component.py
@@ -33,22 +33,18 @@ class ObjectComponent(ComponentXMPP):
msg.reply("Thanks for sending\n{[body]}".format(msg)).send()
def presence_subscription(self, subscription):
+ userJID = subscription["from"].full
+ subscriber = User(subscription["from"].bare)
if subscription["type"] == "subscribe":
- userJID = subscription["from"].full
- if not self.userHandler.registered(userJID):
- self.userHandler.register(userJID)
+ if not subscriber.is_registered():
logger.info('registering user {}'.format(userJID))
subscription.reply().send()
self.send_presence(pto = userJID)
self.send_presence_subscription(pto = userJID, ptype = "subscribe")
if subscription["type"] == "unsubscribe":
- userJID = subscription["from"].full
- if self.userHandler.registered(userJID):
- self.userHandler.unregister(userJID)
+ if subscriber.is_registered:
+ subscriber.unregister()
logger.info('unregistering user {}'.format(userJID))
#def presence_probe(self, event):
# self.send_presence(pto = event["from"].full)
-
-
-