@chat21/chat21-ionic 3.0.64-rc1 → 3.0.65-rc2

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/deploy_amazon_beta.sh +29 -0
  3. package/deploy_amazon_prod.sh +26 -0
  4. package/deploy_pre.sh +5 -44
  5. package/deploy_prod.sh +6 -54
  6. package/package.json +1 -1
  7. package/publiccode.yml +110 -0
  8. package/src/app/app.component.ts +6 -1
  9. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +1 -1
  10. package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +0 -1
  11. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +6 -4
  12. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +19 -0
  13. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
  14. package/src/app/directives/truncate.pipe.spec.ts +8 -0
  15. package/src/app/directives/truncate.pipe.ts +16 -0
  16. package/src/app/pages/conversation-detail/conversation-detail.module.ts +3 -2
  17. package/src/app/pages/conversation-detail/conversation-detail.page.ts +4 -4
  18. package/src/app/pages/conversations-list/conversations-list.page.ts +52 -177
  19. package/src/assets/js/chat21client.js +57 -59
  20. package/src/{chat-config-mqtt-ver-uploaded.json → chat-config-mqtt-localhost.json} +10 -6
  21. package/src/chat-config-mqtt.json +18 -28
  22. package/src/chat-config-native-mqtt.json +30 -0
  23. package/src/chat-config-pre.json +9 -13
  24. package/src/chat21-core/models/conversation.ts +1 -1
  25. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +10 -1
  26. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +16 -13
  27. package/src/chat-config-pre-test.json +0 -37
@@ -3,14 +3,7 @@
3
3
  "chatEngine": "firebase",
4
4
  "uploadEngine": "firebase",
5
5
  "pushEngine": "firebase",
6
- "logLevel": "info",
7
- "fileUploadAccept":"*/*",
8
- "authPersistence": "LOCAL",
9
- "supportMode": true,
10
- "writeToButton": true,
11
- "archivedButton": true,
12
6
  "firebaseConfig": {
13
- "tenant": "tilechat",
14
7
  "apiKey": "AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",
15
8
  "authDomain": "chat21-pre-01.firebaseapp.com",
16
9
  "databaseURL": "https://chat21-pre-01.firebaseio.com",
@@ -19,17 +12,20 @@
19
12
  "messagingSenderId": "269505353043",
20
13
  "appId": "1:269505353043:web:b82af070572669e3707da6",
21
14
  "chat21ApiUrl": "https://us-central1-chat21-pre-01.cloudfunctions.net",
22
- "vapidKey": "BOsgS2ADwspKdWAmiFDZXEYqY1HSYADVfJT3j67wsySh3NxaViJqoabPJH8WM02wb5r8cQIm5TgM0UK047Z1D1c"
15
+ "tenant":"tilechat"
23
16
  },
24
17
  "chat21Config": {
25
18
  "appId": "tilechat",
26
19
  "MQTTendpoint": "ws://99.80.197.164:15675/ws",
27
- "APIendpoint": "http://99.80.197.164:8004/api",
28
- "loginServiceEndpoint": "http://99.80.197.164:/tilechat/signin"
20
+ "APIendpoint": "http://99.80.197.164:8004/api"
29
21
  },
30
22
  "apiUrl": "https://tiledesk-server-pre.herokuapp.com/",
31
23
  "baseImageUrl": "https://firebasestorage.googleapis.com/v0/b/",
32
- "dashboardUrl": "/dashboard/",
24
+ "dashboardUrl": "https://support-pre.tiledesk.com/dashboard/",
25
+ "logLevel": "DEBUG",
26
+ "authPersistence": "LOCAL",
27
+ "supportMode": true,
28
+ "archivedButton": true,
29
+ "writeToButton": true,
33
30
  "wsUrl": "wss://tiledesk-server-pre.herokuapp.com/"
34
- }
35
-
31
+ }
@@ -17,7 +17,7 @@ export class ConversationModel {
17
17
  public status: string,
18
18
  public timestamp: number,
19
19
  public time_last_message: string,
20
- public selected: boolean,
20
+ // public selected: boolean,
21
21
  public color: string,
22
22
  public avatar: string,
23
23
  public archived: boolean,
@@ -505,7 +505,7 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
505
505
  * @param conv
506
506
  */
507
507
  private completeConversation(conv): ConversationModel {
508
- conv.selected = false;
508
+ // conv.selected = false;
509
509
  if (!conv.sender_fullname || conv.sender_fullname === 'undefined' || conv.sender_fullname.trim() === '') {
510
510
  conv.sender_fullname = conv.sender;
511
511
  }
@@ -532,6 +532,15 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
532
532
  this.translateInfoSupportMessages(conv);
533
533
  }
534
534
  }
535
+ /** START: UPDATE CONVERSATIONS is_new IF conv is selected or sender is me */
536
+ if(conv.uid === this.uidConvSelected){
537
+ conv.is_new = false
538
+ }
539
+ if(conv.sender === this.loggedUserId){
540
+ conv.is_new = false
541
+ }
542
+ /** END: UPDATE CONVERSATIONS is_new IF conv is selected or sender is me */
543
+
535
544
  // Fixes the bug: if a snippet of code is pasted and sent it is not displayed correctly in the convesations list
536
545
  // conv.time_last_message = this.getTimeLastMessage(conv.timestamp);
537
546
  conv.conversation_with = conversation_with;
