@chat21/chat21-ionic 3.0.6-2.2 → 3.0.6-2.4-rc1

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 (28) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/deploy_prod.sh +3 -3
  3. package/package.json +2 -1
  4. package/src/app/app.component.ts +103 -31
  5. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +2 -0
  6. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +2 -1
  7. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +33 -21
  8. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +27 -11
  9. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -1
  10. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +1 -1
  11. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +5 -3
  12. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -3
  13. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +10 -55
  14. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +8 -2
  15. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -0
  16. package/src/app/components/image-viewer/image-viewer.component.ts +28 -10
  17. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +2 -0
  18. package/src/app/pages/authentication/login/login.page.ts +12 -1
  19. package/src/app/pages/conversation-detail/conversation-detail.page.html +36 -17
  20. package/src/app/pages/conversation-detail/conversation-detail.page.ts +137 -239
  21. package/src/app/pages/conversations-list/conversations-list.page.html +18 -10
  22. package/src/app/pages/conversations-list/conversations-list.page.ts +58 -181
  23. package/src/assets/js/chat21client.js +1 -1
  24. package/src/chat-config-pre-test.json +3 -2
  25. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
  26. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +18 -3
  27. package/src/chat21-core/providers/logger/customLogger.ts +2 -10
  28. package/src/chat21-core/utils/utils-message.ts +99 -85
