aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2016-04-04 18:48:39 +0100
committerGravatar jesopo2016-04-04 18:48:39 +0100
commit3c0a8562a939a8f962ce662a688854ac23d25e4c (patch)
treed4182edea57cdcba7361477489e084d92b8c6b5a /modules
parentadded permissions.py which contains code for identifying/registering/logoutin... (diff)
ironed out some little issues with permissions.py.
Diffstat (limited to 'modules')
-rw-r--r--modules/permissions.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/permissions.py b/modules/permissions.py
index 86757c84..f58348eb 100644
--- a/modules/permissions.py
+++ b/modules/permissions.py
@@ -17,7 +17,7 @@ class Module(object):
self._logout(event["user"])
def on_part(self, event):
- if len(event["user"].channels) == 0 and event["user"].identified:
+ if len(event["user"].channels) == 1 and event["user"].identified:
event["user"].send_notice("You no longer share any channels "
"with me so you have been signed out")
@@ -37,6 +37,10 @@ class Module(object):
user.identified = False
user.permissions = []
def identify(self, event):
+ if not event["user"].channels:
+ event["stderr"].write("You must share at least one channel "
+ "with me before you can identify")
+ return
if not event["user"].identified:
password = event["args_split"][0]
hash, salt = self._get_hash(event["user"])