imperituroard 1.1.15 → 1.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b88a1a03fcc8ffa9b104d37fc0167bbe99b3ee9
4
- data.tar.gz: 991615ca54d1e743e64955b08fff8b45ff962f5d
3
+ metadata.gz: 015a5d3136b3e47eab433636dd7b9e0fc4b70fdb
4
+ data.tar.gz: 90d1189ffd4fdcb5a2458dda0752d5e0b10342c7
5
5
  SHA512:
6
- metadata.gz: 4fa2c2c4ca77e55e585cde7c0c03d3fc757b43e134691d672560ec22f6533d974882fa45364353dab46582013e75e134397059de936c217e7c572c4ed5c21ec8
7
- data.tar.gz: 9415cfc431b7be26a9fab465da942b6b9c1e46205c97d1a84361b2ec93538ae7a8744d697f68a36a25e3ef169808cd5e1428c1287ff64e61cce7f6bf5b2b154b
6
+ metadata.gz: e55cf9eafb144b4426c61ef65f72d715b8240195af65b173ec09d350a6dead6bff75a9487d8e519ff2ed7dd68047ebffa91f29c54595c37cf03cdd9e7be6a995
7
+ data.tar.gz: 6df5079662a650f243107f6bc4a22da04054097f4211c514833c349ace9d4312cec8c2c9df9b3f13f7b3f76f03c61ecdf4e074c81e349361a44cef246a32f233
@@ -341,8 +341,8 @@ class Mhub_2
341
341
  mhub_connector.get_send_message_2(params, ip_src, ip_real, ip_vip)
342
342
  end
343
343
 
344
- def get_send_message_mass(params, ip_src, ip_real, ip_vip, slice_number=100, time_pause_minutes=5)
345
- mhub_connector.get_send_message_mass_2(params, ip_src, ip_real, ip_vip, slice_number, time_pause_minutes)
344
+ def get_send_message_mass(params, ip_src, ip_real, ip_vip, slice_number=100, time_pause_minutes=5, viberttl=60, params_manual_set=0, smsttl=60)
345
+ mhub_connector.get_send_message_mass_2(params, ip_src, ip_real, ip_vip, slice_number, time_pause_minutes, viberttl, params_manual_set, smsttl)
346
346
  end
347
347
 
348
348
  def recieve_delivery_report(params, ip_src, ip_real, ip_vip, crm_slice_num)
@@ -129,7 +129,16 @@ class MhubFunctions_2
129
129
 
130
130
 
131
131
  #for bank dabrabyt for massive nums
132
- def get_send_message_mass_2(params, ip_src, ip_real, ip_vip, slice_number, time_pause_minutes)
132
+ def get_send_message_mass_2(params,
133
+ ip_src,
134
+ ip_real,
135
+ ip_vip,
136
+ slice_number,
137
+ time_pause_minutes,
138
+ viberttl,
139
+ params_manual_set,
140
+ smsttl
141
+ )
133
142
 
134
143
  input_params = {:params => params}
135
144
  output_params = {}
@@ -148,12 +157,29 @@ class MhubFunctions_2
148
157
 
149
158
  hub_resp = {}
150
159
 
151
- if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
152
- hub_resp = mhub_connector.sk_send_sms_list(part_list, static_callback, params["sms"]["text"], sms_alphaname, time_pause_minutes)
153
- elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
154
- hub_resp = mhub_connector.sk_send_viber_list(part_list, static_callback, params["viber"]["text"], time_pause_minutes)
155
- elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
156
- hub_resp = mhub_connector.sk_send_viber_sms_list(part_list, static_callback, params["sms"]["text"], params["viber"]["text"], sms_alphaname, time_pause_minutes)
160
+
161
+ viber_param = params["viber"]
162
+ sms_param = params["sms"]
163
+
164
+ if params_manual_set != 0
165
+ begin
166
+ if params_manual_set[:viber] == 0
167
+ viber_param = nil
168
+ end
169
+ if params_manual_set[:sms] == 0
170
+ sms_param = nil
171
+ end
172
+ rescue
173
+ nil
174
+ end
175
+ end
176
+
177
+ if null_statement.include?(viber_param) && !null_statement.include?(sms_param)
178
+ hub_resp = mhub_connector.sk_send_sms_list(part_list, static_callback, params["sms"]["text"], sms_alphaname, time_pause_minutes, smsttl)
179
+ elsif !null_statement.include?(viber_param) && null_statement.include?(sms_param)
180
+ hub_resp = mhub_connector.sk_send_viber_list(part_list, static_callback, params["viber"]["text"], time_pause_minutes, viberttl)
181
+ elsif !null_statement.include?(viber_param) && !null_statement.include?(sms_param)
182
+ hub_resp = mhub_connector.sk_send_viber_sms_list(part_list, static_callback, params["sms"]["text"], params["viber"]["text"], sms_alphaname, time_pause_minutes, viberttl, smsttl)
157
183
  else
