1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-12-01 05:43:04 +00:00

Consistently treat tinyint(1) fields in message database as booleans (#2380)

* Update mysql2 query call to cast booleans

* Treat messages:held field as boolean

* Treat messages:inspected field as boolean

* Treat messages:spam field as boolean

* Treat messages:threat field as boolean

* Treat messages:bounce field as boolean

* Treat messages:received_with_ssl field as boolean

* Treat deliveries:sent_with_ssl field as boolean
هذا الالتزام موجود في:
Charlie Smurthwaite
2023-03-22 13:49:48 +00:00
ملتزم من قبل GitHub
الأصل 87e9b3e346
التزام 1e3622c49a
17 ملفات معدلة مع 38 إضافات و42 حذوفات

عرض الملف

@@ -3,7 +3,7 @@ structure :delivery do
basic :status
basic :details
basic :output, value: proc { o.output&.strip }
basic :sent_with_ssl, value: proc { o.sent_with_ssl == 1 }
basic :sent_with_ssl, value: proc { o.sent_with_ssl }
basic :log_id
basic :time, value: proc { o.time&.to_f }
basic :timestamp, value: proc { o.timestamp.to_f }

عرض الملف

@@ -6,7 +6,7 @@ structure :message do
{
status: o.status,
last_delivery_attempt: o.last_delivery_attempt ? o.last_delivery_attempt.to_f : nil,
held: o.held == 1,
held: o.held,
hold_expiry: o.hold_expiry ? o.hold_expiry.to_f : nil
}
end
@@ -29,10 +29,10 @@ structure :message do
expansion(:inspection) do
{
inspected: o.inspected == 1,
spam: o.spam == 1,
inspected: o.inspected,
spam: o.spam,
spam_score: o.spam_score.to_f,
threat: o.threat == 1,
threat: o.threat,
threat_details: o.threat_details
}
end