ishapi 0.1.8.306 → 0.1.8.307

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: e6d7b34491e5a45933183a4f57ffaceca8ad582fded9d3e75435fd33589b18af
4
- data.tar.gz: 36680f3eebb3154959f50600d9f5b40fe2dc0679db03105c08fdd365c7301f78
3
+ metadata.gz: ddd9993a231d5fa7e5124886794d99afe3e8c5b101b3f38c93e86053ca57ba57
4
+ data.tar.gz: 6fcf6829d0dd86abeedef28fddc382dd1449a1aef91b081fc4468dbc2987b442
5
5
  SHA512:
6
- metadata.gz: 8e10c7d52eccd2578dbc67af5aa384916894e57d31619b9fa9e8892ffc78284e1277269826b23b0f2cd827c492b7965afe9169c68d69453a6eabe72a1f1122b9
7
- data.tar.gz: 2a1bd018123c3b4282b52c05aaa21b23d5788b54632573cf23f8288b622174658442feaa05a230b5a96194caa1ff519ad07c0a303d55683c106585b040294767
6
+ metadata.gz: e16e4c44484b581fac511854fa67efde229173288908ce45b6cb5e271ac0e890a66bfd6338a90919d0ddad6ebd637dc11b4be01cc9a22d0ef93ca4eb39d99ad5
7
+ data.tar.gz: 18061bb332133a4f4f4358d5aa35f05cbace58242ca234d3285e7ec2c1dc4e09fdadf020743156a20e29d3dbdd42580213948a7b6e648fafe5b06741ff3da836
@@ -11,7 +11,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
11
11
 
12
12
  =begin
13
13
 
14
- object_key = 'n0v5mg6q1t4fjjnfh8vj8a96t85rp9la2ud0gdg1'
14
+ object_key = 'fom5a97nif6j9urfp46sbchi33sks90e9kkrn181'
15
15
  MsgStub.where({ object_key: object_key }).delete
16
16
 
17
17
  stub = MsgStub.create!({ object_key: object_key })
@@ -50,9 +50,30 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
50
50
  subject = ::Msg.strip_emoji the_mail.subject
51
51
  subject ||= '(wco no subject)'
52
52
 
53
+
54
+ ## Conversation
55
+ if in_reply_to_id
56
+ in_reply_to_msg = ::Office::EmailMessage.where({ message_id: in_reply_to_id }).first
57
+ if !in_reply_to_msg
58
+ conv = ::Office::EmailConversation.find_or_create_by({
59
+ subject: subject,
60
+ })
61
+ in_reply_to_msg = ::Office::EmailMessage.find_or_create_by({
62
+ message_id: in_reply_to_id,
63
+ email_conversation_id: conv.id,
64
+ })
65
+ end
66
+ conv = in_reply_to_msg.email_conversation
67
+ else
68
+ conv = ::Office::EmailConversation.find_or_create_by({
69
+ subject: subject,
70
+ })
71
+ end
72
+
53
73
  @message = ::Office::EmailMessage.where( message_id: message_id ).first
54
74
  @message ||= ::Office::EmailMessage.create({
55
75
  raw: raw,
76
+ email_conversation_id: conv.id,
56
77
 
57
78
  message_id: message_id,
58
79
  in_reply_to_id: in_reply_to_id,
@@ -148,25 +169,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
148
169
  Lead.find_or_create_by( email: cc, m3_leadset_id: leadset.id )
149
170
  end
150
171
 
151
- ## Conversation
152
- if in_reply_to_id
153
- in_reply_to_msg = ::Office::EmailMessage.where({ message_id: in_reply_to_id }).first
154
- if !in_reply_to_msg
155
- conv = ::Office::EmailConversation.find_or_create_by({
156
- subject: @message.subject,
157
- })
158
- in_reply_to_msg = ::Office::EmailMessage.find_or_create_by({
159
- message_id: in_reply_to_id,
160
- email_conversation_id: conv.id,
161
- })
162
- end
163
- conv = in_reply_to_msg.email_conversation
164
- else
165
- conv = ::Office::EmailConversation.find_or_create_by({
166
- subject: @message.subject,
167
- })
168
- end
169
- @message.update_attributes({ email_conversation_id: conv.id })
172
+ # @message.update_attributes({ email_conversation_id: conv.id })
170
173
  conv.update_attributes({
171
174
  state: Conv::STATE_UNREAD,
172
175
  latest_at: the_mail.date || Time.now.to_datetime,
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.306
4
+ version: 0.1.8.307
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox