mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Importer for nabble
This commit is contained in:
parent
3677c56267
commit
ab50d039bb
2 changed files with 150 additions and 1 deletions
|
@ -24,8 +24,9 @@ module Email
|
|||
|
||||
attr_reader :body, :email_log
|
||||
|
||||
def initialize(raw)
|
||||
def initialize(raw, opts=nil)
|
||||
@raw = raw
|
||||
@opts = opts || {}
|
||||
end
|
||||
|
||||
def process
|
||||
|
@ -135,6 +136,8 @@ module Email
|
|||
body = fix_charset message
|
||||
end
|
||||
|
||||
return body if @opts[:skip_sanity_check]
|
||||
|
||||
# Certain trigger phrases that means we didn't parse correctly
|
||||
if body =~ /Content\-Type\:/ || body =~ /multipart\/alternative/ || body =~ /text\/plain/
|
||||
raise EmptyEmailError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue