chat4app-client-angular 1.0.5 → 1.0.7

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.
@@ -2185,8 +2185,25 @@
2185
2185
  chat4appMessage.data.all = datTmp;
2186
2186
  chatCallback.onChatClosed(chat4appMessage);
2187
2187
  }
2188
+ else if (data.type == "count_notread") {
2189
+ var chat4appMessage = new Chat4AppMessageReceive();
2190
+ chat4appMessage.data.chatId = data.chatId;
2191
+ chat4appMessage.data.chatMessageId = data.chatMessageId;
2192
+ chat4appMessage.data.externalId = data.externalId;
2193
+ chat4appMessage.data.fromId = data.fromId;
2194
+ chat4appMessage.data.toId = data.toId;
2195
+ chat4appMessage.data.groupId = data.groupId;
2196
+ chat4appMessage.data.dateHour = data.dateHour;
2197
+ chat4appMessage.data.type = data.type;
2198
+ var datTmp = new Map();
2199
+ for (var key in data) {
2200
+ datTmp.set(key, data[key]);
2201
+ }
2202
+ chat4appMessage.data.all = datTmp;
2203
+ chatCallback.onCountNotRead(chat4appMessage);
2204
+ }
2188
2205
  };
2189
- Chat4appClientAngularService.prototype.ensureConn = function (chatServer, chatUserExternalId) {
2206
+ Chat4appClientAngularService.prototype.ensureConn = function (chatUserExternalId) {
2190
2207
  return __awaiter(this, void 0, void 0, function () {
2191
2208
  var that, uriStep1, server, _b;
2192
2209
  return __generator(this, function (_c) {
@@ -2198,7 +2215,7 @@
2198
2215
  console.log("getBearerToken: " + this.getBearerToken());
2199
2216
  }
2200
2217
  that = this;
2201
- uriStep1 = chatServer.replace(/^https/, 'wss');
2218
+ uriStep1 = this.chatServer.replace(/^https/, 'wss');
2202
2219
  server = uriStep1.replace(/(\/\/.*?)\//, '$1\/ws/');
2203
2220
  if (this.debug) {
2204
2221
  console.log("ws server: " + server);
@@ -2295,6 +2312,9 @@
2295
2312
  else if (msgObj.data.type == "chat_closed") {
2296
2313
  chatCallback.onChatClosed(msgObj);
2297
2314
  }
2315
+ else if (msgObj.data.type == "count_notread") {
2316
+ chatCallback.onCountNotRead(msgObj);
2317
+ }
2298
2318
  //}
2299
2319
  };
2300
2320
  Chat4appClientAngularService.prototype.connectWebsocket = function (chatCallback, userId) {
@@ -2315,7 +2335,7 @@
2315
2335
  tokenAuth = "Bearer " + securityToken;
2316
2336
  }
2317
2337
  configId = this.chatServer.split("/")[3];
2318
- return [4 /*yield*/, this.ensureConn("https://apihomol.chat4app.com", userId)];
2338
+ return [4 /*yield*/, this.ensureConn(userId)];
2319
2339
  case 1:
2320
2340
  nc = _b.sent();
2321
2341
  subject = "chat4app.config." + configId + ".user." + userId;