@@ -59,18 +59,15 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
59
59
  // 1 search local array
60
60
  // 2 search remote
61
61
  // callback
62
- console.log("SEARCHING CONV:", conversationWith);
62
+
63
63
  const conversation = this.conversations.find(conv => conv.conversation_with === conversationWith);
64
- console.log('[MQTTConversationsHandler] getConversationDetail *****: found locally?', conversation);
64
+
65
65
  if (conversation) {
66
- console.log('[MQTTConversationsHandler] getConversationDetail found LOCALLY!', conversationWith);
66
+
67
67
  callback(conversation);
68
68
  } else {
69
- console.log('[MQTTConversationsHandler] getConversationDetail *****: Not found locally, SEARCHING REMOTE ', conversation);
69
+
70
70
  this.chat21Service.chatClient.conversationDetail(conversationWith, (err, conversation) => {
71
- console.log("--REMOTE CONV IS:" + conversation);
72
- console.log("--REMOTE CONV IS OBJ:", conversation);
73
- console.log("--REMOTE ERR IS:" + err);
74
71
 
75
72
  if (conversation) {
76
73
  if (callback) {
@@ -147,7 +144,8 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
147
144
  // ---------------------------------------------------------------------------------
148
145
  // New connect - renamed subscribeToConversation
149
146
  //----------------------------------------------------------------------------------
150
- subscribeToConversations(loaded) {
147
+ subscribeToConversations(lastTimestamp, loaded) {
148
+ // lastTimestamp temporarily ignored
151
149
  this.logger.debug('[MQTTConversationsHandler] connecting MQTT conversations handler');
152
150
  const handlerConversationAdded = this.chat21Service.chatClient.onConversationAdded( (conv) => {
153
151
  this.logger.log("onConversationAdded:", conv);
@@ -385,8 +383,7 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
385
383
  }
386
384
 
387
385
  private completeConversation(conv): ConversationModel {
388
- console.log("COMPLETING CONVERSATION:", conv);
389
- conv.selected = false;
386
+ // conv.selected = false;
390
387
  if (!conv.sender_fullname || conv.sender_fullname === 'undefined' || conv.sender_fullname.trim() === '') {
391
388
  conv.sender_fullname = conv.sender;
392
389
  }
@@ -414,13 +411,19 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
414
411
  conv.last_message_text = conv.text; // building conv with a message
415
412
  }
416
413
  conv.uid = conv.conversation_with;
414
+ console.log("uidConvSelected is", this.uidConvSelected);
415
+ if (conv.uid === this.uidConvSelected) {
416
+ this.logger.debug("For selected conversation is_new = false");
417
+ conv.is_new = false;
418
+ }
419
+ if (conv.sender === this.loggedUserId) {
420
+ this.logger.debug("is_new always false if sender it's me")
421
+ conv.is_new = false;
422
+ }
417
423
  return conv;
418
424
  }
419
425
 
420
426
  private isGroup(conv: ConversationModel) {
421
- console.log("CONVIS: " + JSON.stringify(conv));
422
- console.log("CONVIS OBJ:", conv);
423
-
424
427
  if (conv.recipient.startsWith('group-') || conv.recipient.startsWith('support-group')) {
425
428
  return true;
426
429
  };
@@ -1,37 +0,0 @@
1
- {
2
- "t2y12PruGU9wUtEGzBJfolMIgK": "CAR:T-PAY:T-ANA:T-ACT:T-APP:T",
3
- "chatEngine": "firebase",
4
- "uploadEngine": "firebase",
5
- "pushEngine": "firebase",
6
- "logLevel": "info",
7
- "fileUploadAccept":"*/*",
8
- "authPersistence": "LOCAL",
9
- "supportMode": true,
10
- "writeToButton": true,
11
- "archivedButton": true,
12
- "firebaseConfig": {
13
- "tenant": "tilechat",
14
- "apiKey": "AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",
15
- "authDomain": "chat21-pre-01.firebaseapp.com",
16
- "databaseURL": "https://chat21-pre-01.firebaseio.com",
17
- "projectId": "chat21-pre-01",
18
- "storageBucket": "chat21-pre-01.appspot.com",
19
- "messagingSenderId": "269505353043",
20
- "appId": "1:269505353043:web:b82af070572669e3707da6",
21
- "chat21ApiUrl": "https://us-central1-chat21-pre-01.cloudfunctions.net",
22
- "vapidKey": "BOsgS2ADwspKdWAmiFDZXEYqY1HSYADVfJT3j67wsySh3NxaViJqoabPJH8WM02wb5r8cQIm5TgM0UK047Z1D1c"
23
- },
24
- "chat21Config": {
25
- "appId": "tilechat",
26
- "MQTTendpoint": "ws://99.80.197.164:15675/ws",
27
- "APIendpoint": "http://99.80.197.164:8004/api",
28
- "loginServiceEndpoint": "http://99.80.197.164:/tilechat/signin"
29
- },
30
- "apiUrl": "https://tiledesk-server-pre.herokuapp.com/",
31
- "baseImageUrl": "https://firebasestorage.googleapis.com/v0/b/",
32
- "dashboardUrl": "/dashboard/",
33
- "wsUrl": "wss://tiledesk-server-pre.herokuapp.com/",
34
- "storage_prefix": "chat_sv5"
35
- }
36
-
37
-