@@ -285,10 +285,7 @@ export class ConversationListPage implements OnInit {
285
285
 
286
286
  ionViewWillEnter() {
287
287
  this.logger.log('Called ionViewDidEnter')
288
- this.logger.log(
289
- '[CONVS-LIST-PAGE] ionViewWillEnter uidConvSelected',
290
- this.uidConvSelected,
291
- )
288
+ this.logger.log('[CONVS-LIST-PAGE] ionViewWillEnter uidConvSelected',this.uidConvSelected )
292
289
  this.listnerStart()
293
290
 
294
291
  // exit from app with hardware back button
@@ -313,29 +310,18 @@ export class ConversationListPage implements OnInit {
313
310
  openUnsevedConversationIframe(event) {
314
311
  this.logger.log('[CONVS-LIST-PAGE] openUnsevedConversationIframe ', event)
315
312
  this.hasClickedOpenUnservedConvIframe = true
316
- this.logger.log(
317
- '[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME',
318
- this.hasClickedOpenUnservedConvIframe,
319
- )
313
+ this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME',this.hasClickedOpenUnservedConvIframe )
320
314
  const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl
321
315
  // http://localhost:4204/#/projects-for-panel
322
316
  this.PROJECTS_FOR_PANEL_URL = DASHBOARD_BASE_URL + '#/projects-for-panel'
323
- this.UNASSIGNED_CONVS_URL =
324
- DASHBOARD_BASE_URL +
325
- '#/project/' +
326
- this.lastProjectId +
327
- '/unserved-request-for-panel'
317
+ this.UNASSIGNED_CONVS_URL = DASHBOARD_BASE_URL + '#/project/' + this.lastProjectId + '/unserved-request-for-panel'
328
318
 
329
319
  if (event === 'pinbtn') {
330
320
  this.IFRAME_URL = this.PROJECTS_FOR_PANEL_URL
331
321
  } else {
332
322
  this.IFRAME_URL = this.UNASSIGNED_CONVS_URL
333
323
  }
334
-
335
- this.logger.log(
336
- '[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL',
337
- this.UNASSIGNED_CONVS_URL,
338
- )
324
+ this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL',this.UNASSIGNED_CONVS_URL )
339
325
  this.openUnassignedConversations(this.IFRAME_URL, event)
340
326
  }
341
327
 
@@ -360,10 +346,7 @@ export class ConversationListPage implements OnInit {
360
346
  try {
361
347
  closeModal(this.modalController)
362
348
  } catch (err) {
363
- this.logger.error(
364
- '[CONVS-LIST-PAGE] closeContactsDirectory -> error:',
365
- err,
366
- )
349
+ this.logger.error( '[CONVS-LIST-PAGE] closeContactsDirectory -> error:', err)
367
350
  }
368
351
  }
369
352
 
@@ -372,46 +355,23 @@ export class ConversationListPage implements OnInit {
372
355
  const that = this
373
356
  if (navigator && navigator.serviceWorker) {
374
357
  navigator.serviceWorker.addEventListener('message', function (event) {
375
- that.logger.log(
376
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data: ',
377
- event.data,
378
- )
379
- that.logger.log(
380
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data: ',
381
- event.data['data'],
382
- )
383
- that.logger.log(
384
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data typeof: ',
385
- typeof event.data['data'],
386
- )
358
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data: ', event.data)
359
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data: ', event.data['data'] )
360
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data typeof: ', typeof event.data['data'] )
387
361
  let uidConvSelected = ''
388
362
  if (event.data && event.data['conversWith']) {
389
363
  uidConvSelected = event.data['conversWith']
390
364
  } else {
391
- that.logger.log(
392
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - DIFFERENT MSG',
393
- )
365
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - DIFFERENT MSG',)
394
366
  return
395
367
  }
396
368
 
397
- that.logger.log(
398
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event dataObjct uidConvSelected: ',
399
- uidConvSelected,
400
- )
401
- that.logger.log(
402
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker that.conversations: ',
403
- that.conversations,
404
- )
405
- const conversationSelected = that.conversations.find(
406
- (item) => item.uid === uidConvSelected,
407
- )
369
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event dataObjct uidConvSelected: ', uidConvSelected )
370
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker that.conversations: ', that.conversations)
371
+ const conversationSelected = that.conversations.find((item) => item.uid === uidConvSelected)
408
372
  if (conversationSelected) {
409
373
  that.conversationSelected = conversationSelected
410
- that.logger.log(
411
- '[CONVS-LIST-PAGE] listenToNotificationCLick- Received a message from service worker event conversationSelected: ',
412
- that.conversationSelected,
413
- )
414
-
374
+ that.logger.log('[CONVS-LIST-PAGE] listenToNotificationCLick- Received a message from service worker event conversationSelected: ', that.conversationSelected )
415
375
  that.navigateByUrl('active', uidConvSelected)
416
376
  }
417
377
  })
@@ -420,23 +380,16 @@ export class ConversationListPage implements OnInit {
420
380
 
421
381
  private listnerStart() {
422
382
  const that = this
423
- this.chatManager.BSStart.pipe(takeUntil(that.unsubscribe$)).subscribe(
424
- (data: any) => {
425
- this.logger.log(
426
- '[CONVS-LIST-PAGE] - BSStart SUBSCR DATA - Current user *****',
427
- data,
428
- )
383
+ this.chatManager.BSStart.pipe(takeUntil(that.unsubscribe$)).subscribe((data: any) => {
384
+ this.logger.log('[CONVS-LIST-PAGE] - BSStart SUBSCR DATA - Current user *****', data)
429
385
  if (data) {
430
386
  that.initialize()
431
387
  }
432
- },
433
- (error) => {
388
+ },(error) => {
434
389
  this.logger.error('[CONVS-LIST-PAGE] - BSStart SUBSCR - ERROR: ', error)
435
- },
436
- () => {
390
+ },() => {
437
391
  this.logger.log('[CONVS-LIST-PAGE] - BSStart SUBSCR * COMPLETE *')
438
- },
439
- )
392
+ })
440
393
  }
441
394
 
442
395
  // ------------------------------------------------------------------ //
@@ -444,7 +397,7 @@ export class ConversationListPage implements OnInit {
444
397
  // ------------------------------------------------------------------ //
445
398
  initConversationsHandler() {
446
399
  this.conversations = this.conversationsHandlerService.conversations
447
- this.logger.log('[CONVS-LIST-PAGE] - CONVERSATIONS ', this.conversations)
400
+ this.logger.log('[CONVS-LIST-PAGE] - CONVERSATIONS ', this.conversations.length, this.conversations)
448
401
  // save conversationHandler in chatManager
449
402
  this.chatManager.setConversationsHandler(this.conversationsHandlerService)
450
403
  this.showPlaceholder = false
@@ -452,36 +405,22 @@ export class ConversationListPage implements OnInit {
452
405
 
453
406
  initArchivedConversationsHandler() {
454
407
  const keysConversation = ['CLOSED', 'Resolve']
455
- this.translationMapConversation = this.translateService.translateLanguage(
456
- keysConversation,
457
- )
408
+ this.translationMapConversation = this.translateService.translateLanguage( keysConversation )
458
409
 
459
410
  this.archivedConversationsHandlerService.subscribeToConversations(() => {
460
- this.logger.log(
461
- '[CONVS-LIST-PAGE]-CONVS - conversations archived length ',
462
- this.archivedConversations.length,
463
- )
411
+ this.logger.log('[CONVS-LIST-PAGE]-CONVS - conversations archived length ',this.archivedConversations.length)
464
412
  })
465
413
 
466
414
  this.archivedConversations = this.archivedConversationsHandlerService.archivedConversations
467
- this.logger.log(
468
- '[CONVS-LIST-PAGE] archived conversation',
469
- this.archivedConversations,
470
- )
415
+ this.logger.log('[CONVS-LIST-PAGE] archived conversation',this.archivedConversations )
471
416
 
472
417
  // save archivedConversationsHandlerService in chatManager
473
418
  this.chatManager.setArchivedConversationsHandler(
474
419
  this.archivedConversationsHandlerService,
475
420
  )
476
421
 
477
- this.logger.log(
478
- '[CONVS-LIST-PAGE]-CONVS SubscribeToConversations - conversations archived length ',
479
- this.archivedConversations.length,
480
- )
481
- if (
482
- !this.archivedConversations ||
483
- this.archivedConversations.length === 0
484
- ) {
422
+ this.logger.log('[CONVS-LIST-PAGE]-CONVS SubscribeToConversations - conversations archived length ', this.archivedConversations.length )
423
+ if (!this.archivedConversations || this.archivedConversations.length === 0 ) {
485
424
  this.loadingIsActive = false
486
425
  }
487
426
  }
@@ -494,26 +433,17 @@ export class ConversationListPage implements OnInit {
494
433
  // - for the direct conversation
495
434
  // ----------------------------------------------------------------------------------------------------
496
435
  listenToAppCompConvsLengthOnInitConvs() {
497
- this.events.subscribe(
498
- 'appcompSubscribeToConvs:loadingIsActive',
499
- (loadingIsActive) => {
500
- this.logger.log(
501
- '[CONVS-LIST-PAGE]-CONVS loadingIsActive',
502
- loadingIsActive,
503
- )
504
- if (loadingIsActive === false) {
505
- this.loadingIsActive = false
506
- }
507
- },
508
- )
436
+ this.events.subscribe( 'appcompSubscribeToConvs:loadingIsActive', (loadingIsActive) => {
437
+ this.logger.log( '[CONVS-LIST-PAGE]-CONVS loadingIsActive', loadingIsActive)
438
+ if (loadingIsActive === false) {
439
+ this.loadingIsActive = false
440
+ }
441
+ })
509
442
  }
510
443
 
511
444
  listenGoOnline() {
512
445
  this.events.subscribe('go:online', (goonline) => {
513
- this.logger.info(
514
- '[CONVS-LIST-PAGE] - listen To go:online - goonline',
515
- goonline,
516
- )
446
+ this.logger.info('[CONVS-LIST-PAGE] - listen To go:online - goonline',goonline)
517
447
  // this.events.unsubscribe('profileInfoButtonClick:logout')
518
448
  if (goonline === true) {
519
449
  this.displayNewConvsItem = true
@@ -523,10 +453,7 @@ export class ConversationListPage implements OnInit {
523
453
 
524
454
  listenGoOffline() {
525
455
  this.events.subscribe('go:offline', (offline) => {
526
- this.logger.info(
527
- '[CONVS-LIST-PAGE] - listen To go:offline - offline',
528
- offline,
529
- )
456
+ this.logger.info('[CONVS-LIST-PAGE] - listen To go:offline - offline',offline)
530
457
  // this.events.unsubscribe('profileInfoButtonClick:logout')
531
458
  if (offline === true) {
532
459
  this.displayNewConvsItem = false
@@ -535,31 +462,19 @@ export class ConversationListPage implements OnInit {
535
462
  }
536
463
 
537
464
  listenToLogoutEvent() {
538
- this.events.subscribe(
539
- 'profileInfoButtonClick:logout',
540
- (hasclickedlogout) => {
541
- this.logger.info(
542
- '[CONVS-LIST-PAGE] - listenToLogoutEvent - hasclickedlogout',
543
- hasclickedlogout,
544
- )
465
+ this.events.subscribe( 'profileInfoButtonClick:logout', (hasclickedlogout) => {
466
+ this.logger.info( '[CONVS-LIST-PAGE] - listenToLogoutEvent - hasclickedlogout',hasclickedlogout)
545
467
 
546
468
  this.conversations = []
547
469
  this.conversationsHandlerService.conversations = []
548
470
  this.uidConvSelected = null
549
471
 
550
- this.logger.log(
551
- '[CONVS-LIST-PAGE] - listenToLogoutEvent - CONVERSATIONS ',
552
- this.conversations,
553
- )
554
- this.logger.log(
555
- '[CONVS-LIST-PAGE] - listenToLogoutEvent - uidConvSelected ',
556
- this.uidConvSelected,
557
- )
472
+ this.logger.log('[CONVS-LIST-PAGE] - listenToLogoutEvent - CONVERSATIONS ', this.conversations )
473
+ this.logger.log('[CONVS-LIST-PAGE] - listenToLogoutEvent - uidConvSelected ', this.uidConvSelected )
558
474
  if (hasclickedlogout === true) {
559
475
  this.loadingIsActive = false
560
476
  }
561
- },
562
- )
477
+ })
563
478
  }
564
479
 
565
480
  // ------------------------------------------------------------------
@@ -644,14 +559,8 @@ export class ConversationListPage implements OnInit {
644
559
  subscribeLoggedUserLogout = () => {
645
560
  this.conversations = []
646
561
  this.uidConvSelected = null
647
- this.logger.log(
648
- '[CONVS-LIST-PAGE] - subscribeLoggedUserLogout conversations ',
649
- this.conversations,
650
- )
651
- this.logger.log(
652
- '[CONVS-LIST-PAGE] - subscribeLoggedUserLogout uidConvSelected ',
653
- this.uidConvSelected,
654
- )
562
+ this.logger.log('[CONVS-LIST-PAGE] - subscribeLoggedUserLogout conversations ',this.conversations)
563
+ this.logger.log('[CONVS-LIST-PAGE] - subscribeLoggedUserLogout uidConvSelected ',this.uidConvSelected)
655
564
  }
656
565
 
657
566
  // ------------------------------------------------------------------------------------
@@ -659,15 +568,10 @@ export class ConversationListPage implements OnInit {
659
568
  // ------------------------------------------------------------------------------------
660
569
  conversationsChanged = (conversations: ConversationModel[]) => {
661
570
  this.numberOpenConv = this.conversationsHandlerService.countIsNew()
662
- this.logger.log(
663
- '[CONVS-LIST-PAGE] - conversationsChanged - NUMB OF CONVERSATIONS: ',
664
- this.numberOpenConv,
665
- )
571
+ this.logger.log('[CONVS-LIST-PAGE] - conversationsChanged - NUMB OF CONVERSATIONS: ',this.numberOpenConv)
666
572
  // console.log('conversationsChanged »»»»»»»»» uidConvSelected', that.conversations[0], that.uidConvSelected);
667
573
  if (this.uidConvSelected && !this.conversationSelected) {
668
- const conversationSelected = this.conversations.find(
669
- (item) => item.uid === this.uidConvSelected,
670
- )
574
+ const conversationSelected = this.conversations.find((item) => item.uid === this.uidConvSelected)
671
575
  if (conversationSelected) {
672
576
  this.conversationSelected = conversationSelected
673
577
  this.setUidConvSelected(this.uidConvSelected)
@@ -684,26 +588,13 @@ export class ConversationListPage implements OnInit {
684
588
  // !!!!!! IS USED? ?????
685
589
  // ------------------------------
686
590
  subscribeChangedConversationSelected = (user: UserModel, type: string) => {
687
- this.logger.log(
688
- '[CONVS-LIST-PAGE] ************** subscribeUidConvSelectedChanged navigateByUrl',
689
- user,
690
- type,
691
- )
591
+ this.logger.log('[CONVS-LIST-PAGE] ************** subscribeUidConvSelectedChanged navigateByUrl',user, type)
692
592
  this.uidConvSelected = user.uid
693
- this.logger.log(
694
- '[CONVS-LIST-PAGE] ************** uidConvSelected ',
695
- this.uidConvSelected,
696
- )
593
+ this.logger.log('[CONVS-LIST-PAGE] ************** uidConvSelected ', this.uidConvSelected)
697
594
  // this.conversationsHandlerService.uidConvSelected = user.uid;
698
- const conversationSelected = this.conversations.find(
699
- (item) => item.uid === this.uidConvSelected,
700
- )
595
+ const conversationSelected = this.conversations.find( (item) => item.uid === this.uidConvSelected)
701
596
  if (conversationSelected) {
702
- this.logger.log(
703
- '[CONVS-LIST-PAGE] --> uidConvSelected: ',
704
- this.conversationSelected,
705
- this.uidConvSelected,
706
- )
597
+ this.logger.log('[CONVS-LIST-PAGE] --> uidConvSelected: ',this.conversationSelected, this.uidConvSelected)
707
598
  this.conversationSelected = conversationSelected
708
599
  }
709
600
  // this.router.navigateByUrl('conversation-detail/' + user.uid + '?conversationWithFullname=' + user.fullname);
@@ -714,10 +605,7 @@ export class ConversationListPage implements OnInit {
714
605
  * evento richiamato quando si seleziona bottone profile-info-modal
715
606
  */
716
607
  subscribeProfileInfoButtonClicked = (event: string) => {
717
- this.logger.log(
718
- '[CONVS-LIST-PAGE] ************** subscribeProfileInfoButtonClicked: ',
719
- event,
720
- )
608
+ this.logger.log('[CONVS-LIST-PAGE] ************** subscribeProfileInfoButtonClicked: ', event)
721
609
  if (event === 'displayArchived') {
722
610
  this.initArchivedConversationsHandler()
723
611
  // this.openArchivedConversationsModal()
@@ -727,15 +615,11 @@ export class ConversationListPage implements OnInit {
727
615
  const keys = ['LABEL_ARCHIVED']
728
616
  // const keys = ['History'];
729
617
 
730
- this.headerTitle = this.translateService
731
- .translateLanguage(keys)
732
- .get(keys[0])
618
+ this.headerTitle = this.translateService.translateLanguage(keys).get(keys[0])
733
619
  } else if (event === 'displayContact') {
734
620
  this.conversationType = 'archived'
735
621
  const keys = ['LABEL_CONTACTS']
736
- this.headerTitle = this.translateService
737
- .translateLanguage(keys)
738
- .get(keys[0])
622
+ this.headerTitle = this.translateService.translateLanguage(keys).get(keys[0])
739
623
  }
740
624
  }
741
625
 
@@ -783,10 +667,7 @@ export class ConversationListPage implements OnInit {
783
667
  initialize() {
784
668
  const appconfig = this.appConfigProvider.getConfig()
785
669
  this.tenant = appconfig.firebaseConfig.tenant
786
- this.logger.log(
787
- '[CONVS-LIST-PAGE] - initialize -> firebaseConfig tenant ',
788
- this.tenant,
789
- )
670
+ this.logger.log('[CONVS-LIST-PAGE] - initialize -> firebaseConfig tenant ',this.tenant)
790
671
 
791
672
  if (this.tiledeskAuthService.getCurrentUser()) {
792
673
  this.loggedUserUid = this.tiledeskAuthService.getCurrentUser().uid
@@ -813,22 +694,18 @@ export class ConversationListPage implements OnInit {
813
694
  // It only works on BSStart.subscribe! it is useful or can be eliminated
814
695
  // --------------------------------------------------------
815
696
  initVariables() {
816
- this.logger.log(
817
- '[CONVS-LIST-PAGE] uidReciverFromUrl:: ' + this.uidReciverFromUrl,
818
- )
697
+ this.logger.log('[CONVS-LIST-PAGE] uidReciverFromUrl:: ' + this.uidReciverFromUrl)
819
698
  this.logger.log('[CONVS-LIST-PAGE] loggedUserUid:: ' + this.loggedUserUid)
820
699
  this.logger.log('[CONVS-LIST-PAGE] tenant:: ' + this.tenant)
821
700
  if (this.route.component['name'] !== 'ConversationListPage') {
822
701
  if (this.route && this.route.snapshot && this.route.snapshot.firstChild) {
823
702
  const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv')
703
+ const convType = this.route.snapshot.firstChild.paramMap.get('Convtype')
824
704
  this.logger.log('[CONVS-LIST-PAGE] conversationWith 2: ', IDConv)
825
705
  if (IDConv) {
826
- this.setUidConvSelected(IDConv)
706
+ this.setUidConvSelected(IDConv, convType)
827
707
  } else {
828
- this.logger.log(
829
- '[CONVS-LIST-PAGE] conversationWith 2 (else): ',
830
- IDConv,
831
- )
708
+ this.logger.log('[CONVS-LIST-PAGE] conversationWith 2 (else): ',IDConv)
832
709
  }
833
710
  }
834
711
  }
@@ -846,9 +723,11 @@ export class ConversationListPage implements OnInit {
846
723
  let conversationSelected
847
724
  if (conversationType === 'active') {
848
725
  conversationSelected = this.conversations.find((item) => item.uid === this.uidConvSelected)
849
- } else if (conversationType === 'archived') { conversationSelected = this.archivedConversations.find((item) => item.uid === this.uidConvSelected) }
726
+ } else if (conversationType === 'archived') {
727
+ conversationSelected = this.archivedConversations.find((item) => item.uid === this.uidConvSelected)
728
+ }
850
729
  if (conversationSelected) {
851
- this.logger.log('[CONVS-LIST-PAGE] conversationSelected', conversationSelected,)
730
+ this.logger.log('[CONVS-LIST-PAGE] conversationSelected', conversationSelected)
852
731
  this.logger.log('[CONVS-LIST-PAGE] the conversation ', this.conversationSelected, ' has already been loaded')
853
732
  this.conversationSelected = conversationSelected
854
733
  this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected: ', this.conversationSelected)
@@ -882,9 +761,7 @@ export class ConversationListPage implements OnInit {
882
761
  conversation_with_fullname = conversation.recipient_fullname
883
762
  }
884
763
  if (!conversation_with.startsWith('support-group')) {
885
- conversation.image = this.imageRepoService.getImagePhotoUrl(
886
- conversation_with,
887
- )
764
+ conversation.image = this.imageRepoService.getImagePhotoUrl(conversation_with)
888
765
  }
889
766
  }
890
767
 
@@ -962,7 +962,7 @@ class Chat21Client {
962
962
  }
963
963
  if (this.log) {console.log("starting mqtt connection with LWT on:", presence_topic, this.endpoint)}
964
964
  // client = mqtt.connect('mqtt://127.0.0.1:15675/ws',options)
965
- this.client = mqtt.connect(this.endpoint,options)
965
+ this.client = mqtt.connect('a://99.80.197.164:15675/ws',options)
966
966
 
967
967
  this.client.on('connect', // TODO if token is wrong it must reply with an error!
968
968
  () => {
@@ -29,8 +29,9 @@
29
29
  },
30
30
  "apiUrl": "https://tiledesk-server-pre.herokuapp.com/",
31
31
  "baseImageUrl": "https://firebasestorage.googleapis.com/v0/b/",
32
- "dashboardUrl": "http://localhost:4204/",
33
- "wsUrl": "wss://tiledesk-server-pre.herokuapp.com/"
32
+ "dashboardUrl": "/dashboard/",
33
+ "wsUrl": "wss://tiledesk-server-pre.herokuapp.com/",
34
+ "storage_prefix": "chat_sv5"
34
35
  }
35
36
 
36
37
 
@@ -156,8 +156,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
156
156
  typeMsg,
157
157
  attributes,
158
158
  channelType,
159
- false,
160
- isEmojii(msg)
159
+ false
161
160
  );
162
161
  const messageRef = firebaseMessagesCustomUid.push({
163
162
  language: lang,
@@ -291,7 +290,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
291
290
  msg.isSender = this.isSender(msg.sender, this.loggedUser.uid);
292
291
 
293
292
  //check if message contains only an emojii
294
- msg.emoticon = isEmojii(msg.text)
293
+ // msg.emoticon = isEmojii(msg.text)
295
294
 
296
295
  // traduco messaggi se sono del server
297
296
  if (msg.attributes && msg.attributes.subtype) {
@@ -493,17 +493,32 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
493
493
  }
494
494
 
495
495
  conv.conversation_with = conversation_with;
496
- conv.conversation_with_fullname = conversation_with_fullname;
496
+ conv.conversation_with_fullname = this.changeSenderFullName(conv)
497
+ conv.recipient_fullname = this.changeSenderFullName(conv); //NEW
497
498
  conv.status = this.setStatusConversation(conv.sender, conv.uid);
498
499
  // conv.time_last_message = this.getTimeLastMessage(conv.timestamp); // evaluate if is used
499
- conv.avatar = avatarPlaceholder(conversation_with_fullname);
500
- conv.color = getColorBck(conversation_with_fullname);
500
+ conv.avatar = avatarPlaceholder(conv.conversation_with_fullname);
501
+ conv.color = getColorBck(conv.conversation_with_fullname);
501
502
  //conv.image = this.imageRepo.getImagePhotoUrl(conversation_with);
502
503
  // getImageUrlThumbFromFirebasestorage(conversation_with, this.FIREBASESTORAGE_BASE_URL_IMAGE, this.urlStorageBucket);
503
504
  return conv;
504
505
  }
505
506
 
506
507
 
508
+ /**BUG-FIX: on Conversation-list, when conversation start, it continuosly change the sender_fullname info from Guest to others name */
509
+ private changeSenderFullName(conversation: ConversationModel): string {
510
+ let old_conv = this.conversations.find(conv => conv.uid === conversation.uid)
511
+ let conversation_with_fullname = conversation.recipient_fullname
512
+ if(old_conv){
513
+ if(conversation.recipient_fullname !== old_conv.recipient_fullname && conversation.recipient_fullname !== 'Guest '){
514
+ conversation_with_fullname = conversation.recipient_fullname
515
+ } else {
516
+ conversation_with_fullname= old_conv.recipient_fullname
517
+ }
518
+ }
519
+ return conversation_with_fullname
520
+ }
521
+
507
522
  translateInfoSupportMessages(conv) {
508
523
  const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
509
524
  // console.log('[FIREBASEConversationsHandlerSERVICE] INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU', INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU)
@@ -17,18 +17,10 @@ export class CustomLogger implements LoggerService {
17
17
  constructor(private logger: NGXLogger) { }
18
18
 
19
19
  setLoggerConfig(isLogEnabled: boolean, logLevel: string) {
20
-
21
20
  this.isLogEnabled = isLogEnabled;
22
- // console.log('LoggerService this.logLevel ', this.logLevel)
23
-
24
21
  if (logLevel) {
25
- // console.log('LoggerService typeof logLevel ', typeof logLevel)
26
- if (typeof logLevel === 'string') {
27
- this.logLevel = LogLevel[logLevel.toUpperCase()];
28
- // console.log('LoggerService this.logLevel toUpperCase', this.logLevel)
29
- } else {
30
- console.error('logLevel is not a string. See the chat21-ionic README.md')
31
- }
22
+ this.logLevel = LogLevel[logLevel.toUpperCase()];
23
+ console.log('LoggerService this.logLevel ', this.logLevel)
32
24
  }
33
25
  }
34
26