158
184
  output_params = {"code": 502, "result": "Invalid input data st2", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
159
185
  end
@@ -148,7 +148,7 @@ class Sksk_2
148
148
  output_params
149
149
  end
150
150
 
151
- def sk_send_viber_sms_one(msisdn, callback_url, sms_text, viber_txt, alphaname)
151
+ def sk_send_viber_sms_one(msisdn, callback_url, sms_text, viber_txt, alphaname, smsttl=600)
152
152
 
153
153
  input_params = {:msisdn => msisdn, :callback_url => callback_url, :sms_text => sms_text, :viber_txt => viber_txt, :alphaname => alphaname}
154
154
  output_params = {}
@@ -188,7 +188,7 @@ class Sksk_2
188
188
  "sms": {
189
189
  "text": sms_text,
190
190
  "alpha_name": alphaname,
191
- "ttl": 600
191
+ "ttl": smsttl
192
192
  },
193
193
  "viber": viber_mess_ans[:body][:to_sk_format]
194
194
  }
@@ -220,7 +220,7 @@ class Sksk_2
220
220
  end
221
221
 
222
222
 
223
- def sk_send_sms_list(msisdn_list, callback_url, text, alphaname, time_pause_minutes=1)
223
+ def sk_send_sms_list(msisdn_list, callback_url, text, alphaname, time_pause_minutes=1, smsttl)
224
224
 
225
225
  input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :text => text, :alphaname => alphaname}
226
226
  output_params = {}
@@ -256,7 +256,7 @@ class Sksk_2
256
256
  "sms": {
257
257
  "alpha_name": alphaname,
258
258
  "text": text,
259
- "ttl": 60
259
+ "ttl": smsttl
260
260
  }
261
261
  }
262
262
  }
@@ -282,7 +282,10 @@ class Sksk_2
282
282
  end
283
283
 
284
284
 
285
- def sk_send_viber_list(msisdn_list, callback_url, text, time_pause_minutes)
285
+ def sk_send_viber_list(msisdn_list, callback_url, text, time_pause_minutes, viberttl)
286
+
287
+ internal_func.printer_texter({:input => "Fun started", :output => {}, :procedure => "Sksk_2.sk_send_viber_list"}, log_level)
288
+
286
289
 
287
290
  input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :text => text}
288
291
  output_params = {}
@@ -292,7 +295,7 @@ class Sksk_2
292
295
 
293
296
  thr_sk_send_viber_list = Thread.new do
294
297
 
295
- viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(text)
298
+ viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(text, viberttl)
296
299
 
297
300
  if viber_mess_ans[:code] == 200
298
301
  uri = URI(sk_url_broadcast)
@@ -346,7 +349,7 @@ class Sksk_2
346
349
  end
347
350
 
348
351
 
349
- def sk_send_viber_sms_list(msisdn_list, callback_url, sms_text, viber_text, alphaname, time_pause_minutes)
352
+ def sk_send_viber_sms_list(msisdn_list, callback_url, sms_text, viber_text, alphaname, time_pause_minutes, viberttl, smsttl)
350
353
  input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :sms_text => sms_text, :viber_text => viber_text, :alphaname => alphaname}
351
354
  output_params = {}
352
355
  request_message = {}
@@ -355,7 +358,7 @@ class Sksk_2
355
358
  thr_sk_send_viber_sms_list = Thread.new do
356
359
 
357
360
 
358
- viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(viber_text)
361
+ viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(viber_text, viberttl)
359
362
 
360
363
  if viber_mess_ans[:code] == 200
361
364
 
@@ -388,7 +391,7 @@ class Sksk_2
388
391
  "sms": {
389
392
  "alpha_name": alphaname,
390
393
  "text": sms_text,
391
- "ttl": 60
394
+ "ttl": smsttl
392
395
  },
393
396
  "viber": viber_mess_ans[:body][:to_sk_format]
394
397
  }
@@ -9,7 +9,7 @@ class Dabrab
9
9
  @log_level = log_level
10
10
  end
11
11
 
12
- def dabrabyt_text_field_parse(stri)
12
+ def dabrabyt_text_field_parse(stri, viberttl)
13
13
  button_url = ""
14
14
  image = ""
15
15
  button_text = ""
@@ -101,13 +101,13 @@ class Dabrab
101
101
 
102
102
  case scheme
103
103
  when 0
104
- sk_format = {"text": text, "ttl": 60}
104
+ sk_format = {"text": text, "ttl": viberttl}
105
105
  when 1
106
- sk_format = {"text": text, "ttl": 60, "caption": button_text, "action": button_url}
106
+ sk_format = {"text": text, "ttl": viberttl, "caption": button_text, "action": button_url}
107
107
  when 2
108
- sk_format = {"text": text, "ttl": 60, "caption": button_text, "action": button_url, "img": image}
108
+ sk_format = {"text": text, "ttl": viberttl, "caption": button_text, "action": button_url, "img": image}
109
109
  when 3
110
- sk_format = {"img": image, "ttl": 60}
110
+ sk_format = {"img": image, "ttl": viberttl}
111
111
  else
112
112
  nil
113
113
  end
@@ -1,4 +1,4 @@
1
1
  module Imperituroard
2
- VERSION = "1.1.15"
2
+ VERSION = "1.1.17"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imperituroard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.15
4
+ version: 1.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Buynovskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-19 00:00:00.000000000 Z
11
+ date: 2020-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler