lita-group-mention 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efbaf75891c9fffbcf0128ace58f236f95eac9ac
4
- data.tar.gz: fd7fdccc2b72a44b3f4e3b5004b1875123bc8c37
3
+ metadata.gz: b9ac329417c7e01f175785c789205c519fb892e6
4
+ data.tar.gz: 8d9e3288a0fb0b7e15468e91a016e50a865882db
5
5
  SHA512:
6
- metadata.gz: 2589abd6c7791bdb06bdfc475195b5bfdc51e56348d8196421d515abd66acdbbb02c8a502ccc395c9b472f33b38d451a6180cb79450c71b39c5d32ad038d8af8
7
- data.tar.gz: 8ff5b0abf568e029d8fdc52ba9f1f81395f3a7551ceefc89c493a7954c4c58d40774598f13053c42759e4dd1bb39c2b0a06aeb685654e568e7ff0bf796db48f6
6
+ metadata.gz: f07ed4e3a0c9f8492fad753902967f7d7c5124d9439a4903fd596ef742bcb44536685a309421f07f445f9079d02dad8222eb594958f01ebcac5f8d75ee878781
7
+ data.tar.gz: 45257a19b3a2897427a25d418b90d2abdefb036258d183b013da35afe6be0b6a93b35fd74ba5b90b54998820009c75eec35b6ac660776a9defaa8c83f8b7ae32
@@ -56,10 +56,7 @@ module Lita
56
56
  def group_mention(response) # rubocop:disable AbcSize
57
57
  return if response.message.body =~ /group\s+mention/
58
58
  groups = response.matches.flatten
59
-
60
- groups.each do |g|
61
- groups.delete(g) unless redis_groups.keys.include?(g)
62
- end
59
+ groups.reject! { |g| !redis_groups.keys.include?(g) }
63
60
  return if groups.empty?
64
61
 
65
62
  response.reply(t('mention.cc') + union_members(groups))
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-group-mention'
3
- spec.version = '1.0.1'
3
+ spec.version = '1.0.2'
4
4
  spec.authors = ['Ben House']
5
5
  spec.email = ['ben@benhouse.io']
6
6
  spec.description = 'cc a list of users when a group is @mentioned'
@@ -129,4 +129,11 @@ describe Lita::Handlers::GroupMention, lita_handler: true do
129
129
  )
130
130
  end
131
131
  end
132
+
133
+ context 'sending a message with multiple mentions of non-groups' do
134
+ it "doesn't respond with a cc" do
135
+ send_message('Hello @user1 @user2')
136
+ expect(replies.last).not_to match(/^cc/)
137
+ end
138
+ end
132
139
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-group-mention
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben House
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-08 00:00:00.000000000 Z
11
+ date: 2015-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita