ishapi 0.1.8.310 → 0.1.8.313

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: a249c1a6507a0e3898fb1a2cfe93150ec0173a98e936cfdefe70ff994877d0f5
4
- data.tar.gz: 64b1ac2193477f7762a16c52a34a75c5fc0d0b0de596f80c346df60e97feb8c9
3
+ metadata.gz: 27ef804c33667b1af333157ae29394edb630ad5675d10bfc794366b5808fa8ee
4
+ data.tar.gz: c45707889aa0d36e89ddc17b7a7f05b4f807ee727ec79022ec0d640a022e9da7
5
5
  SHA512:
6
- metadata.gz: 557cd50918c4918111b693b73b43b1fafc6bcf516685110f2d81f4144ea655022be2eb2f1125025fe963fc9bca1c66b6b2eb9478ab3a365506d08177dfecc750
7
- data.tar.gz: 9379e8fd188ebe42e3740dd9e47a1858fb0f576f79eaab77c217b87866a41799ed73688b73d458a07badce7cd1da525f84eb49e60b237fe658d8ae7d1335d86f
6
+ metadata.gz: d7ff73365ff2e5b7d7786565c04d5abfa2a5ab6aed43919787301995de921312104b47e225424670ad011115c231695a3e314f2a74061a3aff50803adab131bb
7
+ data.tar.gz: 23d3258dde36c66a970a7a280e605458bf7754356ef6c1509d561c361d1e77e1494479b66c7efa8471d8617901057181c029a23d5f6ff5cec32cb013d72a6ab4
@@ -11,7 +11,11 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
11
11
 
12
12
  =begin
13
13
 
14
- object_key = 'k96moravpgg4f976vusakqdaoki97u11i2i3c201'
14
+ ## Mongo::Error::MaxBSONSize: The document exceeds maximum allowed BSON object size after serialization (on 10.138.2.145)
15
+ object_key = 'k9n9qo03fii2in3ocj977nac0vj5djn07e110bg1'
16
+
17
+ ## Aws::S3::Errors::AccessDenied: Access Denied
18
+ object_key = '65599493689a51e44df5d9ad'
15
19
  MsgStub.where({ object_key: object_key }).delete
16
20
 
17
21
  stub = MsgStub.create!({ object_key: object_key })
@@ -67,7 +71,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
67
71
 
68
72
  @message = ::Office::EmailMessage.where( message_id: message_id ).first
69
73
  @message ||= ::Office::EmailMessage.create({
70
- raw: raw,
74
+ # raw: raw,
71
75
  email_conversation_id: conv.id,
72
76
 
73
77
  message_id: message_id,
@@ -113,46 +117,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
113
117
 
114
118
  ## Attachments
115
119
  the_mail.attachments.each do |att|
116
- content_type = att.content_type.split(';')[0]
117
- if content_type.include? 'image'
118
- photo = Photo.new({
119
- content_type: content_type,
120
- original_filename: att.content_type_parameters[:name],
121
- image_data: att.body.encoded,
122
- email_message_id: @message.id,
123
- })
124
- photo.decode_base64_image
125
- photo.save
126
- elsif att.filename
127
- filename = CGI.escape( att.filename )
128
-
129
- attachment = Office::EmailAttachment.new({
130
- content: att.body.decoded,
131
- content_type: att.content_type,
132
- email_message: @message,
133
- filename: filename,
134
- })
135
- begin
136
- attachment.save
137
- rescue Encoding::UndefinedConversionError
138
- @message.logs.push "Could not save an attachment"
139
- end
140
-
141
- sio = StringIO.new att.body.decoded
142
- File.open("/tmp/#{filename}", 'w:UTF-8:ASCII-8BIT') do |f|
143
- f.puts(sio.read)
144
- end
145
- asset3d = ::Gameui::Asset3d.new({
146
- object: File.open("/tmp/#{filename}"),
147
- email_message: @message,
148
- })
149
- if !asset3d.save
150
- @message.logs.push "Could not save an asset3d"
151
- end
152
-
153
- else
154
- @message.logs.push "Has an attachment with no filename?"
155
- end
120
+ @message.save_attachment( att )
156
121
  end
157
122
 
158
123
  if !@message.save
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.310
4
+ version: 0.1.8.313
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-19 00:00:00.000000000 Z
11
+ date: 2023-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails