Module: Integrations::Base::HangoutsChat
- Extended by:
- ActiveSupport::Concern
- Includes:
- ChatNotification
- Included in:
- HangoutsChat
- Defined in:
- app/models/concerns/integrations/base/hangouts_chat.rb
Constant Summary collapse
- REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD =
Enum value of the messageReplyOption query parameter indicates that messages should be created as replies to the specified threads if possible and start new threads otherwise developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#messagereplyoption
'REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD'
Constants included from ChatNotification
ChatNotification::EVENT_CHANNEL, ChatNotification::GROUP_ONLY_SUPPORTED_EVENTS, ChatNotification::LABEL_NOTIFICATION_BEHAVIOURS, ChatNotification::SECRET_MASK, ChatNotification::SUPPORTED_EVENTS, ChatNotification::SUPPORTED_EVENTS_FOR_LABEL_FILTER
Constants included from NotificationPipelineStatusSelection
NotificationPipelineStatusSelection::FIELD
Instance Method Summary collapse
- #default_channel_placeholder ⇒ Object
- #format_attachment_title(attachment) ⇒ Object
- #parse_simple_text_message(message) ⇒ Object
-
#parse_thread_key(message) ⇒ Object
Returns an appropriate key for threading messages in google chat.
Methods included from ChatNotification
#api_field_names, #channel_limit_per_event, #confidential_issue_channel, #confidential_note_channel, #configurable_channels?, #configurable_events, #event_channel_names, #event_channel_value, #execute, #fields, #form_fields, #initialize_properties, #mask_configurable_channels?, #sections, #webhook_help
Methods included from Gitlab::Utils::Override
#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!
Methods included from NotificationPipelineStatusSelection
Methods included from NotificationBranchSelection
Instance Method Details
#default_channel_placeholder ⇒ Object
86 |
# File 'app/models/concerns/integrations/base/hangouts_chat.rb', line 86 def default_channel_placeholder; end |
#format_attachment_title(attachment) ⇒ Object
117 118 119 120 121 |
# File 'app/models/concerns/integrations/base/hangouts_chat.rb', line 117 def () return [:title] unless [:title_link] "<#{[:title_link]}|#{[:title]}>" end |
#parse_simple_text_message(message) ⇒ Object
106 107 108 109 110 111 112 113 114 115 |
# File 'app/models/concerns/integrations/base/hangouts_chat.rb', line 106 def () header = .pretext return header if ..empty? = ..first title = () body = [:text] [header, title, body].compact.join("\n") end |
#parse_thread_key(message) ⇒ Object
Returns an appropriate key for threading messages in google chat
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'app/models/concerns/integrations/base/hangouts_chat.rb', line 89 def parse_thread_key() case when Integrations::ChatMessage::NoteMessage .target when Integrations::ChatMessage::IssueMessage "issue #{.project_name}#{Issue.reference_prefix}#{.issue_iid}" when Integrations::ChatMessage::MergeMessage "merge request #{.project_name}#{MergeRequest.reference_prefix}#{.merge_request_iid}" when Integrations::ChatMessage::PushMessage "push #{.project_name}_#{.ref}" when Integrations::ChatMessage::PipelineMessage "pipeline #{.pipeline_id}" when Integrations::ChatMessage::WikiPageMessage "wiki_page #{.wiki_page_url}" end end |