Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a6c673d8
Commit
a6c673d8
authored
Aug 12, 2021
by
Eugenia Grieff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing specs
parent
ce963d21
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
lib/gitlab/email/handler/reply_processing.rb
lib/gitlab/email/handler/reply_processing.rb
+4
-3
lib/gitlab/email/reply_parser.rb
lib/gitlab/email/reply_parser.rb
+2
-8
No files found.
lib/gitlab/email/handler/reply_processing.rb
View file @
a6c673d8
...
...
@@ -43,11 +43,12 @@ module Gitlab
message
,
stripped_text
=
ReplyParser
.
new
(
mail
,
**
kwargs
).
execute
message
=
message
.
strip
message_with_attachments
=
add_attachments
(
message
)
# Support bot is specifically forbidden from using slash commands.
message
=
strip_quick_actions
(
message
)
message
=
append_reply
(
message
,
stripped_text
)
if
kwargs
[
:append_reply
]
message
=
strip_quick_actions
(
message
_with_attachments
)
return
message
unless
kwargs
[
:append_reply
]
a
dd_attachments
(
message
)
a
ppend_reply
(
message
,
stripped_text
)
end
def
add_attachments
(
reply
)
...
...
lib/gitlab/email/reply_parser.rb
View file @
a6c673d8
...
...
@@ -28,8 +28,9 @@ module Gitlab
return
""
if
body
.
lines
.
all?
{
|
l
|
l
.
strip
.
empty?
||
l
.
start_with?
(
'>'
)
}
encoded_body
=
body
.
force_encoding
(
encoding
).
encode
(
"UTF-8"
)
return
encoded_body
unless
@append_reply
@append_reply
?
[
encoded_body
,
stripped_text
]
:
encoded_body
[
encoded_body
,
stripped_text
.
force_encoding
(
encoding
).
encode
(
"UTF-8"
)]
end
private
...
...
@@ -70,13 +71,6 @@ module Gitlab
rescue
StandardError
nil
end
# def trim_reply(text, append_trimmed_reply: false)
# trimmed_body, stripped_text = EmailReplyTrimmer.trim(text, append_trimmed_reply)
# return trimmed_body if trimmed_body.blank? || stripped_text.blank?
# trimmed_body + "\n\n<details><summary>...</summary>\n\n#{stripped_text}\n\n</details>"
# end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment