lita-activedirectory 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lita/handlers/activedirectory.rb +25 -10
- data/lita-activedirectory.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10c750c82f5bd471e2cecfcc6f8d95adb02ebbca
|
4
|
+
data.tar.gz: 66fe58aa68a7361b576e7e12c52f8fac9f376514
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f68ec0cab9eb376ec2fe25c9d836cc1a2e9bee63c065f87c5e2a1b013cceddf41c26272af8aee013f384859c66e6c6a47a83d78734be80ccba5b95333148598
|
7
|
+
data.tar.gz: c376e44cc3947d4a0a9285dc83bb604039c8f476153a1e988118a512b93ce5399a15447d0fb1879be4d3d01b3c225b9f64fbe1b546c0773fc809b747c0479381
|
@@ -31,8 +31,21 @@ module Lita
|
|
31
31
|
handle_user_query(response, user, user_query(user))
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
35
|
-
|
34
|
+
def unlock(response)
|
35
|
+
user = response.matches[0][1]
|
36
|
+
response.reply_with_mention(t('replies.unlock.working'))
|
37
|
+
user_result = user_query(user)
|
38
|
+
if user_result
|
39
|
+
handle_unlock_query(response, user, unlock_user(user))
|
40
|
+
else
|
41
|
+
handle_user_query(response, user, user_result)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def handle_user_query(response, user, result)
|
48
|
+
case result
|
36
49
|
when true
|
37
50
|
response.reply_with_mention(
|
38
51
|
t('replies.user_locked?.locked', user: user)
|
@@ -48,14 +61,16 @@ module Lita
|
|
48
61
|
end
|
49
62
|
end
|
50
63
|
|
51
|
-
def
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
64
|
+
def handle_unlock_query(response, user, result)
|
65
|
+
case result
|
66
|
+
when true
|
67
|
+
response.reply_with_mention(
|
68
|
+
t('replies.unlock.success', user: user)
|
69
|
+
)
|
70
|
+
when false
|
71
|
+
response.reply_with_mention(
|
72
|
+
t('replies.unlock.fail', user: user)
|
73
|
+
)
|
59
74
|
end
|
60
75
|
end
|
61
76
|
|