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

chore: remove non-breaking spaces from comments

هذا الالتزام موجود في:
Adam Cooke
2024-02-19 22:37:56 +00:00
ملتزم من قبل Adam Cooke
الأصل b4016f6b49
التزام 27b7ced3bc
5 ملفات معدلة مع 25 إضافات و25 حذوفات

عرض الملف

@@ -128,7 +128,7 @@ class Route < ApplicationRecord
#
# This message will create a suitable number of message objects for messages that
#  are destined for this route. It receives a block which can set the message content
# are destined for this route. It receives a block which can set the message content
# but most information is specified already.
#
# Returns an array of created messages.

عرض الملف

@@ -35,7 +35,7 @@ module Postal
result.output = response[:body].to_s[0, 500].strip
end
if response[:code] >= 200 && response[:code] < 300
#  This is considered a success
# This is considered a success
result.type = "Sent"
elsif response[:code] >= 500 && response[:code] < 600
# This is temporary. They might fix their server so it should soft fail.

عرض الملف

@@ -59,8 +59,8 @@ module Postal
end
#
#  Create a new message with the given attributes. This won't be saved to the database
#  until it has been 'save'd.
# Create a new message with the given attributes. This won't be saved to the database
# until it has been 'save'd.
#
def new_message(attributes = {})
Message.new(self, attributes)
@@ -74,35 +74,35 @@ module Postal
end
#
#  Return the live stats instance
# Return the live stats instance
#
def live_stats
@live_stats ||= LiveStats.new(self)
end
#
#  Return the statistics instance
# Return the statistics instance
#
def statistics
@statistics ||= Statistics.new(self)
end
#
#  Return the provisioner instance
# Return the provisioner instance
#
def provisioner
@provisioner ||= Provisioner.new(self)
end
#
#  Return the provisioner instance
# Return the provisioner instance
#
def suppression_list
@suppression_list ||= SuppressionList.new(self)
end
#
#  Return the provisioner instance
# Return the provisioner instance
#
def webhooks
@webhooks ||= Webhooks.new(self)
@@ -183,7 +183,7 @@ module Postal
end
#
#  A paginated version of select
# A paginated version of select
#
def select_with_pagination(table, page, options = {})
page = page.to_i
@@ -253,7 +253,7 @@ module Postal
#
# Deletes a in the database. Accepts a table name, and some options which
#  are shown below:
# are shown below:
#
# :where => The condition to apply to the query
#
@@ -269,7 +269,7 @@ module Postal
end
#
#  Return the correct database name
# Return the correct database name
#
def database_name
@database_name ||= "#{Postal.config.message_db.prefix}-server-#{@server_id}"

عرض الملف

@@ -103,7 +103,7 @@ module Postal
end
#
#  Return the time that the last delivery was attempted
# Return the time that the last delivery was attempted
#
def last_delivery_attempt
@last_delivery_attempt ||= @attributes["last_delivery_attempt"] ? Time.zone.at(@attributes["last_delivery_attempt"]) : nil
@@ -172,14 +172,14 @@ module Postal
end
#
#  Return all activity entries
# Return all activity entries
#
def activity_entries
@activity_entries ||= (deliveries + clicks + loads).sort_by(&:timestamp)
end
#
#  Provide access to set and get acceptable attributes
# Provide access to set and get acceptable attributes
#
def method_missing(name, value = nil, &block)
if @attributes.key?(name.to_s)
@@ -202,7 +202,7 @@ module Postal
end
#
#  Save this message
# Save this message
#
def save(queue_on_create: true)
save_raw_message
@@ -223,7 +223,7 @@ module Postal
end
#
#  Delete the message from the database
# Delete the message from the database
#
def delete
return unless persisted?
@@ -232,7 +232,7 @@ module Postal
end
#
#  Return the headers
# Return the headers
#
def raw_headers
if raw_table
@@ -243,7 +243,7 @@ module Postal
end
#
#  Return the full raw message body for this message.
# Return the full raw message body for this message.
#
def raw_body
if raw_table
@@ -303,7 +303,7 @@ module Postal
end
#
#  Return the HTML body for this message
# Return the HTML body for this message
#
def html_body
mail&.html_body
@@ -484,7 +484,7 @@ module Postal
end
#
#  Create a new link
# Create a new link
#
def create_link(url)
hash = Digest::SHA1.hexdigest(url.to_s)
@@ -494,7 +494,7 @@ module Postal
end
#
#  Return a message object that this message is a reply to
# Return a message object that this message is a reply to
#
def original_messages
return nil unless bounce
@@ -531,7 +531,7 @@ module Postal
end
#
#  Return all spam checks for this message
# Return all spam checks for this message
#
def spam_checks
@spam_checks ||= database.select(:spam_checks, where: { message_id: id })
@@ -552,7 +552,7 @@ module Postal
def parse_content
parse_result = Postal::MessageParser.new(self)
if parse_result.actioned?
#  Somethign was changed, update the raw message
# Somethign was changed, update the raw message
@database.update(raw_table, { data: parse_result.new_body }, where: { id: raw_body_id })
@database.update(raw_table, { data: parse_result.new_headers }, where: { id: raw_headers_id })
@raw = parse_result.new_body

عرض الملف

@@ -127,7 +127,7 @@ module Postal
end
#
#  Remove messages from the messages table that are too old to retain
# Remove messages from the messages table that are too old to retain
#
def remove_messages(max_age = 60)
time = (Time.now.utc.to_date - max_age.days).to_time.end_of_day