cinch-identify 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +6 -4
  2. data/lib/cinch/plugins/identify.rb +11 -6
  3. metadata +4 -3
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Identify plugin
2
2
 
3
3
  This plugin allows Cinch to automatically identify with services.
4
- Currently, QuakeNet and all networks using NickServ are supported.
4
+ Currently, QuakeNet, KreyNet and all networks using NickServ are
5
+ supported.
5
6
 
6
7
  For QuakeNet, both the normal _auth_ and the more secure
7
8
  _challengeauth_ commands are supported.
@@ -35,7 +36,8 @@ None.
35
36
  ### :type
36
37
  The type of authentication. `:nickserv` for NickServ, `:quakenet` for
37
38
  the insecure _auth_ command on QuakeNet and `:secure_quakenet` or
38
- `:challengeauth` for the more secure _challengeauth_.
39
+ `:challengeauth` for the more secure _challengeauth_. `:kreynet` for
40
+ KreyNet.
39
41
 
40
42
  ### :username
41
43
  The username to use for authentication.
@@ -47,5 +49,5 @@ The password to use for authentication
47
49
  Check the install instructions for an example configuration.
48
50
 
49
51
  ## Warning
50
- Be warned that, when using the `:nickserv` or `:quakenet` types, the
51
- password will show up in the logs.
52
+ Be warned that, when using the `:nickserv`, `:quakenet` or `:kreynet`
53
+ types, the password will show up in the logs.
@@ -9,20 +9,21 @@ module Cinch
9
9
  def identify(m)
10
10
  case config[:type]
11
11
  when :quakenet
12
- @bot.debug "Identifying with Q"
12
+ debug "Identifying with Q"
13
13
  identify_quakenet
14
14
  when :secure_quakenet, :challengeauth
15
- @bot.debug "Identifying with Q, using CHALLENGEAUTH"
15
+ debug "Identifying with Q, using CHALLENGEAUTH"
16
16
  identify_secure_quakenet
17
17
  when :nickserv
18
- @bot.debug "Identifying with NickServ"
18
+ debug "Identifying with NickServ"
19
19
  identify_nickserv
20
+ when :kreynet
21
+ debug "Identifying with K on KreyNet"
22
+ identify_kreynet
20
23
  end
21
24
  end
22
25
 
23
- # TODO as soon as Cinch 1.2.0 is released, use match and
24
- # react_on instead
25
- listen_to :notice, method: :challengeauth
26
+ match(/^CHALLENGE (.+?) (.+)$/, use_prefix: false, use_suffix: false, reacting_on: :notice)
26
27
  def challengeauth(m)
27
28
  return unless m.user && m.user.nick == "Q"
28
29
  if match = m.message.match(/^CHALLENGE (.+?) (.+)$/)
@@ -50,6 +51,10 @@ module Cinch
50
51
  def identify_nickserv
51
52
  User("nickserv").send("identify %s %s" % [config[:username], config[:password]])
52
53
  end
54
+
55
+ def identify_kreynet
56
+ User("K!k@krey.net").send("LOGIN %s %s" % [config[:username], config[:password]])
57
+ end
53
58
  end
54
59
  end
55
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-identify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cinch
16
- requirement: &16915020 !ruby/object:Gem::Requirement
16
+ requirement: &23819320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,8 +21,9 @@ dependencies:
21
21
  version: 2.0.0.pre.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *16915020
24
+ version_requirements: *23819320
25
25
  description: A plugin allowing Cinch bots to automatically identify with services.
26
+ Supported are NickServ, QuakeNet and KreyNet.
26
27
  email:
27
28
  - dominikh@fork-bomb.org
28
29
  executables: []