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.
- checksums.yaml +4 -4
- data/lib/websocket.rb +24 -20
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12cdd26d291399bb655e29df508ede911b5d6c64ad488015ee688834ced51b9e
|
|
4
|
+
data.tar.gz: f7a4895cb2dc54a955c19bc3733d48163ce1cf55a88796c368821eaa54837785
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@@onMentionDo[
|
|
37
|
-
|
|
38
|
-
@@onReactionDo[
|
|
39
|
-
|
|
40
|
-
@@onRenoteDo[
|
|
41
|
-
|
|
42
|
-
@@onQuoteDo[
|
|
43
|
-
|
|
44
|
-
@@onReplyDo[
|
|
45
|
-
|
|
46
|
-
@@onMentionOrReplyDo[
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@@onNotificationDo[
|
|
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
|