ishapi 0.1.8.307 → 0.1.8.309

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddd9993a231d5fa7e5124886794d99afe3e8c5b101b3f38c93e86053ca57ba57
4
- data.tar.gz: 6fcf6829d0dd86abeedef28fddc382dd1449a1aef91b081fc4468dbc2987b442
3
+ metadata.gz: bb2c27b0e76f833a8c226f0d3b8e2ddde4e79de43410a27d54b17fd7428bb2ea
4
+ data.tar.gz: bdfca7a6011021de3e65cbef27bfd89bd0149d249e0f500c8b8f03234126769b
5
5
  SHA512:
6
- metadata.gz: e16e4c44484b581fac511854fa67efde229173288908ce45b6cb5e271ac0e890a66bfd6338a90919d0ddad6ebd637dc11b4be01cc9a22d0ef93ca4eb39d99ad5
7
- data.tar.gz: 18061bb332133a4f4f4358d5aa35f05cbace58242ca234d3285e7ec2c1dc4e09fdadf020743156a20e29d3dbdd42580213948a7b6e648fafe5b06741ff3da836
6
+ metadata.gz: 9f5c7c049720e975ab0dd41b8704058065b97e1e0e0cdac3d251f92776d771404f4ff3f6897008f09c0b597348e3af0d715028ef98bc0f829074b6a7284bd082
7
+ data.tar.gz: 05b52de931750893643cd4a14ebcb6894111602e1f1eadbaa255a34cfbb8b003429837e6f91cf6340995cd815c6b83110c90bbd74b2a3bc92447ce9791fe6a9e
@@ -11,7 +11,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
11
11
 
12
12
  =begin
13
13
 
14
- object_key = 'fom5a97nif6j9urfp46sbchi33sks90e9kkrn181'
14
+ object_key = 'b7t9ns5iqood9edbng1qqh89f2cishcviv1l2ro1'
15
15
  MsgStub.where({ object_key: object_key }).delete
16
16
 
17
17
  stub = MsgStub.create!({ object_key: object_key })
@@ -41,14 +41,10 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
41
41
  message_id = the_mail.header['message-id'].decoded
42
42
  in_reply_to_id = the_mail.header['in-reply-to']&.to_s
43
43
  email_inbox_tag_id = WpTag.emailtag(WpTag::INBOX).id
44
-
45
- if !the_mail.to
46
- the_mail.to = [ 'NO-RECIPIENT' ]
47
- end
48
-
44
+ the_mail.to = [ 'NO-RECIPIENT' ] if !the_mail.to
49
45
 
50
46
  subject = ::Msg.strip_emoji the_mail.subject
51
- subject ||= '(wco no subject)'
47
+ subject ||= '(wco-no-subject)'
52
48
 
53
49
 
54
50
  ## Conversation
@@ -79,7 +75,6 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
79
75
  in_reply_to_id: in_reply_to_id,
80
76
 
81
77
  object_key: stub.object_key,
82
- # object_path: stub.object_path,
83
78
 
84
79
  subject: subject,
85
80
  date: the_mail.date,
@@ -92,8 +87,6 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
92
87
 
93
88
  cc: the_mail.cc ? the_mail.cc[0] : nil,
94
89
  ccs: the_mail.cc,
95
-
96
- # bccs: the_mail.bcc,
97
90
  })
98
91
  if !@message.persisted?
99
92
  throw "Could not create email_message: #{@message.errors.full_messages.join(', ')} ."
@@ -103,6 +96,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
103
96
  the_mail.parts.each do |part|
104
97
  @message.churn_subpart( part )
105
98
  end
99
+ @message.save
106
100
 
107
101
  if the_mail.parts.length == 0
108
102
  body = the_mail.body.decoded.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
@@ -115,6 +109,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
115
109
  else
116
110
  @message.logs.push "mail body of unknown type: #{the_mail.content_type}"
117
111
  end
112
+ @message.save
118
113
  end
119
114
 
120
115
  ## Attachments
@@ -159,6 +154,10 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
159
154
  end
160
155
  end
161
156
 
157
+ if !@message.save
158
+ puts! @message.errors.full_messages.join(", "), "Could not save @message"
159
+ end
160
+
162
161
  ## Leadset, Lead
163
162
  domain = @message.from.split('@')[1] rescue 'unknown.domain'
164
163
  leadset = Leadset.find_or_create_by( company_url: domain )
@@ -194,7 +193,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
194
193
 
195
194
  # || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
196
195
 
197
- puts! "applying filter #{filter} to conv #{conv}" if DEBUG
196
+ # puts! "applying filter #{filter} to conv #{conv}" if DEBUG
198
197
 
199
198
  @message.apply_filter( filter )
200
199
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.307
4
+ version: 0.1.8.309
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox