misskey 0.0.6 → 0.0.7

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/websocket.rb +24 -20
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d88e8be4843ee35669b4d1be0ccc11789483cdde2b99f2c59dca1b10e16a82f4
4
- data.tar.gz: d1089026ba9bd55cdf828bf1919f32940a6cde8b86547d27ab4bd1b454049b73
3
+ metadata.gz: 12cdd26d291399bb655e29df508ede911b5d6c64ad488015ee688834ced51b9e
4
+ data.tar.gz: f7a4895cb2dc54a955c19bc3733d48163ce1cf55a88796c368821eaa54837785
5
5
  SHA512:
6
- metadata.gz: bee05d0635b33c51d0aed68552c6b63eccfec3f36a755fd08aeb89c0bf53264f790603ec023abec1f0dd62fb03c4d6a9735889de82a251e0bd6032e1dbc91255
7
- data.tar.gz: 0a3130b5e2e69bd018fb41bff41c6ea88c585cc855d56958c68459f7569fff5d28a9813d838818d40017af9cd0b9c04e99e783f49f77981da58fd44484739bef
6
+ metadata.gz: fec3df8b6da6d4cfe385eaabdad2d2d477df6b7b01974a94095f0cc0acb95ceb76c5bf22606502635f604e9aab1f58a379cbe425cd752251f8ff995b77f26130
7
+ data.tar.gz: 021f47e613e88880b7ad058097c706cd0f12736832ec6d356f78dfadd3951ba1ed823cb318712580a6f73a6278984d1ee6f596314bc2186049327da6918b489a
data/lib/websocket.rb CHANGED
@@ -28,26 +28,30 @@ module WS
28
28
 
29
29
  case message["body"]["type"]
30
30
  when "notification"
31
- if Misskey.debug.debugging
32
- puts "The notification's note body type is: #{message["body"]["body"]["type"]}"
33
- end
34
-
35
- if @@onMentionDo[0] and message["body"]["body"]["type"] == "mention"
36
- @@onMentionDo[1].call message
37
- elsif @@onReactionDo[0] and message["body"]["body"]["type"] == "reaction"
38
- @@onReactionDo[1].call message
39
- elsif @@onRenoteDo[0] and message["body"]["body"]["type"] == "renote"
40
- @@onRenoteDo[1].call message
41
- elsif @@onQuoteDo[0] and message["body"]["body"]["type"] == "quote"
42
- @@onQuoteDo[1].call message
43
- elsif @@onReplyDo[0] and message["body"]["body"]["type"] == "reply"
44
- @@onReplyDo[1].call message
45
- elsif @@onMentionOrReplyDo[0] and /(reply)|(mention)/.match message["body"]["body"]["type"]
46
- @@onMentionOrReplyDo[1].call message
47
- end
48
-
49
- if @@onNotificationDo[0]
50
- @@onNotificationDo[1].call message
31
+ begin
32
+ if Misskey.debug.debugging
33
+ puts "The notification's note body type is: #{message["body"]["body"]["type"]}"
34
+ end
35
+
36
+ if @@onMentionDo[0] and message["body"]["body"]["type"] == "mention"
37
+ @@onMentionDo[1].call message
38
+ elsif @@onReactionDo[0] and message["body"]["body"]["type"] == "reaction"
39
+ @@onReactionDo[1].call message
40
+ elsif @@onRenoteDo[0] and message["body"]["body"]["type"] == "renote"
41
+ @@onRenoteDo[1].call message
42
+ elsif @@onQuoteDo[0] and message["body"]["body"]["type"] == "quote"
43
+ @@onQuoteDo[1].call message
44
+ elsif @@onReplyDo[0] and message["body"]["body"]["type"] == "reply"
45
+ @@onReplyDo[1].call message
46
+ elsif @@onMentionOrReplyDo[0] and /(reply)|(mention)/.match message["body"]["body"]["type"]
47
+ @@onMentionOrReplyDo[1].call message
48
+ end
49
+
50
+ if @@onNotificationDo[0]
51
+ @@onNotificationDo[1].call message
52
+ end
53
+ rescue => error
54
+ puts Rainbow("An error occurred in the websocket event: ").red + error.to_s
51
55
  end
52
56
  end
53
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: misskey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sky.Bit