CQHTTP 0.3.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1af39bae6b5ce49f4525cb37041f90a35f685833
4
- data.tar.gz: b4c17f35245594f7c576a79710c14495af48df95
3
+ metadata.gz: 0a72b3a08e949b279931f027bdd9cf7e70f59c0b
4
+ data.tar.gz: 910bb53c5d090c941f2b93504aa508124b2d5d95
5
5
  SHA512:
6
- metadata.gz: 66b73f44ef7f147a2811bb324cfa427e5f9ac941337c3ed705e97b5e8612ce3a36198060f6db4c76efa0297e3d349642636aeb3fb7f4132c6b0ce8cc650b6ceb
7
- data.tar.gz: fb11483346c7dff8a5b2fc0170d4e33bd2c336ec87c9b3f2957376d960acdf47e27993ce59105e2a8bbfccff54c38c32c4c29b140156659e76e2c42daa066aeb
6
+ metadata.gz: 43909c20b0a2acfc6af5b6171c1e9c04117012ca3310378bfe738a6ce7c9b4e7dcb6f2d5f69542bb2b9aa67596d62fe1045fa01313714406a4a9330c651e0e20
7
+ data.tar.gz: 051b67f03463684616e8a8de76d1c6365f07fbc490f3c313bcc95f05a9391bb52db9acc6481c2066131cca86998c7c060c9030174087f5aa80e48e423b355077
data/exe/cqhttp-dbus CHANGED
@@ -6,7 +6,14 @@ Thread.abort_on_exception = true
6
6
 
7
7
  # DBus
8
8
  class CQHTTP2DBus < DBus::Object
9
+ def initialize(*args)
10
+ @cqhttp = CQHTTP::API.new
11
+ super
12
+ end
9
13
  dbus_interface 'org.dastudio.cqhttp' do
14
+ dbus_method :call, 'in func:s, in args:s' do |func, args|
15
+ @cqhttp.method_missing func.to_sym, JSON.parse(args, symbolize_names: true)
16
+ end
10
17
  dbus_signal :message, 'message_type:s, json:s'
11
18
  dbus_signal :event, 'event:s, json:s'
12
19
  dbus_signal :friend_request, 'json:s'
data/lib/CQHTTP/api.rb CHANGED
@@ -37,7 +37,7 @@ module CQHTTP
37
37
  def gen_args(name, user_args)
38
38
  args = @func_list[name.to_sym]
39
39
  return {} if args == {}
40
- return hash_to_args(args, user) if user_args[0].class == {}.class
40
+ return hash_to_args(args, user_args) if user_args[0].class == {}.class
41
41
  array_to_args(args, user_args)
42
42
  end
43
43
 
@@ -1,3 +1,3 @@
1
1
  module CQHTTP
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: CQHTTP
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 71e6fd52