podchat-browser 12.9.18 → 12.9.19-snapshot.0

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.
package/changelog.md CHANGED
@@ -5,7 +5,7 @@ to see complete list of changelog please visit [ChangeLog](http://gp.fanapsoft.i
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
- ## [12.9.18] 16-12-2025
8
+ ## [12.9.18] 05-01-2025
9
9
 
10
10
  ### Added
11
11
 
@@ -1 +1 @@
1
- {"version":"12.9.18","date":"۱۴۰۴/۱۰/۱۵","VersionInfo":"Release: true, Snapshot: false, Is For Test: false"}
1
+ {"version":"12.9.19-snapshot.0","date":"۱۴۰۴/۱۱/۵","VersionInfo":"Release: false, Snapshot: true, Is For Test: true"}
package/dist/node/chat.js CHANGED
@@ -8929,6 +8929,27 @@ function Chat(params) {
8929
8929
  return app.call.currentCall();
8930
8930
  };
8931
8931
 
8932
+ publicized.reInit = function (config) {
8933
+ params.socketAddress = config.socketAddress;
8934
+ params.podSpaceFileServer = config.podSpaceUrl;
8935
+ params.platformHost = config.platformHost;
8936
+
8937
+ if (config.webrtcConfig && config.webrtcConfig.iceServers) {
8938
+ config.webrtcConfig.iceServers.forEach(function (item) {
8939
+ if (item.info) {
8940
+ var inf = atob(item.info).split(":");
8941
+ item.username = inf[0];
8942
+ item.credential = inf[1];
8943
+ }
8944
+ });
8945
+ }
8946
+
8947
+ params.webrtcConfig = config.webrtcConfig;
8948
+ params.protocol = config.protocol;
8949
+ (0, _sdkParams.initSdkParams)(app, params);
8950
+ protocolManager.switchProtocol(app.sdkParams.protocol);
8951
+ };
8952
+
8932
8953
  init();
8933
8954
  return publicized;
8934
8955
  }
@@ -168,7 +168,7 @@ function ThreadMethods(app) {
168
168
  */
169
169
 
170
170
 
171
- function createThread(messageContent, addFromService, showThread) {
171
+ function createThread(messageContent, addFromService, showThread, uniqueId) {
172
172
  var threadData = (0, _dataFormatters.formatDataToMakeConversation)(messageContent);
173
173
  var redirectToThread = showThread === true ? showThread : false;
174
174
 
@@ -178,7 +178,8 @@ function ThreadMethods(app) {
178
178
  redirectToThread: redirectToThread,
179
179
  result: {
180
180
  thread: threadData
181
- }
181
+ },
182
+ uniqueId: uniqueId
182
183
  });
183
184
  }
184
185
 
@@ -242,9 +243,8 @@ function ThreadMethods(app) {
242
243
 
243
244
  if (parseInt(params.toTime) > 0 && parseInt(params.toTime) < 9999999999999) {
244
245
  content.toTime = parseInt(params.toTime);
245
- }
246
+ } //var functionLevelCache = (typeof params.cache == 'boolean') ? params.cache : true;
246
247
 
247
- var functionLevelCache = typeof params.cache == 'boolean' ? params.cache : true;
248
248
 
249
249
  if (typeof params.isGroup === 'boolean') {
250
250
  content.isGroup = params.isGroup;
@@ -270,7 +270,19 @@ function ThreadMethods(app) {
270
270
  var threadCache = app.store.thread.getCacheData(params);
271
271
 
272
272
  if (threadCache) {
273
- callback && callback(threadCache);
273
+ var returnData = threadCache;
274
+
275
+ if (params.returnOriginalData) {
276
+ returnData = JSON.parse(JSON.stringify(threadCache));
277
+ returnData.result.threads.forEach(function (item) {
278
+ if (item.lastMessageVO && item.lastMessageVO.time) {
279
+ item.lastMessageVO.timeFull = item.lastMessageVO.time;
280
+ item.lastMessageVO.time = item.lastMessageVO.timeMiliSeconds;
281
+ }
282
+ });
283
+ }
284
+
285
+ callback && callback(returnData);
274
286
  callback = undefined;
275
287
  return;
276
288
  }
@@ -310,7 +322,7 @@ function ThreadMethods(app) {
310
322
  threadData;
311
323
 
312
324
  for (var i = 0; i < messageLength; i++) {
313
- threadData = app.threadMethods.createThread(messageContent[i], false);
325
+ threadData = app.threadMethods.createThread(messageContent[i], false, false);
314
326
 
315
327
  if (threadData) {
316
328
  resultData.threads.push(threadData);
@@ -354,10 +366,10 @@ function ThreadMethods(app) {
354
366
  messageContent.uniqueId = uniqueId;
355
367
 
356
368
  if (app.store.messagesCallbacks[uniqueId]) {
357
- app.threadMethods.createThread(messageContent, true, true);
358
- app.store.messagesCallbacks[uniqueId](_utility["default"].createReturnData(chatMessage.typeCode, chatMessage.ownerId, false, '', 0, messageContent, contentCount));
369
+ app.threadMethods.createThread(messageContent, true, true, uniqueId);
370
+ app.store.messagesCallbacks[uniqueId](_utility["default"].createReturnData(chatMessage.typeCode, chatMessage.ownerId, false, '', 0, messageContent, contentCount, uniqueId));
359
371
  } else {
360
- app.threadMethods.createThread(messageContent, true, false);
372
+ app.threadMethods.createThread(messageContent, true, false, uniqueId);
361
373
  }
362
374
 
363
375
  var threadData = (0, _dataFormatters.formatDataToMakeConversation)(messageContent);