lita-irc 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de1f70f11878872429eb02b0754350ab6b2bfd2c
4
- data.tar.gz: d59b4cb74b815344ed5f809e00b5294595311bfd
3
+ metadata.gz: 7f6bcd5ab576ecbe1570ede78cde8a1adf99d0ae
4
+ data.tar.gz: 9f47d348b44fd21011c85b6959d8b6d14b3b9cbe
5
5
  SHA512:
6
- metadata.gz: 91623d6b9f3e54387e30d2b2bcaf71dad9f951f41bf4217cfdf59cae85a09cfc59f24aa8a6578fae57f73adc4dca951e4093d3babff3e4b916223560a5500434
7
- data.tar.gz: 89784a002bccab8bacc807e48b1ba2138162e03184eb03c28adafa764b70a57e27338958c21168b2eb30af90409bc7588bb72fca78decd0e06cb9fdbbc97d271
6
+ metadata.gz: c73638cfc160a3f1271b1595dc580cd973bcd280d6db4807a741e0c870470169acb7c1841337b02eaf883d30a58a1a2f1ed9b9c9dd93df08b78a2245ee0605a0
7
+ data.tar.gz: 84d8135f94be890ae7a477e1f7deacd442f26b99d74a32406478c2663ce1dc88deddf408e04a9a80da1fdf5c53014ee19c83c79052a59c869c3100ea797612c6
@@ -26,12 +26,12 @@ module Lita
26
26
  end
27
27
 
28
28
  def send_messages(target, strings)
29
- if target.room
30
- channel = Cinch::Channel.new(target.room, cinch)
31
- strings.each { |s| channel.msg(s) }
32
- else
29
+ if target.private_message?
33
30
  user = Cinch::User.new(target.user.name, cinch)
34
31
  strings.each { |s| user.msg(s) }
32
+ else
33
+ channel = Cinch::Channel.new(target.room, cinch)
34
+ strings.each { |s| channel.msg(s) }
35
35
  end
36
36
  end
37
37
 
data/lita-irc.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-irc"
3
- spec.version = "1.2.2"
3
+ spec.version = "1.2.3"
4
4
  spec.authors = ["Jimmy Cuadra"]
5
5
  spec.email = ["jimmy@jimmycuadra.com"]
6
6
  spec.description = %q{An IRC adapter for Lita.}
@@ -59,7 +59,7 @@ describe Lita::Adapters::IRC, lita: true do
59
59
 
60
60
  describe "#send_messages" do
61
61
  it "sends messages to rooms" do
62
- source = double("Lita::Source", room: "#foo")
62
+ source = double("Lita::Source", room: "#foo", private_message?: false)
63
63
  channel = double("Cinch::Channel")
64
64
  allow(Cinch::Channel).to receive(:new).with(
65
65
  "#foo",
@@ -72,7 +72,7 @@ describe Lita::Adapters::IRC, lita: true do
72
72
 
73
73
  it "sends messages to users" do
74
74
  user = double("Lita::User", name: "Carl")
75
- source = double("Lita::Source", room: nil, user: user)
75
+ source = double("Lita::Source", user: user, private_message?: true)
76
76
  user = double("Cinch::User")
77
77
  allow(Cinch::User).to receive(:new).with(
78
78
  "Carl",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-irc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Cuadra