brainiac-fizzy 0.0.15 → 0.0.16
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ed1ef3ae4c3db228a9a98a796579e7450e25fad4e19fa5ce075777e677342cc
|
|
4
|
+
data.tar.gz: 9e5ceac2510d64194bc498850871ca8105aeea24b742e9930ede13c761928f50
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73f14f9e28f8eaba2558fac32e14116d0255fdb513cd2ba13753f1e5babe9a311807620832b75cd4b46282473e0603a1127a38483f18034177c0d983a84b5146
|
|
7
|
+
data.tar.gz: d45acdf7a664c1585b262230a0b1cf70eff969699fc80c270193ccedf0d902ed7876fc6d3eb353acf4768217bd88babced1f10db835b6aa7e13edde62b57b27c
|
|
@@ -54,7 +54,7 @@ module Brainiac
|
|
|
54
54
|
comments = JSON.parse(output)["data"] || []
|
|
55
55
|
agent_display = agent_display_name(agent_name)
|
|
56
56
|
|
|
57
|
-
agent_comments = comments.select { |c| c
|
|
57
|
+
agent_comments = comments.select { |c| c.dig("creator", "name")&.downcase == agent_display.downcase }
|
|
58
58
|
return agent_comments.any? unless since
|
|
59
59
|
|
|
60
60
|
buffered_since = since - CLOCK_SKEW_BUFFER
|
|
@@ -66,7 +66,7 @@ module Brainiac
|
|
|
66
66
|
comments.last(15).map do |c|
|
|
67
67
|
body = c.dig("body", "plain_text") || ""
|
|
68
68
|
body = "#{body[0..500]}..." if body.length > 500
|
|
69
|
-
"**#{c
|
|
69
|
+
"**#{c.dig("creator", "name")}** (#{c["id"]}):\n#{body}"
|
|
70
70
|
end.join("\n\n---\n\n")
|
|
71
71
|
rescue StandardError => e
|
|
72
72
|
LOG.warn "[Fizzy] Could not fetch comments for card ##{card_number}: #{e.message}" if defined?(LOG)
|
|
@@ -82,7 +82,7 @@ module Brainiac
|
|
|
82
82
|
return nil if comments.empty?
|
|
83
83
|
|
|
84
84
|
comments.last(5).map do |c|
|
|
85
|
-
creator = c
|
|
85
|
+
creator = c.dig("creator", "name") || "unknown"
|
|
86
86
|
body = (c.dig("body", "plain_text") || "").lines.first(3).join.strip
|
|
87
87
|
body = "#{body[0..200]}..." if body.length > 200
|
|
88
88
|
"#{creator}: #{body}"
|
|
@@ -112,7 +112,7 @@ module Brainiac
|
|
|
112
112
|
|
|
113
113
|
# Find the most recent agent comment, scoped to this session if `since` is provided.
|
|
114
114
|
# Subtracts 30s buffer from `since` to account for clock skew between local server and Fizzy API.
|
|
115
|
-
agent_comments = comments.select { |c| c
|
|
115
|
+
agent_comments = comments.select { |c| c.dig("creator", "name")&.downcase == agent_display.downcase }
|
|
116
116
|
if since
|
|
117
117
|
buffered_since = since - 30
|
|
118
118
|
agent_comments = agent_comments.select do |c|
|