matrix_qq 0.2.0 → 0.2.1

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: 89aa374abc6540dafae322674f039358f7283f25
4
- data.tar.gz: 5d989ddef672eb4bc115f3189c8f8b3b603ebede
3
+ metadata.gz: a87444b9fff9f46cfe1d8dea2ffff5512ad4ee88
4
+ data.tar.gz: 6d5287af230d319461f80320ef0414e08375bbba
5
5
  SHA512:
6
- metadata.gz: 26529dbe8be450b79ed115de061d70878defe5154c78c773ac379b17ef405e8c9fdf4cebfc459b7e6aeea76341bbff2113e13970473bb74de8858a5dde5b7418
7
- data.tar.gz: 854dc52408f8d2596f303096735b0ab6e2b55e68c4c484401861459cc81df6f2b021525648d4a580be5983b42735db2917b63c77e5e042e00f43b9b3625458cf
6
+ metadata.gz: 835685f46ee11bc834ca28f8ff3c73cec1d1aca9d39a794405f75ac5b2ab715683dfb1f5a8702d8484fb165f7db60a4edc737f2ae1fc0dcbb01d7513fceb6eaa
7
+ data.tar.gz: 9c4db86f440af128ba0d3ba03eecd9905eb84967eeb7144415c5b5dfcf9e36110dd97261d237c74ac86d109755e2f81c479116b768f110cd0bdfafe16927ea5d
data/CHANGELOG.yaml CHANGED
@@ -1,4 +1,7 @@
1
1
  # Notice: Incompatible items start with `!`
2
+ 0.2.1:
3
+ Fix:
4
+ - Lock ignore list now
2
5
  0.2.0:
3
6
  Change:
4
7
  - ! config file add `.rb`
@@ -42,7 +42,9 @@ module MatrixQQ
42
42
  end
43
43
 
44
44
  def exist(event_id)
45
- MatrixQQ::Matrix::Send.ignore.delete(event_id)
45
+ MatrixQQ::Matrix::Send.ignore_lock.synchronize do
46
+ MatrixQQ::Matrix::Send.ignore.delete(event_id)
47
+ end
46
48
  end
47
49
  end # Forward
48
50
 
@@ -2,15 +2,18 @@ module MatrixQQ
2
2
  class Matrix
3
3
  module Send
4
4
  class << self
5
- attr_accessor :ignore
5
+ attr_accessor :ignore, :ignore_lock
6
6
  end
7
7
  self.ignore = []
8
+ self.ignore_lock = Mutex.new
8
9
 
9
10
  def self.raw(dbus, room_id, event_type, body)
10
- txn_id = SecureRandom.hex(32)
11
- puts "send #{body}" if $VERBOSE
12
- res = dbus.put "/rooms/#{room_id}/send/#{event_type}/#{txn_id}", body
13
- ignore << (res['event_id'])
11
+ ignore_lock.synchronize do
12
+ txn_id = SecureRandom.hex(32)
13
+ puts "send #{body}" if $VERBOSE
14
+ res = dbus.put "/rooms/#{room_id}/send/#{event_type}/#{txn_id}", body
15
+ ignore << (res['event_id'])
16
+ end
14
17
  end
15
18
 
16
19
  def self.text(dbus, room_id, message)
@@ -1,3 +1,3 @@
1
1
  module MatrixQQ
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matrix_qq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 71e6fd52
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-28 00:00:00.000000000 Z
11
+ date: 2017-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler