Merge branch 'feat/voice-as-twilio-capability' into feat/voice-call-model-wiring
This commit is contained in:
@@ -41,7 +41,7 @@ class Email::BaseBuilder
|
||||
end
|
||||
|
||||
def business_name
|
||||
inbox.business_name || inbox.sanitized_name
|
||||
inbox.sanitized_business_name
|
||||
end
|
||||
|
||||
def account_support_email
|
||||
|
||||
@@ -125,7 +125,7 @@ export default {
|
||||
set(priorityItem) {
|
||||
const conversationId = this.currentChat.id;
|
||||
const oldValue = this.currentChat?.priority;
|
||||
const priority = priorityItem ? priorityItem.id : null;
|
||||
const priority = priorityItem.id;
|
||||
|
||||
this.$store.dispatch('setCurrentChatPriority', {
|
||||
priority,
|
||||
@@ -203,7 +203,9 @@ export default {
|
||||
this.assignedPriority &&
|
||||
this.assignedPriority.id === selectedPriorityItem.id;
|
||||
|
||||
this.assignedPriority = isSamePriority ? null : selectedPriorityItem;
|
||||
this.assignedPriority = isSamePriority
|
||||
? this.priorityOptions[0]
|
||||
: selectedPriorityItem;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -105,7 +105,7 @@ class ConversationReplyMailer < ApplicationMailer
|
||||
end
|
||||
|
||||
def business_name
|
||||
@inbox.business_name || @inbox.sanitized_name
|
||||
@inbox.sanitized_business_name
|
||||
end
|
||||
|
||||
def from_email
|
||||
|
||||
+13
-2
@@ -102,7 +102,7 @@ class Inbox < ApplicationRecord
|
||||
|
||||
# Sanitizes inbox name for balanced email provider compatibility
|
||||
# ALLOWS: /'._- and Unicode letters/numbers/emojis
|
||||
# REMOVES: Forbidden chars (\<>@") + spam-trigger symbols (!#$%&*+=?^`{|}~)
|
||||
# REMOVES: Forbidden chars (\<>@"()) + spam-trigger symbols (!#$%&*+=?^`{|}~)
|
||||
def sanitized_name
|
||||
return default_name_for_blank_name if name.blank?
|
||||
|
||||
@@ -110,6 +110,10 @@ class Inbox < ApplicationRecord
|
||||
sanitized.blank? && email? ? display_name_from_email : sanitized
|
||||
end
|
||||
|
||||
def sanitized_business_name
|
||||
sanitize_raw_name(business_name) || sanitized_name
|
||||
end
|
||||
|
||||
def sms?
|
||||
channel_type == 'Channel::Sms'
|
||||
end
|
||||
@@ -209,8 +213,15 @@ class Inbox < ApplicationRecord
|
||||
email? ? display_name_from_email : ''
|
||||
end
|
||||
|
||||
def sanitize_raw_name(raw)
|
||||
return nil if raw.blank?
|
||||
|
||||
result = apply_sanitization_rules(raw)
|
||||
result.presence
|
||||
end
|
||||
|
||||
def apply_sanitization_rules(name)
|
||||
name.gsub(/[\\<>@"!#$%&*+=?^`{|}~:;]/, '') # Remove forbidden chars
|
||||
name.gsub(/[\\<>@"!#$%&*+=?^`{|}~:;()]/, '') # Remove forbidden chars
|
||||
.gsub(/[\x00-\x1F\x7F]/, ' ') # Replace control chars with spaces
|
||||
.gsub(/\A[[:punct:]]+|[[:punct:]]+\z/, '') # Remove leading/trailing punctuation
|
||||
.gsub(/\s+/, ' ') # Normalize spaces
|
||||
|
||||
Reference in New Issue
Block a user