@chat21/chat21-web-widget 5.0.62 → 5.0.63

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
@@ -1,5 +1,11 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.62 in PROD
4
+ - added: LWT e imHere() for presence management
5
+
6
+ ### 5.0.63-rc.1
7
+ - added: skip info messages in conversations-list component
8
+
3
9
  ### 5.0.62 in PROD
4
10
  - added: pending messages
5
11
  - added: disconnect from messaging handler if no interaction exist within 1 minute
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.0.62",
4
+ "version": "5.0.63",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -979,12 +979,12 @@ class Chat21Client {
979
979
  // clean: true,
980
980
  reconnectPeriod: 1000,
981
981
  // connectTimeout: 30 * 1000,
982
- // will: {
983
- // topic: this.presence_topic,
984
- // payload: '{"disconnected":true}',
985
- // qos: 1,
986
- // retain: true
987
- // },
982
+ will: {
983
+ topic: this.presence_topic,
984
+ payload: '{"disconnected":true}',
985
+ qos: 1,
986
+ retain: true
987
+ },
988
988
  clientId: this.client_id,
989
989
  username: 'JWT',
990
990
  password: jwt,
@@ -17,6 +17,8 @@ import { LoggerInstance } from '../logger/loggerInstance';
17
17
  // utils
18
18
  import { avatarPlaceholder, getColorBck } from '../../utils/utils-user';
19
19
  import { compareValues, conversationsPathForUserId, searchIndexInArrayForUid, isGroup } from '../../utils/utils';
20
+ import { messageType } from 'src/chat21-core/utils/utils-message';
21
+ import { MESSAGE_TYPE_INFO } from 'src/chat21-core/utils/constants';
20
22
 
21
23
 
22
24
 
@@ -475,6 +477,10 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
475
477
  //TODO-GAB: ora emit singola conversation e non dell'intero array di conversations
476
478
  private changed(childSnapshot: any) {
477
479
  const oldConversation = this.conversations[searchIndexInArrayForUid(this.conversations, childSnapshot.key)]
480
+ //skip info message updates
481
+ if(messageType(MESSAGE_TYPE_INFO, oldConversation) ){
482
+ return;
483
+ }
478
484
  if (this.conversationGenerate(childSnapshot)) {
479
485
  const index = searchIndexInArrayForUid(this.conversations, childSnapshot.key);
480
486
  if (index > -1) {
@@ -15,6 +15,8 @@ import { avatarPlaceholder, getColorBck } from '../../utils/utils-user';
15
15
  import { compareValues, searchIndexInArrayForUid } from '../../utils/utils';
16
16
  import { LoggerService } from '../abstract/logger.service';
17
17
  import { LoggerInstance } from '../logger/loggerInstance';
18
+ import { messageType } from 'src/chat21-core/utils/utils-message';
19
+ import { MESSAGE_TYPE_INFO } from 'src/chat21-core/utils/constants';
18
20
 
19
21
  // @Injectable({ providedIn: 'root' })
20
22
  @Injectable()
@@ -267,6 +269,12 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
267
269
  if (!conversation.conversation_with) {
268
270
  conversation.conversation_with = conversation.conversWith // conversWith comes from remote
269
271
  }
272
+
273
+ //skip info message updates
274
+ if(messageType(MESSAGE_TYPE_INFO, conversation) ){
275
+ return;
276
+ }
277
+
270
278
  const index = searchIndexInArrayForUid(this.conversations, conversation.conversation_with);
271
279
  const oldConversation = this.conversations[index]
272
280
  if (index > -1) {
@@ -72,9 +72,9 @@ export class MQTTPresenceService extends PresenceService {
72
72
 
73
73
  public imHere(): void {
74
74
  this.logger.debug('[MQTT-PRESENCE] imHere', this.tenant);
75
- // setTimeout(() => {
76
- // this.chat21Service.chatClient.ImHere()
77
- // }, 2000);
75
+ setTimeout(() => {
76
+ this.chat21Service.chatClient.ImHere()
77
+ }, 2000);
78
78
  }
79
79
 
80
80
  /**