@chat21/chat21-ionic 2.0.13 → 3.0.5-9.2
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/.github/workflows/docker-community-push-latest.yml +22 -0
- package/.github/workflows/docker-image-tag-community-tag-push.yml +21 -0
- package/CHANGELOG.md +637 -212
- package/Dockerfile +1 -2
- package/LICENSE +21 -661
- package/README.md +40 -9
- package/angular.json +230 -0
- package/browserslist +12 -0
- package/config.xml +60 -47
- package/deploy_pre.sh +14 -12
- package/deploy_prod.sh +26 -6
- package/env.sample +28 -9
- package/ionic.config.json +2 -2
- package/karma.conf.js +31 -0
- package/nginx.conf +1 -1
- package/package.json +91 -105
- package/publish_pre.sh +33 -0
- package/publish_prod.sh +33 -0
- package/resources/Android/icon/drawable-hdpi-icon.png +0 -0
- package/resources/Android/icon/drawable-ldpi-icon.png +0 -0
- package/resources/Android/icon/drawable-mdpi-icon.png +0 -0
- package/resources/Android/icon/drawable-xhdpi-icon.png +0 -0
- package/resources/Android/icon/drawable-xxhdpi-icon.png +0 -0
- package/resources/Android/icon/drawable-xxxhdpi-icon.png +0 -0
- package/resources/Android/icon.png +0 -0
- package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash.png +0 -0
- package/src/app/app-routing.module.ts +90 -0
- package/src/app/app.component.html +26 -0
- package/src/app/app.component.scss +11 -0
- package/src/app/app.component.spec.ts +47 -0
- package/src/app/app.component.ts +1154 -128
- package/src/app/app.module.ts +314 -135
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +143 -0
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.scss +335 -0
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.spec.ts +179 -0
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +303 -0
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +149 -0
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +199 -0
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.spec.ts +24 -0
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +97 -0
- package/src/app/chatlib/conversation-detail/message/avatar/avatar.component.html +17 -0
- package/src/app/chatlib/conversation-detail/message/avatar/avatar.component.scss +83 -0
- package/src/app/chatlib/conversation-detail/message/avatar/avatar.component.spec.ts +27 -0
- package/src/app/chatlib/conversation-detail/message/avatar/avatar.component.ts +43 -0
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +76 -0
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +51 -0
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +84 -0
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +215 -0
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +3 -0
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +83 -0
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.spec.ts +25 -0
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +37 -0
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +24 -0
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +61 -0
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.spec.ts +25 -0
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +30 -0
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +3 -0
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +47 -0
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.spec.ts +25 -0
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +29 -0
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +3 -0
- package/{bin/chat21-ionic → src/app/chatlib/conversation-detail/message/frame/frame.component.scss} +0 -0
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.spec.ts +25 -0
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +33 -0
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +10 -0
- package/src/app/chatlib/conversation-detail/message/image/image.component.scss +34 -0
- package/src/app/chatlib/conversation-detail/message/image/image.component.spec.ts +35 -0
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +78 -0
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.html +2 -0
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +15 -0
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.spec.ts +27 -0
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.ts +35 -0
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +56 -0
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +169 -0
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.spec.ts +33 -0
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +80 -0
- package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.html +18 -0
- package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.scss +27 -0
- package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.spec.ts +25 -0
- package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.ts +24 -0
- package/src/app/chatlib/conversation-detail/message/text/text.component.html +5 -0
- package/src/app/chatlib/conversation-detail/message/text/text.component.scss +26 -0
- package/src/app/chatlib/conversation-detail/message/text/text.component.spec.ts +33 -0
- package/src/app/chatlib/conversation-detail/message/text/text.component.ts +56 -0
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +154 -0
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +222 -0
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.spec.ts +24 -0
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +113 -0
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.html +46 -0
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.scss +200 -0
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.spec.ts +27 -0
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +135 -0
- package/src/app/components/authentication/login/login.component.html +65 -0
- package/src/app/components/authentication/login/login.component.scss +85 -0
- package/src/app/components/authentication/login/login.component.spec.ts +24 -0
- package/src/app/components/authentication/login/login.component.ts +174 -0
- package/src/app/components/contacts-directory/contacts-directory.component.html +22 -0
- package/src/app/components/contacts-directory/contacts-directory.component.scss +123 -0
- package/src/app/components/contacts-directory/contacts-directory.component.spec.ts +24 -0
- package/src/app/components/contacts-directory/contacts-directory.component.ts +109 -0
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +3 -0
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +21 -0
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +24 -0
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +14 -0
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +54 -0
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +98 -0
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.spec.ts +24 -0
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +84 -0
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +30 -0
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +83 -0
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +24 -0
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +68 -0
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +3 -0
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +10 -0
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +24 -0
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +14 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +71 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +161 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.spec.ts +24 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +133 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +64 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +124 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.spec.ts +25 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +685 -0
- package/src/app/components/conversation-detail/option-header/option-header.component.html +13 -0
- package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
- package/src/app/components/conversation-detail/option-header/option-header.component.spec.ts +24 -0
- package/src/app/components/conversation-detail/option-header/option-header.component.ts +24 -0
- package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.html +64 -0
- package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.scss +135 -0
- package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.spec.ts +24 -0
- package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.ts +53 -0
- package/src/app/components/conversation-info/conversation-info.module.ts +13 -0
- package/src/app/components/conversation-info/info-content/info-content.component.html +18 -0
- package/src/app/components/conversation-info/info-content/info-content.component.scss +5 -0
- package/src/app/components/conversation-info/info-content/info-content.component.spec.ts +24 -0
- package/src/app/components/conversation-info/info-content/info-content.component.ts +395 -0
- package/src/app/components/conversation-info/info-direct/info-direct.component.html +57 -0
- package/src/app/components/conversation-info/info-direct/info-direct.component.scss +62 -0
- package/src/app/components/conversation-info/info-direct/info-direct.component.spec.ts +24 -0
- package/src/app/components/conversation-info/info-direct/info-direct.component.ts +67 -0
- package/src/app/components/conversation-info/info-group/info-group.component.html +115 -0
- package/src/app/components/conversation-info/info-group/info-group.component.scss +80 -0
- package/src/app/components/conversation-info/info-group/info-group.component.spec.ts +24 -0
- package/src/app/components/conversation-info/info-group/info-group.component.ts +218 -0
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.html +6 -0
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.scss +0 -0
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.spec.ts +24 -0
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +29 -0
- package/src/app/components/ddp-header/ddp-header.component.html +31 -0
- package/src/app/components/ddp-header/ddp-header.component.scss +26 -0
- package/src/app/components/ddp-header/ddp-header.component.spec.ts +24 -0
- package/src/app/components/ddp-header/ddp-header.component.ts +33 -0
- package/src/app/components/image-viewer/image-viewer.component.html +23 -0
- package/src/app/components/image-viewer/image-viewer.component.scss +107 -0
- package/src/app/components/image-viewer/image-viewer.component.spec.ts +24 -0
- package/src/app/components/image-viewer/image-viewer.component.ts +38 -0
- package/src/app/components/project-item/project-item.component.html +147 -0
- package/src/app/components/project-item/project-item.component.scss +669 -0
- package/src/app/components/project-item/project-item.component.spec.ts +24 -0
- package/src/app/components/project-item/project-item.component.ts +350 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.html +12 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.scss +29 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.spec.ts +24 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.ts +41 -0
- package/src/app/components/utils/user-presence/user-presence.component.html +2 -0
- package/src/app/components/utils/user-presence/user-presence.component.scss +24 -0
- package/src/app/components/utils/user-presence/user-presence.component.spec.ts +24 -0
- package/src/app/components/utils/user-presence/user-presence.component.ts +159 -0
- package/src/app/directives/autofocus.directive.ts +41 -0
- package/src/app/directives/html-entities-encode.pipe.spec.ts +8 -0
- package/src/app/directives/html-entities-encode.pipe.ts +17 -0
- package/src/app/directives/marked.pipe.spec.ts +8 -0
- package/src/app/directives/marked.pipe.ts +27 -0
- package/src/app/directives/safe-html.pipe.ts +16 -0
- package/src/app/pages/authentication/login/login-routing.module.ts +17 -0
- package/src/app/pages/authentication/login/login.module.ts +39 -0
- package/src/app/pages/authentication/login/login.page.html +7 -0
- package/src/app/pages/authentication/login/login.page.scss +5 -0
- package/src/app/pages/authentication/login/login.page.spec.ts +24 -0
- package/src/app/pages/authentication/login/login.page.ts +187 -0
- package/src/app/pages/contacts-directory/contacts-directory-routing.module.ts +17 -0
- package/src/app/pages/contacts-directory/contacts-directory.module.ts +42 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.html +19 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.scss +0 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.spec.ts +24 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.ts +125 -0
- package/src/app/pages/conversation-detail/conversation-detail-routing.module.ts +17 -0
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +69 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.html +191 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +492 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.spec.ts +24 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1525 -0
- package/src/app/pages/conversations-list/conversations-list-routing.module.ts +17 -0
- package/src/app/pages/conversations-list/conversations-list.module.ts +43 -0
- package/src/app/pages/conversations-list/conversations-list.page.html +112 -0
- package/src/app/pages/conversations-list/conversations-list.page.scss +302 -0
- package/src/app/pages/conversations-list/conversations-list.page.spec.ts +24 -0
- package/src/app/pages/conversations-list/conversations-list.page.ts +1032 -0
- package/src/app/pages/details/details-routing.module.ts +17 -0
- package/src/app/pages/details/details.module.ts +21 -0
- package/src/app/pages/details/details.page.html +28 -0
- package/src/app/pages/details/details.page.scss +23 -0
- package/src/app/pages/details/details.page.spec.ts +24 -0
- package/src/app/pages/details/details.page.ts +65 -0
- package/src/app/pages/loader-preview/loader-preview-routing.module.ts +17 -0
- package/src/app/pages/loader-preview/loader-preview.module.ts +29 -0
- package/src/app/pages/loader-preview/loader-preview.page.html +62 -0
- package/src/app/pages/loader-preview/loader-preview.page.scss +117 -0
- package/src/app/pages/loader-preview/loader-preview.page.spec.ts +24 -0
- package/src/app/pages/loader-preview/loader-preview.page.ts +353 -0
- package/src/app/pages/profile-info/profile-info-routing.module.ts +17 -0
- package/src/app/pages/profile-info/profile-info.module.ts +41 -0
- package/src/app/pages/profile-info/profile-info.page.html +86 -0
- package/src/app/pages/profile-info/profile-info.page.scss +264 -0
- package/src/app/pages/profile-info/profile-info.page.spec.ts +24 -0
- package/src/app/pages/profile-info/profile-info.page.ts +223 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations-routing.module.ts +17 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.module.ts +22 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +22 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +79 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.spec.ts +24 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +116 -0
- package/src/app/services/app-config.ts +107 -0
- package/src/app/services/canned-responses/canned-responses.service.spec.ts +12 -0
- package/src/app/services/canned-responses/canned-responses.service.ts +49 -0
- package/src/app/services/contacts/contacts.service.spec.ts +12 -0
- package/src/app/services/contacts/contacts.service.ts +172 -0
- package/src/app/services/events-service.ts +79 -0
- package/src/app/services/nav-proxy.service.spec.ts +12 -0
- package/src/app/services/nav-proxy.service.ts +80 -0
- package/src/app/services/network-service/network.service.spec.ts +12 -0
- package/src/app/services/network-service/network.service.ts +46 -0
- package/src/app/services/tiledesk/tiledesk.service.spec.ts +12 -0
- package/src/app/services/tiledesk/tiledesk.service.ts +99 -0
- package/src/app/services/websocket/websocket-js.ts +560 -0
- package/src/app/services/websocket/websocket.service.spec.ts +12 -0
- package/src/app/services/websocket/websocket.service.ts +292 -0
- package/src/app/shared/shared-conversation-info.module.ts +33 -0
- package/src/app/shared/shared.module.ts +130 -0
- package/src/{utils → app/utils}/constants.ts-e +0 -0
- package/src/app/utils/scrollbar-theme.directive.ts +63 -0
- package/src/assets/i18n/en.json +122 -38
- package/src/assets/i18n/it.json +101 -10
- package/src/assets/icon/favicon.ico +0 -0
- package/src/assets/icon/ionic_favicon.png +0 -0
- package/src/assets/images/f21ico-done.svg +1 -0
- package/src/assets/images/f21ico-done_all.svg +1 -0
- package/src/assets/images/f21ico-schedule.svg +1 -0
- package/src/assets/images/file-alt-solid.png +0 -0
- package/src/assets/images/no_conversation.jpg +0 -0
- package/src/assets/{img → images}/no_image.png +0 -0
- package/src/assets/js/chat21client.js +1027 -0
- package/src/assets/js/mqtt/4.1.0/mqtt.min.js +1 -0
- package/src/assets/js/mqtt/4.2.6/mqtt.min.js +1 -0
- package/src/assets/js/mqtt/4.2.8/mqtt.min.js +1 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/shapes.svg +1 -0
- package/src/assets/sounds/pling.mp3 +0 -0
- package/src/assets/transparent.png +0 -0
- package/src/chat-config-mqtt-ver-uploaded.json +22 -0
- package/src/chat-config-mqtt.json +26 -0
- package/src/chat-config-pre-test.json +32 -0
- package/src/chat-config-pre.json +23 -0
- package/src/chat-config-template.json +20 -6
- package/src/chat-config.json +30 -0
- package/src/{models → chat21-core/models}/conversation.ts +6 -2
- package/src/{models → chat21-core/models}/group.ts +7 -5
- package/src/{models → chat21-core/models}/message.ts +8 -8
- package/src/{models → chat21-core/models}/upload.ts +5 -5
- package/src/{models → chat21-core/models}/user.ts +2 -1
- package/src/chat21-core/providers/abstract/app-storage.service.spec.ts +15 -0
- package/src/chat21-core/providers/abstract/app-storage.service.ts +17 -0
- package/src/chat21-core/providers/abstract/archivedconversations-handler.service.spec.ts +13 -0
- package/src/chat21-core/providers/abstract/archivedconversations-handler.service.ts +34 -0
- package/src/chat21-core/providers/abstract/conversation-handler-builder.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/conversation-handler-builder.service.ts +11 -0
- package/src/chat21-core/providers/abstract/conversation-handler.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/conversation-handler.service.ts +43 -0
- package/src/chat21-core/providers/abstract/conversations-handler.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/conversations-handler.service.ts +42 -0
- package/src/chat21-core/providers/abstract/groups-handler.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/groups-handler.service.ts +28 -0
- package/src/chat21-core/providers/abstract/image-repo.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/image-repo.service.ts +26 -0
- package/src/chat21-core/providers/abstract/logger.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/logger.service.ts +16 -0
- package/src/chat21-core/providers/abstract/messagingAuth.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/messagingAuth.service.ts +54 -0
- package/src/chat21-core/providers/abstract/notifications.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/notifications.service.ts +31 -0
- package/src/chat21-core/providers/abstract/presence.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/presence.service.ts +34 -0
- package/src/chat21-core/providers/abstract/typing.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/typing.service.ts +31 -0
- package/src/chat21-core/providers/abstract/upload.service.spec.ts +12 -0
- package/src/chat21-core/providers/abstract/upload.service.ts +39 -0
- package/src/chat21-core/providers/chat-manager.ts +282 -0
- package/src/chat21-core/providers/custom-translate.service.spec.ts +12 -0
- package/src/chat21-core/providers/custom-translate.service.ts +42 -0
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +476 -0
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +376 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler-builder.service.ts +19 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +416 -0
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +570 -0
- package/src/chat21-core/providers/firebase/firebase-groups-handler.ts +303 -0
- package/src/chat21-core/providers/firebase/firebase-image-repo.ts +40 -0
- package/src/chat21-core/providers/firebase/firebase-init-service.ts +31 -0
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +246 -0
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +190 -0
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +93 -0
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +106 -0
- package/src/chat21-core/providers/localSessionStorage.ts +215 -0
- package/src/chat21-core/providers/logger/customLogger.ts +70 -0
- package/src/chat21-core/providers/logger/loggerInstance.ts +20 -0
- package/src/chat21-core/providers/mqtt/chat-service.ts +44 -0
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +707 -0
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +313 -0
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler-builder.service.ts +25 -0
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +446 -0
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +601 -0
- package/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts +139 -0
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +122 -0
- package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +229 -0
- package/src/chat21-core/providers/mqtt/mqtt-typing.service.ts +93 -0
- package/src/chat21-core/providers/native/native-image-repo.ts +30 -0
- package/src/chat21-core/providers/native/native-upload-service.ts +85 -0
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.spec.ts +12 -0
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +211 -0
- package/src/chat21-core/utils/constants.ts +109 -0
- package/src/chat21-core/utils/user-typing/user-typing.component.html +6 -0
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +62 -0
- package/src/chat21-core/utils/user-typing/user-typing.component.spec.ts +24 -0
- package/src/chat21-core/utils/user-typing/user-typing.component.ts +114 -0
- package/src/chat21-core/utils/utils-message.ts +117 -0
- package/src/chat21-core/utils/utils-user.ts +46 -0
- package/src/chat21-core/utils/utils.ts +893 -0
- package/src/firebase-messaging-sw-template.js +1 -1
- package/src/global.scss +585 -0
- package/src/index.html +71 -42
- package/src/main.ts +12 -0
- package/src/manifest.json +0 -11
- package/src/models/department.ts +12 -0
- package/src/polyfills.ts +73 -0
- package/src/test.ts +21 -0
- package/src/theme/variables.scss +236 -93
- package/src/variables.scss +30 -0
- package/src/zone-flags.ts +5 -0
- package/tsconfig.app.json +14 -0
- package/tsconfig.json +23 -18
- package/tsconfig.spec.json +19 -0
- package/tslint.json +84 -7
- package/app.json +0 -7
- package/curl +0 -1
- package/deploy_dev.sh +0 -28
- package/docs/changelog.html +0 -227
- package/docs/classes/ConversationModel.html +0 -1022
- package/docs/classes/GroupModel.html +0 -527
- package/docs/classes/MessageModel.html +0 -843
- package/docs/classes/UploadModel.html +0 -417
- package/docs/classes/UserModel.html +0 -728
- package/docs/classes/_DetailPage.html +0 -144
- package/docs/classes/_MasterPage.html +0 -144
- package/docs/components/ArchivedConversationsPage.html +0 -1024
- package/docs/components/ChatBubble.html +0 -327
- package/docs/components/DettaglioConversazionePage.html +0 -6060
- package/docs/components/ElasticTextarea.html +0 -619
- package/docs/components/InfoAdvancedPage.html +0 -656
- package/docs/components/InfoConversationPage.html +0 -5681
- package/docs/components/InfoMessagePage.html +0 -993
- package/docs/components/InfoUserPage.html +0 -1420
- package/docs/components/ListaConversazioniPage.html +0 -3576
- package/docs/components/LoginPage.html +0 -1457
- package/docs/components/MyApp.html +0 -1388
- package/docs/components/PlaceholderPage.html +0 -397
- package/docs/components/PopoverPage.html +0 -986
- package/docs/components/PopoverProfilePage.html +0 -639
- package/docs/components/ProfilePage.html +0 -1187
- package/docs/components/RegisterPage.html +0 -1271
- package/docs/components/ResetpwdPage.html +0 -1039
- package/docs/components/UpdateImageProfilePage.html +0 -997
- package/docs/components/UsersPage.html +0 -1297
- package/docs/coverage.html +0 -1421
- package/docs/dependencies.html +0 -210
- package/docs/directives/AutosizeDirective.html +0 -556
- package/docs/fonts/FontAwesome.otf +0 -0
- package/docs/fonts/fontawesome-webfont.eot +0 -0
- package/docs/fonts/fontawesome-webfont.svg +0 -685
- package/docs/fonts/fontawesome-webfont.ttf +0 -0
- package/docs/fonts/fontawesome-webfont.woff +0 -0
- package/docs/fonts/fontawesome-webfont.woff2 +0 -0
- package/docs/fonts/ionicons.eot +0 -0
- package/docs/fonts/ionicons.svg +0 -2090
- package/docs/fonts/ionicons.ttf +0 -0
- package/docs/fonts/ionicons.woff +0 -0
- package/docs/fonts/ionicons.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-300.eot +0 -0
- package/docs/fonts/roboto-v15-latin-300.svg +0 -314
- package/docs/fonts/roboto-v15-latin-300.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-300.woff +0 -0
- package/docs/fonts/roboto-v15-latin-300.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-700.eot +0 -0
- package/docs/fonts/roboto-v15-latin-700.svg +0 -310
- package/docs/fonts/roboto-v15-latin-700.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-700.woff +0 -0
- package/docs/fonts/roboto-v15-latin-700.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-italic.eot +0 -0
- package/docs/fonts/roboto-v15-latin-italic.svg +0 -323
- package/docs/fonts/roboto-v15-latin-italic.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-italic.woff +0 -0
- package/docs/fonts/roboto-v15-latin-italic.woff2 +0 -0
- package/docs/fonts/roboto-v15-latin-regular.eot +0 -0
- package/docs/fonts/roboto-v15-latin-regular.svg +0 -308
- package/docs/fonts/roboto-v15-latin-regular.ttf +0 -0
- package/docs/fonts/roboto-v15-latin-regular.woff +0 -0
- package/docs/fonts/roboto-v15-latin-regular.woff2 +0 -0
- package/docs/graph/dependencies.svg +0 -870
- package/docs/images/compodoc-vectorise-inverted.png +0 -0
- package/docs/images/compodoc-vectorise-inverted.svg +0 -201
- package/docs/images/compodoc-vectorise.png +0 -0
- package/docs/images/compodoc-vectorise.svg +0 -201
- package/docs/images/coverage-badge-documentation.svg +0 -9
- package/docs/images/coverage-badge.svg +0 -9
- package/docs/images/favicon.ico +0 -0
- package/docs/index.html +0 -233
- package/docs/injectables/AppConfigProvider.html +0 -411
- package/docs/injectables/AuthService.html +0 -1016
- package/docs/injectables/ChatArchivedConversationsHandler.html +0 -1832
- package/docs/injectables/ChatContactsSynchronizer.html +0 -841
- package/docs/injectables/ChatConversationHandler.html +0 -1960
- package/docs/injectables/ChatConversationsHandler.html +0 -2584
- package/docs/injectables/ChatManager.html +0 -1779
- package/docs/injectables/ChatPresenceHandler.html +0 -1187
- package/docs/injectables/CustomTranslateService.html +0 -496
- package/docs/injectables/DatabaseProvider.html +0 -1444
- package/docs/injectables/GroupService.html +0 -1458
- package/docs/injectables/MessagingService.html +0 -1165
- package/docs/injectables/NavProxyService.html +0 -1028
- package/docs/injectables/TiledeskConversationProvider.html +0 -945
- package/docs/injectables/UploadService.html +0 -791
- package/docs/injectables/UserService.html +0 -1612
- package/docs/js/compodoc.js +0 -14
- package/docs/js/lazy-load-graphs.js +0 -44
- package/docs/js/libs/EventDispatcher.js +0 -5
- package/docs/js/libs/bootstrap-native.js +0 -2
- package/docs/js/libs/clipboard.min.js +0 -7
- package/docs/js/libs/custom-elements-es5-adapter.js +0 -15
- package/docs/js/libs/custom-elements.min.js +0 -38
- package/docs/js/libs/d3.v3.min.js +0 -2
- package/docs/js/libs/deep-iterator.js +0 -2
- package/docs/js/libs/es6-shim.min.js +0 -11
- package/docs/js/libs/htmlparser.js +0 -23
- package/docs/js/libs/innersvg.js +0 -9
- package/docs/js/libs/lit-html.js +0 -1
- package/docs/js/libs/prism.js +0 -14
- package/docs/js/libs/promise.min.js +0 -6
- package/docs/js/libs/svg-pan-zoom.min.js +0 -3
- package/docs/js/libs/tablesort.min.js +0 -6
- package/docs/js/libs/tablesort.number.min.js +0 -6
- package/docs/js/libs/vis.min.js +0 -46
- package/docs/js/libs/zepto.min.js +0 -2
- package/docs/js/menu-wc.js +0 -594
- package/docs/js/menu.js +0 -261
- package/docs/js/routes.js +0 -280
- package/docs/js/search/lunr.min.js +0 -6
- package/docs/js/search/search-lunr.js +0 -67
- package/docs/js/search/search.js +0 -268
- package/docs/js/search/search_index.js +0 -4
- package/docs/js/sourceCode.js +0 -58
- package/docs/js/svg-pan-zoom.controls.js +0 -53
- package/docs/js/tabs.js +0 -21
- package/docs/js/tree.js +0 -147
- package/docs/license.html +0 -664
- package/docs/miscellaneous/functions.html +0 -2417
- package/docs/miscellaneous/variables.html +0 -994
- package/docs/modules/AppModule/dependencies.svg +0 -454
- package/docs/modules/AppModule.html +0 -967
- package/docs/modules/ArchivedConversationsPageModule/dependencies.svg +0 -50
- package/docs/modules/ArchivedConversationsPageModule.html +0 -225
- package/docs/modules/DettaglioConversazionePageModule/dependencies.svg +0 -66
- package/docs/modules/DettaglioConversazionePageModule.html +0 -256
- package/docs/modules/InfoAdvancedPageModule/dependencies.svg +0 -50
- package/docs/modules/InfoAdvancedPageModule.html +0 -225
- package/docs/modules/InfoConversationPageModule/dependencies.svg +0 -50
- package/docs/modules/InfoConversationPageModule.html +0 -227
- package/docs/modules/InfoUserPageModule/dependencies.svg +0 -50
- package/docs/modules/InfoUserPageModule.html +0 -225
- package/docs/modules/ListaConversazioniPageModule/dependencies.svg +0 -66
- package/docs/modules/ListaConversazioniPageModule.html +0 -255
- package/docs/modules/LoginModule/dependencies.svg +0 -66
- package/docs/modules/LoginModule.html +0 -253
- package/docs/modules/PlaceholderPageModule/dependencies.svg +0 -66
- package/docs/modules/PlaceholderPageModule.html +0 -253
- package/docs/modules/PopoverPageModule/dependencies.svg +0 -66
- package/docs/modules/PopoverPageModule.html +0 -253
- package/docs/modules/PopoverProfilePageModule/dependencies.svg +0 -66
- package/docs/modules/PopoverProfilePageModule.html +0 -253
- package/docs/modules/ProfilePageModule/dependencies.svg +0 -66
- package/docs/modules/ProfilePageModule.html +0 -253
- package/docs/modules/RegisterModule/dependencies.svg +0 -66
- package/docs/modules/RegisterModule.html +0 -253
- package/docs/modules/ResetpwdModule/dependencies.svg +0 -66
- package/docs/modules/ResetpwdModule.html +0 -253
- package/docs/modules/UpdateImageProfilePageModule/dependencies.svg +0 -66
- package/docs/modules/UpdateImageProfilePageModule.html +0 -253
- package/docs/modules/UsersModule/dependencies.svg +0 -66
- package/docs/modules/UsersModule.html +0 -253
- package/docs/modules.html +0 -379
- package/docs/overview.html +0 -1033
- package/docs/styles/bootstrap-card.css +0 -219
- package/docs/styles/bootstrap.min.css +0 -5
- package/docs/styles/compodoc.css +0 -996
- package/docs/styles/font-awesome.min.css +0 -4
- package/docs/styles/ionicons.min.css +0 -11
- package/docs/styles/laravel.css +0 -69
- package/docs/styles/material.css +0 -109
- package/docs/styles/original.css +0 -47
- package/docs/styles/postmark.css +0 -224
- package/docs/styles/prism.css +0 -267
- package/docs/styles/readthedocs.css +0 -108
- package/docs/styles/reset.css +0 -48
- package/docs/styles/stripe.css +0 -65
- package/docs/styles/style.css +0 -7
- package/docs/styles/tablesort.css +0 -33
- package/docs/styles/vagrant.css +0 -96
- package/firebase-functions/.firebaserc +0 -5
- package/firebase-functions/firebase.json +0 -1
- package/firebase-functions/functions/index.js +0 -208
- package/firebase-functions/functions/package.json +0 -9
- package/google-services.json +0 -42
- package/hooks/README.md +0 -196
- package/resources/android/icon/drawable-hdpi-icon.png +0 -0
- package/resources/android/icon/drawable-ldpi-icon.png +0 -0
- package/resources/android/icon/drawable-mdpi-icon.png +0 -0
- package/resources/android/icon/drawable-xhdpi-icon.png +0 -0
- package/resources/android/icon/drawable-xxhdpi-icon.png +0 -0
- package/resources/android/icon/drawable-xxxhdpi-icon.png +0 -0
- package/resources/android/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/icon.png +0 -0
- package/resources/icon.png.md5 +0 -1
- package/resources/ios/icon/icon-1024.png +0 -0
- package/resources/ios/icon/icon-40.png +0 -0
- package/resources/ios/icon/icon-40@2x.png +0 -0
- package/resources/ios/icon/icon-40@3x.png +0 -0
- package/resources/ios/icon/icon-50.png +0 -0
- package/resources/ios/icon/icon-50@2x.png +0 -0
- package/resources/ios/icon/icon-60.png +0 -0
- package/resources/ios/icon/icon-60@2x.png +0 -0
- package/resources/ios/icon/icon-60@3x.png +0 -0
- package/resources/ios/icon/icon-72.png +0 -0
- package/resources/ios/icon/icon-72@2x.png +0 -0
- package/resources/ios/icon/icon-76.png +0 -0
- package/resources/ios/icon/icon-76@2x.png +0 -0
- package/resources/ios/icon/icon-83.5@2x.png +0 -0
- package/resources/ios/icon/icon-small.png +0 -0
- package/resources/ios/icon/icon-small@2x.png +0 -0
- package/resources/ios/icon/icon-small@3x.png +0 -0
- package/resources/ios/icon/icon.png +0 -0
- package/resources/ios/icon/icon@2x.png +0 -0
- package/resources/ios/splash/Default-568h@2x~iphone.png +0 -0
- package/resources/ios/splash/Default-667h.png +0 -0
- package/resources/ios/splash/Default-736h.png +0 -0
- package/resources/ios/splash/Default-Landscape-736h.png +0 -0
- package/resources/ios/splash/Default-Landscape@2x~ipad.png +0 -0
- package/resources/ios/splash/Default-Landscape@~ipadpro.png +0 -0
- package/resources/ios/splash/Default-Landscape~ipad.png +0 -0
- package/resources/ios/splash/Default-Portrait@2x~ipad.png +0 -0
- package/resources/ios/splash/Default-Portrait@~ipadpro.png +0 -0
- package/resources/ios/splash/Default-Portrait~ipad.png +0 -0
- package/resources/ios/splash/Default@2x~iphone.png +0 -0
- package/resources/ios/splash/Default@2x~universal~anyany.png +0 -0
- package/resources/ios/splash/Default~iphone.png +0 -0
- package/resources/splash.png +0 -0
- package/resources/splash.png.md5 +0 -1
- package/server.js +0 -7
- package/src/app/app.html +0 -56
- package/src/app/app.scss +0 -236
- package/src/app/main.ts +0 -9
- package/src/assets/chat-background.jpg +0 -0
- package/src/assets/chat21-ionic-pattern-2.svg +0 -5110
- package/src/assets/chat21-ionic-pattern.png +0 -0
- package/src/assets/chat21-ionic-pattern.svg +0 -1
- package/src/assets/download.svg +0 -1
- package/src/assets/dummyDump.sql +0 -1
- package/src/assets/icon/favicon_old.ico +0 -0
- package/src/assets/img/c21-down-gray.svg +0 -1
- package/src/assets/img/chat21-icon.png +0 -0
- package/src/assets/img/f21ico-attached.svg +0 -1
- package/src/assets/img/f21ico-close.svg +0 -1
- package/src/assets/img/f21ico-photo.svg +0 -1
- package/src/assets/img/ic_keyboard_arrow_down_black_24px.svg +0 -4
- package/src/assets/img/ic_keyboard_arrow_down_white_24px.svg +0 -4
- package/src/assets/img/icon.png +0 -0
- package/src/assets/message-mine.png +0 -0
- package/src/assets/message-other.png +0 -0
- package/src/assets/pling.mp3 +0 -0
- package/src/assets/splash.png +0 -0
- package/src/declarations.d.ts +0 -14
- package/src/directives/autosize/autosize.ts +0 -82
- package/src/environments/environment.pre.ts +0 -22
- package/src/environments/environment.prod.ts +0 -22
- package/src/environments/environment.ts +0 -21
- package/src/pages/_DetailPage.ts +0 -1
- package/src/pages/_MasterPage.ts +0 -1
- package/src/pages/archived-conversations/archived-conversations.html +0 -32
- package/src/pages/archived-conversations/archived-conversations.module.ts +0 -13
- package/src/pages/archived-conversations/archived-conversations.scss +0 -153
- package/src/pages/archived-conversations/archived-conversations.ts +0 -121
- package/src/pages/authentication/login/login.html +0 -58
- package/src/pages/authentication/login/login.module.ts +0 -16
- package/src/pages/authentication/login/login.scss +0 -121
- package/src/pages/authentication/login/login.ts +0 -221
- package/src/pages/authentication/register/register.html +0 -88
- package/src/pages/authentication/register/register.module.ts +0 -16
- package/src/pages/authentication/register/register.scss +0 -95
- package/src/pages/authentication/register/register.ts +0 -122
- package/src/pages/authentication/resetpwd/resetpwd.html +0 -40
- package/src/pages/authentication/resetpwd/resetpwd.module.ts +0 -16
- package/src/pages/authentication/resetpwd/resetpwd.scss +0 -102
- package/src/pages/authentication/resetpwd/resetpwd.ts +0 -93
- package/src/pages/components/chatBubble_old/chatBubble.scss +0 -83
- package/src/pages/components/chatBubble_old/chatBubble.ts +0 -30
- package/src/pages/components/elasticTextarea_old.ts +0 -46
- package/src/pages/dettaglio-conversazione/dettaglio-conversazione.html +0 -261
- package/src/pages/dettaglio-conversazione/dettaglio-conversazione.module.ts +0 -19
- package/src/pages/dettaglio-conversazione/dettaglio-conversazione.scss +0 -701
- package/src/pages/dettaglio-conversazione/dettaglio-conversazione.ts +0 -1395
- package/src/pages/index.ts +0 -5
- package/src/pages/info-advanced/info-advanced.html +0 -90
- package/src/pages/info-advanced/info-advanced.module.ts +0 -13
- package/src/pages/info-advanced/info-advanced.scss +0 -196
- package/src/pages/info-advanced/info-advanced.ts +0 -44
- package/src/pages/info-conversation/info-conversation.html +0 -225
- package/src/pages/info-conversation/info-conversation.module.ts +0 -15
- package/src/pages/info-conversation/info-conversation.scss +0 -444
- package/src/pages/info-conversation/info-conversation.ts +0 -1233
- package/src/pages/info-message/info-message.html +0 -74
- package/src/pages/info-message/info-message.module.ts +0 -13
- package/src/pages/info-message/info-message.scss +0 -216
- package/src/pages/info-message/info-message.ts +0 -89
- package/src/pages/info-user/info-user.html +0 -89
- package/src/pages/info-user/info-user.module.ts +0 -13
- package/src/pages/info-user/info-user.scss +0 -187
- package/src/pages/info-user/info-user.ts +0 -177
- package/src/pages/lista-conversazioni/lista-conversazioni.html +0 -88
- package/src/pages/lista-conversazioni/lista-conversazioni.module.ts +0 -18
- package/src/pages/lista-conversazioni/lista-conversazioni.scss +0 -245
- package/src/pages/lista-conversazioni/lista-conversazioni.ts +0 -736
- package/src/pages/placeholder/placeholder.html +0 -3
- package/src/pages/placeholder/placeholder.module.ts +0 -16
- package/src/pages/placeholder/placeholder.scss +0 -23
- package/src/pages/placeholder/placeholder.ts +0 -18
- package/src/pages/popover/popover.html +0 -27
- package/src/pages/popover/popover.module.ts +0 -16
- package/src/pages/popover/popover.scss +0 -23
- package/src/pages/popover/popover.ts +0 -95
- package/src/pages/popover-profile/popover-profile.html +0 -20
- package/src/pages/popover-profile/popover-profile.module.ts +0 -16
- package/src/pages/popover-profile/popover-profile.scss +0 -10
- package/src/pages/popover-profile/popover-profile.ts +0 -40
- package/src/pages/profile/profile.html +0 -54
- package/src/pages/profile/profile.module.ts +0 -16
- package/src/pages/profile/profile.scss +0 -45
- package/src/pages/profile/profile.ts +0 -108
- package/src/pages/update-image-profile/update-image-profile.html +0 -39
- package/src/pages/update-image-profile/update-image-profile.module.ts +0 -16
- package/src/pages/update-image-profile/update-image-profile.scss +0 -50
- package/src/pages/update-image-profile/update-image-profile.ts +0 -111
- package/src/pages/users/users.html +0 -55
- package/src/pages/users/users.module.ts +0 -16
- package/src/pages/users/users.scss +0 -10
- package/src/pages/users/users.ts +0 -222
- package/src/providers/app-config/app-config.ts +0 -33
- package/src/providers/auth-service.ts +0 -140
- package/src/providers/canned-responses-service/canned-responses-service.ts +0 -57
- package/src/providers/chat-archived-conversations-handler.ts +0 -283
- package/src/providers/chat-contacts-synchronizer.ts +0 -179
- package/src/providers/chat-conversation-handler.ts +0 -547
- package/src/providers/chat-conversations-handler.ts +0 -519
- package/src/providers/chat-manager/chat-manager.ts +0 -246
- package/src/providers/chat-presence-handler.ts +0 -188
- package/src/providers/database/database.ts +0 -214
- package/src/providers/group/group.ts +0 -243
- package/src/providers/messaging-service.ts +0 -267
- package/src/providers/nav-proxy.ts +0 -104
- package/src/providers/tiledesk-conversation/tiledesk-conversation.ts +0 -134
- package/src/providers/translate-service.ts +0 -61
- package/src/providers/upload-service/upload-service.ts +0 -117
- package/src/providers/user/user.ts +0 -320
- package/src/service-worker.js +0 -30
- package/src/utils/constants.ts +0 -73
- package/src/utils/utils.ts +0 -548
- package/src/videochat.php +0 -20
|
@@ -0,0 +1,1032 @@
|
|
|
1
|
+
import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
|
|
2
|
+
import { Component, OnInit, ViewChild } from '@angular/core';
|
|
3
|
+
import { IonContent, ModalController } from '@ionic/angular';
|
|
4
|
+
import { ActivatedRoute, Router, NavigationExtras } from '@angular/router';
|
|
5
|
+
// config
|
|
6
|
+
import { environment } from '../../../environments/environment';
|
|
7
|
+
|
|
8
|
+
// models
|
|
9
|
+
import { ConversationModel } from 'src/chat21-core/models/conversation';
|
|
10
|
+
import { UserModel } from 'src/chat21-core/models/user';
|
|
11
|
+
|
|
12
|
+
// utils
|
|
13
|
+
import { isInArray, checkPlatformIsMobile, presentModal, closeModal, convertMessage, isGroup, } from '../../../chat21-core/utils/utils';
|
|
14
|
+
|
|
15
|
+
import { EventsService } from '../../services/events-service';
|
|
16
|
+
import PerfectScrollbar from 'perfect-scrollbar'; // https://github.com/mdbootstrap/perfect-scrollbar
|
|
17
|
+
|
|
18
|
+
// services
|
|
19
|
+
import { ConversationsHandlerService } from 'src/chat21-core/providers/abstract/conversations-handler.service';
|
|
20
|
+
import { ChatManager } from 'src/chat21-core/providers/chat-manager';
|
|
21
|
+
import { NavProxyService } from '../../services/nav-proxy.service';
|
|
22
|
+
import { TiledeskService } from '../../services/tiledesk/tiledesk.service';
|
|
23
|
+
import { ConversationDetailPage } from '../conversation-detail/conversation-detail.page';
|
|
24
|
+
import { ContactsDirectoryPage } from '../contacts-directory/contacts-directory.page';
|
|
25
|
+
import { UnassignedConversationsPage } from '../unassigned-conversations/unassigned-conversations.page';
|
|
26
|
+
import { ProfileInfoPage } from '../profile-info/profile-info.page';
|
|
27
|
+
import { MessagingAuthService } from 'src/chat21-core/providers/abstract/messagingAuth.service';
|
|
28
|
+
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
29
|
+
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
|
|
30
|
+
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
31
|
+
import { AppConfigProvider } from '../../services/app-config';
|
|
32
|
+
import { Subscription } from 'rxjs';
|
|
33
|
+
import { Platform } from '@ionic/angular';
|
|
34
|
+
// Logger
|
|
35
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
36
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
37
|
+
import { NetworkService } from 'src/app/services/network-service/network.service';
|
|
38
|
+
import { Subject } from 'rxjs';
|
|
39
|
+
import { takeUntil } from 'rxjs/operators'
|
|
40
|
+
|
|
41
|
+
@Component({
|
|
42
|
+
selector: 'app-conversations-list',
|
|
43
|
+
templateUrl: './conversations-list.page.html',
|
|
44
|
+
styleUrls: ['./conversations-list.page.scss'],
|
|
45
|
+
})
|
|
46
|
+
export class ConversationListPage implements OnInit {
|
|
47
|
+
|
|
48
|
+
@ViewChild('ioncontentconvlist', { static: false }) ionContentConvList: IonContent;
|
|
49
|
+
|
|
50
|
+
private unsubscribe$: Subject<any> = new Subject<any>();
|
|
51
|
+
private subscriptions: Array<string>;
|
|
52
|
+
public tenant: string;
|
|
53
|
+
public loggedUserUid: string;
|
|
54
|
+
public conversations: Array<ConversationModel> = [];
|
|
55
|
+
public archivedConversations: Array<ConversationModel> = [];
|
|
56
|
+
public uidConvSelected: string;
|
|
57
|
+
public conversationSelected: ConversationModel;
|
|
58
|
+
public uidReciverFromUrl: string;
|
|
59
|
+
public showPlaceholder = true;
|
|
60
|
+
public numberOpenConv = 0;
|
|
61
|
+
public loadingIsActive = true;
|
|
62
|
+
public supportMode: boolean;
|
|
63
|
+
|
|
64
|
+
public convertMessage = convertMessage;
|
|
65
|
+
private isShowMenuPage = false;
|
|
66
|
+
private logger: LoggerService = LoggerInstance.getInstance();
|
|
67
|
+
translationMapConversation: Map<string, string>;
|
|
68
|
+
stylesMap: Map<string, string>;
|
|
69
|
+
|
|
70
|
+
public conversationType = 'active'
|
|
71
|
+
headerTitle: string;
|
|
72
|
+
subscription: Subscription;
|
|
73
|
+
|
|
74
|
+
public UNASSIGNED_CONVS_URL: any;
|
|
75
|
+
public hasClickedOpenUnservedConvIframe: boolean = false;
|
|
76
|
+
public lastProjectId: string;
|
|
77
|
+
public isOnline: boolean = true;
|
|
78
|
+
public checkInternet: boolean;
|
|
79
|
+
|
|
80
|
+
public displayNewConvsItem: boolean = true
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
constructor(
|
|
85
|
+
private router: Router,
|
|
86
|
+
private route: ActivatedRoute,
|
|
87
|
+
private navService: NavProxyService,
|
|
88
|
+
public events: EventsService,
|
|
89
|
+
public modalController: ModalController,
|
|
90
|
+
// public databaseProvider: DatabaseProvider,
|
|
91
|
+
public conversationsHandlerService: ConversationsHandlerService,
|
|
92
|
+
public archivedConversationsHandlerService: ArchivedConversationsHandlerService,
|
|
93
|
+
public chatManager: ChatManager,
|
|
94
|
+
public messagingAuthService: MessagingAuthService,
|
|
95
|
+
public imageRepoService: ImageRepoService,
|
|
96
|
+
private translateService: CustomTranslateService,
|
|
97
|
+
public tiledeskService: TiledeskService,
|
|
98
|
+
public tiledeskAuthService: TiledeskAuthService,
|
|
99
|
+
public appConfigProvider: AppConfigProvider,
|
|
100
|
+
public platform: Platform,
|
|
101
|
+
private networkService: NetworkService,
|
|
102
|
+
|
|
103
|
+
) {
|
|
104
|
+
this.listenToAppCompConvsLengthOnInitConvs();
|
|
105
|
+
this.listenToLogoutEvent();
|
|
106
|
+
this.listenGoOnline();
|
|
107
|
+
this.listenGoOffline();
|
|
108
|
+
this.listenToSwPostMessage();
|
|
109
|
+
this.listenSupportConvIdHasChanged();
|
|
110
|
+
// this.listenDirectConvIdHasChanged();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
listenSupportConvIdHasChanged() {
|
|
114
|
+
this.events.subscribe('supportconvid:haschanged', (IDConv) => {
|
|
115
|
+
this.logger.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - convId', IDConv);
|
|
116
|
+
if (IDConv) {
|
|
117
|
+
// const conversationSelected = this.conversations.find(item => item.uid === convId);
|
|
118
|
+
// this.onConversationSelected(conversationSelected)
|
|
119
|
+
this.setUidConvSelected(IDConv, 'active');
|
|
120
|
+
}
|
|
121
|
+
if (!IDConv) {
|
|
122
|
+
this.logger.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - is the page without conv select');
|
|
123
|
+
|
|
124
|
+
const chatTabCount = +localStorage.getItem('tabCount')
|
|
125
|
+
this.logger.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - chatTabCount ', chatTabCount);
|
|
126
|
+
if (chatTabCount && chatTabCount > 0) {
|
|
127
|
+
this.logger.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - the chat is already open ', chatTabCount);
|
|
128
|
+
if (checkPlatformIsMobile()) {
|
|
129
|
+
this.logger.log('[CONVS-LIST-PAGE] - the chat is in mobile mode ', checkPlatformIsMobile());
|
|
130
|
+
this.events.publish('noparams:mobile', true);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// listenDirectConvIdHasChanged() {
|
|
138
|
+
// this.events.subscribe('directconvid:haschanged', (contact_id) => {
|
|
139
|
+
// // console.log('[CONVS-LIST-PAGE] - listen To directconvid:haschanged - contact_id', contact_id);
|
|
140
|
+
// if (contact_id) {
|
|
141
|
+
// this.uidConvSelected = contact_id
|
|
142
|
+
// }
|
|
143
|
+
// });
|
|
144
|
+
// }
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
// -----------------------------------------------
|
|
148
|
+
// @ Lifehooks
|
|
149
|
+
// -----------------------------------------------
|
|
150
|
+
ngOnInit() {
|
|
151
|
+
this.watchToConnectionStatus();
|
|
152
|
+
this.getSupportMode();
|
|
153
|
+
|
|
154
|
+
// const currentUrl = this.router.url;
|
|
155
|
+
// this.logger.log('[CONVS-LIST-PAGE] current_url ngOnInit ', currentUrl);
|
|
156
|
+
// this.route.queryParams.subscribe(params => {
|
|
157
|
+
// this.logger.log('[CONVS-LIST-PAGE] ngOnInit params', params);
|
|
158
|
+
// if (params && params.convId) {
|
|
159
|
+
// console.log('[CONVS-LIST-PAGE] ngOnInit params convId:', params.convId);
|
|
160
|
+
|
|
161
|
+
// const conversationSelected = this.conversations.find(item => item.uid === params.convId);
|
|
162
|
+
// if (conversationSelected) {
|
|
163
|
+
// this.conversationSelected = conversationSelected;
|
|
164
|
+
// console.log('[CONVS-LIST-PAGE] ngOnInit params convselected - conversationSelected: ', this.conversationSelected);
|
|
165
|
+
// setTimeout(() => {
|
|
166
|
+
// // this.navigateByUrl('active', params.convId)
|
|
167
|
+
// }, 0);
|
|
168
|
+
// }
|
|
169
|
+
|
|
170
|
+
// } else {
|
|
171
|
+
// console.log('[CONVS-LIST-PAGE] ngOnInit params No convId Params ');
|
|
172
|
+
// }
|
|
173
|
+
// if (params && params.contact_id && params.contact_fullname) {
|
|
174
|
+
// this.logger.log('[CONVS-LIST-PAGE] ngOnInit params contact_id:', params.contact_id, 'contact_fullname ', params.contact_fullname);
|
|
175
|
+
// setTimeout(() => {
|
|
176
|
+
// this.router.navigateByUrl('conversation-detail/' + params.contact_id + '/' + params.contact_fullname + '/new');
|
|
177
|
+
// }, 0);
|
|
178
|
+
// this.uidConvSelected = params.contact_id
|
|
179
|
+
// } else {
|
|
180
|
+
// this.logger.log('[CONVS-LIST-PAGE] ngOnInit params No contact_id and contact_fullname Params ');
|
|
181
|
+
// }
|
|
182
|
+
|
|
183
|
+
// if (params && params.conversation_detail) {
|
|
184
|
+
// this.logger.log('[CONVS-LIST-PAGE] ngOnInit params conversation_detail:', params.conversation_detail);
|
|
185
|
+
// setTimeout(() => {
|
|
186
|
+
// this.router.navigateByUrl('conversation-detail/');
|
|
187
|
+
// }, 0);
|
|
188
|
+
// } else {
|
|
189
|
+
// this.logger.log('[CONVS-LIST-PAGE] ngOnInit params No conversation_detail Params ');
|
|
190
|
+
// }
|
|
191
|
+
|
|
192
|
+
// });
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
getSupportMode() {
|
|
198
|
+
this.supportMode = this.appConfigProvider.getConfig().supportMode;
|
|
199
|
+
// console.log('[ION-LIST-CONVS-COMP] - supportMode ', this.supportMode)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
watchToConnectionStatus() {
|
|
203
|
+
this.networkService.checkInternetFunc().subscribe(isOnline => {
|
|
204
|
+
this.checkInternet = isOnline
|
|
205
|
+
this.logger.log('[ION-LIST-CONVS-COMP] - watchToConnectionStatus - isOnline', this.checkInternet)
|
|
206
|
+
|
|
207
|
+
// checking internet connection
|
|
208
|
+
if (this.checkInternet == true) {
|
|
209
|
+
|
|
210
|
+
this.isOnline = true;
|
|
211
|
+
} else {
|
|
212
|
+
this.isOnline = false;
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
ionViewWillEnter() {
|
|
219
|
+
this.logger.log('Called ionViewDidEnter')
|
|
220
|
+
this.logger.log('[CONVS-LIST-PAGE] ionViewWillEnter uidConvSelected', this.uidConvSelected);
|
|
221
|
+
this.listnerStart();
|
|
222
|
+
|
|
223
|
+
// exit from app with hardware back button
|
|
224
|
+
this.subscription = this.platform.backButton.subscribe(() => {
|
|
225
|
+
navigator['app'].exitApp();
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// unsubscribe backButton.subscribe method to not use from other page
|
|
230
|
+
ionViewWillLeave() {
|
|
231
|
+
this.logger.log('Called ionViewWillLeave')
|
|
232
|
+
this.subscription.unsubscribe();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
ionViewDidEnter() { }
|
|
236
|
+
|
|
237
|
+
getLastProjectId(projectid: string) {
|
|
238
|
+
this.logger.log('[CONVS-LIST-PAGE] - GET LAST PROJECT ID', projectid);
|
|
239
|
+
this.lastProjectId = projectid;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
openUnsevedConversationIframe() {
|
|
243
|
+
this.hasClickedOpenUnservedConvIframe = true
|
|
244
|
+
this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME', this.hasClickedOpenUnservedConvIframe);
|
|
245
|
+
const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl;
|
|
246
|
+
this.UNASSIGNED_CONVS_URL = DASHBOARD_BASE_URL + '#/project/' + this.lastProjectId + '/unserved-request-for-panel';
|
|
247
|
+
this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL', this.UNASSIGNED_CONVS_URL);
|
|
248
|
+
this.openUnassignedConversations(this.UNASSIGNED_CONVS_URL)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// ---------------------------------------------------------
|
|
252
|
+
// Opens the Unassigned Conversations iframe
|
|
253
|
+
// ---------------------------------------------------------
|
|
254
|
+
openUnassignedConversations(UNASSIGNED_CONVS_URL) {
|
|
255
|
+
|
|
256
|
+
if (checkPlatformIsMobile()) {
|
|
257
|
+
presentModal(this.modalController, UnassignedConversationsPage, { unassigned_convs_url: UNASSIGNED_CONVS_URL });
|
|
258
|
+
} else {
|
|
259
|
+
this.navService.push(UnassignedConversationsPage, { unassigned_convs_url: UNASSIGNED_CONVS_URL });
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
_closeContactsDirectory() {
|
|
264
|
+
try {
|
|
265
|
+
closeModal(this.modalController);
|
|
266
|
+
} catch (err) {
|
|
267
|
+
this.logger.error('[CONVS-LIST-PAGE] closeContactsDirectory -> error:', err);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
listenToSwPostMessage() {
|
|
273
|
+
this.logger.log('[CONVS-LIST-PAGE] listenToNotificationCLick - CALLED: ');
|
|
274
|
+
const that = this;
|
|
275
|
+
if (navigator && navigator.serviceWorker) {
|
|
276
|
+
|
|
277
|
+
navigator.serviceWorker.addEventListener('message', function (event) {
|
|
278
|
+
|
|
279
|
+
that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data: ', event.data);
|
|
280
|
+
that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data: ', event.data['data']);
|
|
281
|
+
that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data typeof: ', typeof event.data['data']);
|
|
282
|
+
let uidConvSelected = ''
|
|
283
|
+
if (event.data && event.data['conversWith']) {
|
|
284
|
+
uidConvSelected = event.data['conversWith'];
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - DIFFERENT MSG');
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event dataObjct uidConvSelected: ', uidConvSelected);
|
|
292
|
+
that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker that.conversations: ', that.conversations);
|
|
293
|
+
const conversationSelected = that.conversations.find(item => item.uid === uidConvSelected);
|
|
294
|
+
if (conversationSelected) {
|
|
295
|
+
|
|
296
|
+
that.conversationSelected = conversationSelected;
|
|
297
|
+
that.logger.log('[CONVS-LIST-PAGE] listenToNotificationCLick- Received a message from service worker event conversationSelected: ', that.conversationSelected);
|
|
298
|
+
|
|
299
|
+
that.navigateByUrl('active', uidConvSelected)
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
private listnerStart() {
|
|
307
|
+
const that = this;
|
|
308
|
+
this.chatManager.BSStart
|
|
309
|
+
.pipe(
|
|
310
|
+
takeUntil(that.unsubscribe$)
|
|
311
|
+
)
|
|
312
|
+
.subscribe((data: any) => {
|
|
313
|
+
this.logger.log('[CONVS-LIST-PAGE] - BSStart SUBSCR DATA - Current user *****', data);
|
|
314
|
+
if (data) {
|
|
315
|
+
that.initialize();
|
|
316
|
+
}
|
|
317
|
+
}, error => {
|
|
318
|
+
this.logger.error('[CONVS-LIST-PAGE] - BSStart SUBSCR - ERROR: ', error);
|
|
319
|
+
}, () => {
|
|
320
|
+
this.logger.log('[CONVS-LIST-PAGE] - BSStart SUBSCR * COMPLETE *')
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
// ------------------------------------------------------------------ //
|
|
326
|
+
// Init convrsation handler
|
|
327
|
+
// ------------------------------------------------------------------ //
|
|
328
|
+
initConversationsHandler() {
|
|
329
|
+
this.conversations = this.conversationsHandlerService.conversations;
|
|
330
|
+
this.logger.log('[CONVS-LIST-PAGE] - CONVERSATIONS ', this.conversations)
|
|
331
|
+
// save conversationHandler in chatManager
|
|
332
|
+
this.chatManager.setConversationsHandler(this.conversationsHandlerService);
|
|
333
|
+
this.showPlaceholder = false;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
initArchivedConversationsHandler() {
|
|
339
|
+
const keysConversation = ['CLOSED'];
|
|
340
|
+
this.translationMapConversation = this.translateService.translateLanguage(keysConversation);
|
|
341
|
+
|
|
342
|
+
this.archivedConversationsHandlerService.subscribeToConversations(() => {
|
|
343
|
+
this.logger.log('[CONVS-LIST-PAGE]-CONVS - conversations archived length ', this.archivedConversations.length)
|
|
344
|
+
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
this.archivedConversations = this.archivedConversationsHandlerService.archivedConversations;
|
|
348
|
+
this.logger.log('[CONVS-LIST-PAGE] archived conversation', this.archivedConversations)
|
|
349
|
+
|
|
350
|
+
// save archivedConversationsHandlerService in chatManager
|
|
351
|
+
this.chatManager.setArchivedConversationsHandler(this.archivedConversationsHandlerService);
|
|
352
|
+
|
|
353
|
+
this.logger.log('[CONVS-LIST-PAGE]-CONVS SubscribeToConversations - conversations archived length ', this.archivedConversations.length)
|
|
354
|
+
if (!this.archivedConversations || this.archivedConversations.length === 0) {
|
|
355
|
+
this.loadingIsActive = false;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
// ----------------------------------------------------------------------------------------------------
|
|
361
|
+
// To display "No conversation yet" MESSAGE in conversazion list
|
|
362
|
+
// this.loadingIsActive is set to false only if on init there are not conversation
|
|
363
|
+
// otherwise loadingIsActive remains set to true and the message "No conversation yet" is not displayed
|
|
364
|
+
// to fix this
|
|
365
|
+
// - for the direct conversation
|
|
366
|
+
// ----------------------------------------------------------------------------------------------------
|
|
367
|
+
listenToAppCompConvsLengthOnInitConvs() {
|
|
368
|
+
this.events.subscribe('appcompSubscribeToConvs:loadingIsActive', (loadingIsActive) => {
|
|
369
|
+
this.logger.log('[CONVS-LIST-PAGE]-CONVS loadingIsActive', loadingIsActive);
|
|
370
|
+
if (loadingIsActive === false) {
|
|
371
|
+
this.loadingIsActive = false
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
listenGoOnline() {
|
|
377
|
+
this.events.subscribe('go:online', (goonline) => {
|
|
378
|
+
this.logger.info('[CONVS-LIST-PAGE] - listen To go:online - goonline', goonline);
|
|
379
|
+
// this.events.unsubscribe('profileInfoButtonClick:logout')
|
|
380
|
+
if (goonline === true) {
|
|
381
|
+
this.displayNewConvsItem = true
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
listenGoOffline() {
|
|
387
|
+
|
|
388
|
+
this.events.subscribe('go:offline', (offline) => {
|
|
389
|
+
this.logger.info('[CONVS-LIST-PAGE] - listen To go:offline - offline', offline);
|
|
390
|
+
// this.events.unsubscribe('profileInfoButtonClick:logout')
|
|
391
|
+
if (offline === true) {
|
|
392
|
+
this.displayNewConvsItem = false
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
listenToLogoutEvent() {
|
|
398
|
+
this.events.subscribe('profileInfoButtonClick:logout', (hasclickedlogout) => {
|
|
399
|
+
this.logger.info('[CONVS-LIST-PAGE] - listenToLogoutEvent - hasclickedlogout', hasclickedlogout);
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
this.conversations = []
|
|
403
|
+
this.conversationsHandlerService.conversations = [];
|
|
404
|
+
this.uidConvSelected = null;
|
|
405
|
+
|
|
406
|
+
this.logger.log('[CONVS-LIST-PAGE] - listenToLogoutEvent - CONVERSATIONS ', this.conversations)
|
|
407
|
+
this.logger.log('[CONVS-LIST-PAGE] - listenToLogoutEvent - uidConvSelected ', this.uidConvSelected)
|
|
408
|
+
if (hasclickedlogout === true) {
|
|
409
|
+
this.loadingIsActive = false
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
// ------------------------------------------------------------------
|
|
416
|
+
// SUBSCRIPTIONS
|
|
417
|
+
// ------------------------------------------------------------------
|
|
418
|
+
initSubscriptions() {
|
|
419
|
+
this.logger.log('[CONVS-LIST-PAGE] - CALLING - initSubscriptions ')
|
|
420
|
+
let key = '';
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
key = 'loggedUser:logout';
|
|
424
|
+
if (!isInArray(key, this.subscriptions)) {
|
|
425
|
+
this.subscriptions.push(key);
|
|
426
|
+
this.events.subscribe(key, this.subscribeLoggedUserLogout);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// key = 'readAllMessages';
|
|
430
|
+
// if (!isInArray(key, this.subscriptions)) {
|
|
431
|
+
// this.subscriptions.push(key);
|
|
432
|
+
// this.events.subscribe(key, this.readAllMessages);
|
|
433
|
+
// }
|
|
434
|
+
|
|
435
|
+
key = 'profileInfoButtonClick:changed';
|
|
436
|
+
if (!isInArray(key, this.subscriptions)) {
|
|
437
|
+
this.subscriptions.push(key);
|
|
438
|
+
this.events.subscribe(key, this.subscribeProfileInfoButtonClicked);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// this.conversationsHandlerService.readAllMessages.subscribe((conversationId: string) => {
|
|
442
|
+
// this.logger.log('[CONVS-LIST-PAGE] ***** readAllMessages *****', conversationId);
|
|
443
|
+
// this.readAllMessages(conversationId);
|
|
444
|
+
// });
|
|
445
|
+
|
|
446
|
+
this.conversationsHandlerService.conversationAdded.subscribe((conversation: ConversationModel) => {
|
|
447
|
+
// this.logger.log('[CONVS-LIST-PAGE] ***** conversationsAdded *****', conversation);
|
|
448
|
+
// that.conversationsChanged(conversations);
|
|
449
|
+
if (conversation) {
|
|
450
|
+
this.onImageLoaded(conversation)
|
|
451
|
+
this.onConversationLoaded(conversation)
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
this.conversationsHandlerService.conversationChanged.subscribe((conversation: ConversationModel) => {
|
|
456
|
+
// this.logger.log('[CONVS-LIST-PAGE] ***** subscribeConversationChanged *****', conversation);
|
|
457
|
+
// that.conversationsChanged(conversations)
|
|
458
|
+
if (conversation) {
|
|
459
|
+
this.onImageLoaded(conversation)
|
|
460
|
+
this.onConversationLoaded(conversation)
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
this.conversationsHandlerService.conversationRemoved.subscribe((conversation: ConversationModel) => {
|
|
465
|
+
this.logger.log('[CONVS-LIST-PAGE] ***** conversationsRemoved *****', conversation);
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
this.archivedConversationsHandlerService.archivedConversationAdded.subscribe((conversation: ConversationModel) => {
|
|
469
|
+
this.logger.log('[CONVS-LIST-PAGE] ***** archivedConversationAdded *****', conversation);
|
|
470
|
+
// that.conversationsChanged(conversations);
|
|
471
|
+
if (conversation) {
|
|
472
|
+
this.onImageLoaded(conversation)
|
|
473
|
+
this.onConversationLoaded(conversation)
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// ------------------------------------------------------------------------------------
|
|
479
|
+
// @ SUBSCRIBE TO LOGGED USER LOGOUT ??????????? SEEMS NOT USED ?????????????????
|
|
480
|
+
// ------------------------------------------------------------------------------------
|
|
481
|
+
subscribeLoggedUserLogout = () => {
|
|
482
|
+
this.conversations = [];
|
|
483
|
+
this.uidConvSelected = null;
|
|
484
|
+
this.logger.log('[CONVS-LIST-PAGE] - subscribeLoggedUserLogout conversations ', this.conversations);
|
|
485
|
+
this.logger.log('[CONVS-LIST-PAGE] - subscribeLoggedUserLogout uidConvSelected ', this.uidConvSelected);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
// ------------------------------------------------------------------------------------
|
|
491
|
+
// @ SUBSCRIBE TO CONVERSATION CHANGED ??????????? SEEMS NOT USED ?????????????????
|
|
492
|
+
// ------------------------------------------------------------------------------------
|
|
493
|
+
conversationsChanged = (conversations: ConversationModel[]) => {
|
|
494
|
+
this.numberOpenConv = this.conversationsHandlerService.countIsNew();
|
|
495
|
+
this.logger.log('[CONVS-LIST-PAGE] - conversationsChanged - NUMB OF CONVERSATIONS: ', this.numberOpenConv);
|
|
496
|
+
// console.log('conversationsChanged »»»»»»»»» uidConvSelected', that.conversations[0], that.uidConvSelected);
|
|
497
|
+
if (this.uidConvSelected && !this.conversationSelected) {
|
|
498
|
+
const conversationSelected = this.conversations.find(item => item.uid === this.uidConvSelected);
|
|
499
|
+
if (conversationSelected) {
|
|
500
|
+
this.conversationSelected = conversationSelected;
|
|
501
|
+
this.setUidConvSelected(this.uidConvSelected);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* ::: subscribeChangedConversationSelected :::
|
|
509
|
+
* evento richiamato quando si seleziona un utente nell'elenco degli user
|
|
510
|
+
* apro dettaglio conversazione
|
|
511
|
+
*/
|
|
512
|
+
// --------------------------------
|
|
513
|
+
// !!!!!! IS USED? ?????
|
|
514
|
+
// ------------------------------
|
|
515
|
+
subscribeChangedConversationSelected = (user: UserModel, type: string) => {
|
|
516
|
+
this.logger.log('[CONVS-LIST-PAGE] ************** subscribeUidConvSelectedChanged navigateByUrl', user, type);
|
|
517
|
+
this.uidConvSelected = user.uid;
|
|
518
|
+
this.logger.log('[CONVS-LIST-PAGE] ************** uidConvSelected ', this.uidConvSelected);
|
|
519
|
+
// this.conversationsHandlerService.uidConvSelected = user.uid;
|
|
520
|
+
const conversationSelected = this.conversations.find(item => item.uid === this.uidConvSelected);
|
|
521
|
+
if (conversationSelected) {
|
|
522
|
+
this.logger.log('[CONVS-LIST-PAGE] --> uidConvSelected: ', this.conversationSelected, this.uidConvSelected);
|
|
523
|
+
this.conversationSelected = conversationSelected;
|
|
524
|
+
}
|
|
525
|
+
// this.router.navigateByUrl('conversation-detail/' + user.uid + '?conversationWithFullname=' + user.fullname);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* ::: subscribeProfileInfoButtonClicked :::
|
|
530
|
+
* evento richiamato quando si seleziona bottone profile-info-modal
|
|
531
|
+
*/
|
|
532
|
+
subscribeProfileInfoButtonClicked = (event: string) => {
|
|
533
|
+
this.logger.log('[CONVS-LIST-PAGE] ************** subscribeProfileInfoButtonClicked: ', event);
|
|
534
|
+
if (event === 'displayArchived') {
|
|
535
|
+
this.initArchivedConversationsHandler();
|
|
536
|
+
// this.openArchivedConversationsModal()
|
|
537
|
+
this.conversationType = 'archived'
|
|
538
|
+
|
|
539
|
+
// let storedArchivedConv = localStorage.getItem('activeConversationSelected');
|
|
540
|
+
const keys = ['LABEL_ARCHIVED'];
|
|
541
|
+
this.headerTitle = this.translateService.translateLanguage(keys).get(keys[0]);
|
|
542
|
+
|
|
543
|
+
} else if (event === 'displayContact') {
|
|
544
|
+
this.conversationType = 'archived'
|
|
545
|
+
const keys = ['LABEL_CONTACTS'];
|
|
546
|
+
this.headerTitle = this.translateService.translateLanguage(keys).get(keys[0]);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
onBackButtonFN(event) {
|
|
551
|
+
this.conversationType = 'active'
|
|
552
|
+
|
|
553
|
+
// let storedActiveConv = localStorage.getItem('activeConversationSelected');
|
|
554
|
+
// // console.log('ConversationListPage - storedActiveConv: ', storedActiveConv);
|
|
555
|
+
// if (storedActiveConv) {
|
|
556
|
+
// let storedActiveConvObjct = JSON.parse(storedActiveConv)
|
|
557
|
+
// console.log('ConversationListPage - storedActiveConv Objct: ', storedActiveConvObjct);
|
|
558
|
+
// this.navigateByUrl('active', storedActiveConvObjct.uid)
|
|
559
|
+
// } else {
|
|
560
|
+
// // da implementare se nn c'è stata nessuna conv attive selezionata
|
|
561
|
+
// }
|
|
562
|
+
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
// ------------------------------------------------------------------//
|
|
567
|
+
// END SUBSCRIPTIONS
|
|
568
|
+
// ------------------------------------------------------------------//
|
|
569
|
+
|
|
570
|
+
// :: handler degli eventi in output per i componenti delle modali
|
|
571
|
+
// ::::: vedi ARCHIVED-CONVERSATION-LIST --> MODALE
|
|
572
|
+
// initHandlerEventEmitter() {
|
|
573
|
+
// this.onConversationSelectedHandler.subscribe(conversation => {
|
|
574
|
+
// console.log('ConversationListPage - onversaation selectedddd', conversation)
|
|
575
|
+
// this.onConversationSelected(conversation)
|
|
576
|
+
// })
|
|
577
|
+
|
|
578
|
+
// this.onImageLoadedHandler.subscribe(conversation => {
|
|
579
|
+
// this.onImageLoaded(conversation)
|
|
580
|
+
// })
|
|
581
|
+
|
|
582
|
+
// this.onConversationLoadedHandler.subscribe(conversation => {
|
|
583
|
+
// this.onConversationLoaded(conversation)
|
|
584
|
+
// })
|
|
585
|
+
// }
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
// ------------------------------------------------------------------//
|
|
590
|
+
// BEGIN FUNCTIONS
|
|
591
|
+
// ------------------------------------------------------------------//
|
|
592
|
+
/**
|
|
593
|
+
* ::: initialize :::
|
|
594
|
+
*/
|
|
595
|
+
initialize() {
|
|
596
|
+
const appconfig = this.appConfigProvider.getConfig();
|
|
597
|
+
this.tenant = appconfig.firebaseConfig.tenant;
|
|
598
|
+
this.logger.log('[CONVS-LIST-PAGE] - initialize -> firebaseConfig tenant ', this.tenant);
|
|
599
|
+
|
|
600
|
+
if (this.tiledeskAuthService.getCurrentUser()) {
|
|
601
|
+
this.loggedUserUid = this.tiledeskAuthService.getCurrentUser().uid;
|
|
602
|
+
}
|
|
603
|
+
this.subscriptions = [];
|
|
604
|
+
this.initConversationsHandler();
|
|
605
|
+
this.initVariables();
|
|
606
|
+
this.initSubscriptions();
|
|
607
|
+
|
|
608
|
+
// this.initHandlerEventEmitter();
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* ::: initVariables :::
|
|
614
|
+
* al caricamento della pagina:
|
|
615
|
+
* setto BUILD_VERSION prendendo il valore da PACKAGE
|
|
616
|
+
* recupero conversationWith -
|
|
617
|
+
* se vengo da dettaglio conversazione o da users con conversazione attiva ???? sarà sempre undefined da spostare in ionViewDidEnter
|
|
618
|
+
* recupero tenant
|
|
619
|
+
* imposto recipient se esiste nei parametri passati nell'url
|
|
620
|
+
* imposto uidConvSelected recuperando id ultima conversazione aperta dallo storage
|
|
621
|
+
*/
|
|
622
|
+
// --------------------------------------------------------
|
|
623
|
+
// It only works on BSStart.subscribe! it is useful or can be eliminated
|
|
624
|
+
// --------------------------------------------------------
|
|
625
|
+
initVariables() {
|
|
626
|
+
this.logger.log('[CONVS-LIST-PAGE] uidReciverFromUrl:: ' + this.uidReciverFromUrl);
|
|
627
|
+
this.logger.log('[CONVS-LIST-PAGE] loggedUserUid:: ' + this.loggedUserUid);
|
|
628
|
+
this.logger.log('[CONVS-LIST-PAGE] tenant:: ' + this.tenant);
|
|
629
|
+
if (this.route.component['name'] !== "ConversationListPage") {
|
|
630
|
+
|
|
631
|
+
if (this.route && this.route.snapshot && this.route.snapshot.firstChild) {
|
|
632
|
+
const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv');
|
|
633
|
+
this.logger.log('[CONVS-LIST-PAGE] conversationWith 2: ', IDConv);
|
|
634
|
+
if (IDConv) {
|
|
635
|
+
this.setUidConvSelected(IDConv);
|
|
636
|
+
} else {
|
|
637
|
+
|
|
638
|
+
this.logger.log('[CONVS-LIST-PAGE] conversationWith 2 (else): ', IDConv);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* ::: setUidConvSelected :::
|
|
648
|
+
*/
|
|
649
|
+
setUidConvSelected(uidConvSelected: string, conversationType?: string,) {
|
|
650
|
+
this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected)
|
|
651
|
+
this.uidConvSelected = uidConvSelected;
|
|
652
|
+
this.logger.log('uidConvSelected', uidConvSelected)
|
|
653
|
+
// this.conversationsHandlerService.uidConvSelected = uidConvSelected;
|
|
654
|
+
if (uidConvSelected) {
|
|
655
|
+
let conversationSelected;
|
|
656
|
+
if (conversationType === 'active') {
|
|
657
|
+
conversationSelected = this.conversations.find(item => item.uid === this.uidConvSelected);
|
|
658
|
+
} else if (conversationType === 'archived') {
|
|
659
|
+
conversationSelected = this.archivedConversations.find(item => item.uid === this.uidConvSelected);
|
|
660
|
+
}
|
|
661
|
+
if (conversationSelected) {
|
|
662
|
+
this.logger.log('[CONVS-LIST-PAGE] conversationSelected', conversationSelected);
|
|
663
|
+
this.logger.log('[CONVS-LIST-PAGE] the conversation ', this.conversationSelected, ' has already been loaded');
|
|
664
|
+
this.conversationSelected = conversationSelected;
|
|
665
|
+
this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected: ', this.conversationSelected);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
onConversationSelected(conversation: ConversationModel) {
|
|
671
|
+
this.logger.log('onConversationSelected conversation', conversation)
|
|
672
|
+
if (conversation.archived) {
|
|
673
|
+
this.navigateByUrl('archived', conversation.uid)
|
|
674
|
+
this.logger.log('[CONVS-LIST-PAGE] onConversationSelected archived conversation.uid ', conversation.uid)
|
|
675
|
+
} else {
|
|
676
|
+
this.navigateByUrl('active', conversation.uid)
|
|
677
|
+
this.logger.log('[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ', conversation.uid)
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
onImageLoaded(conversation: any) {
|
|
683
|
+
// this.logger.log('[CONVS-LIST-PAGE] onImageLoaded', conversation)
|
|
684
|
+
let conversation_with_fullname = conversation.sender_fullname;
|
|
685
|
+
let conversation_with = conversation.sender;
|
|
686
|
+
if (conversation.sender === this.loggedUserUid) {
|
|
687
|
+
conversation_with = conversation.recipient;
|
|
688
|
+
conversation_with_fullname = conversation.recipient_fullname;
|
|
689
|
+
} else if (isGroup(conversation)) {
|
|
690
|
+
// conversation_with_fullname = conv.sender_fullname;
|
|
691
|
+
// conv.last_message_text = conv.last_message_text;
|
|
692
|
+
conversation_with = conversation.recipient;
|
|
693
|
+
conversation_with_fullname = conversation.recipient_fullname;
|
|
694
|
+
}
|
|
695
|
+
if (!conversation_with.startsWith("support-group")) {
|
|
696
|
+
conversation.image = this.imageRepoService.getImagePhotoUrl(conversation_with)
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
onConversationLoaded(conversation: ConversationModel) {
|
|
701
|
+
// this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded ', conversation)
|
|
702
|
+
// this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded is new? ', conversation.is_new)
|
|
703
|
+
// if (conversation.is_new === false) {
|
|
704
|
+
// this.ionContentConvList.scrollToTop(0);
|
|
705
|
+
// }
|
|
706
|
+
|
|
707
|
+
const keys = ['YOU', 'SENT_AN_IMAGE', 'SENT_AN_ATTACHMENT'];
|
|
708
|
+
const translationMap = this.translateService.translateLanguage(keys);
|
|
709
|
+
// Fixes the bug: if a snippet of code is pasted and sent it is not displayed correctly in the convesations list
|
|
710
|
+
|
|
711
|
+
var regex = /<br\s*[\/]?>/gi;
|
|
712
|
+
if (conversation && conversation.last_message_text) {
|
|
713
|
+
conversation.last_message_text = conversation.last_message_text.replace(regex, "")
|
|
714
|
+
|
|
715
|
+
//FIX-BUG: 'YOU: YOU: YOU: text' on last-message-text in conversation-list
|
|
716
|
+
if (conversation.sender === this.loggedUserUid && !conversation.last_message_text.includes(': ')) {
|
|
717
|
+
// this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded', conversation)
|
|
718
|
+
|
|
719
|
+
if (conversation.type !== "image" && conversation.type !== "file") {
|
|
720
|
+
conversation.last_message_text = translationMap.get('YOU') + ': ' + conversation.last_message_text;
|
|
721
|
+
|
|
722
|
+
} else if (conversation.type === "image") {
|
|
723
|
+
|
|
724
|
+
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT AN IMAGE');
|
|
725
|
+
// this.logger.log("[CONVS-LIST-PAGE] translationMap.get('YOU')")
|
|
726
|
+
const SENT_AN_IMAGE = conversation['last_message_text'] = translationMap.get('SENT_AN_IMAGE')
|
|
727
|
+
|
|
728
|
+
conversation.last_message_text = translationMap.get('YOU') + ': ' + SENT_AN_IMAGE;
|
|
729
|
+
|
|
730
|
+
} else if (conversation.type === "file") {
|
|
731
|
+
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT FILE')
|
|
732
|
+
const SENT_AN_ATTACHMENT = conversation['last_message_text'] = translationMap.get('SENT_AN_ATTACHMENT')
|
|
733
|
+
conversation.last_message_text = translationMap.get('YOU') + ': ' + SENT_AN_ATTACHMENT;
|
|
734
|
+
}
|
|
735
|
+
} else {
|
|
736
|
+
if (conversation.type === "image") {
|
|
737
|
+
|
|
738
|
+
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT AN IMAGE');
|
|
739
|
+
// this.logger.log("[CONVS-LIST-PAGE] translationMap.get('YOU')")
|
|
740
|
+
const SENT_AN_IMAGE = conversation['last_message_text'] = translationMap.get('SENT_AN_IMAGE')
|
|
741
|
+
|
|
742
|
+
conversation.last_message_text = SENT_AN_IMAGE;
|
|
743
|
+
|
|
744
|
+
}
|
|
745
|
+
else if (conversation.type === "file") {
|
|
746
|
+
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT FILE')
|
|
747
|
+
const SENT_AN_ATTACHMENT = conversation['last_message_text'] = translationMap.get('SENT_AN_ATTACHMENT')
|
|
748
|
+
conversation.last_message_text = SENT_AN_ATTACHMENT;
|
|
749
|
+
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// isMarkdownLink(last_message_text) {
|
|
756
|
+
// this.logger.log('[CONVS-LIST-PAGE] isMarkdownLink 1')
|
|
757
|
+
// var regex = /^(^|[\n\r])\s*1\.\s.*\s+1\.\s$/
|
|
758
|
+
// let matchRegex = false
|
|
759
|
+
// if (regex.test(last_message_text)) {
|
|
760
|
+
// this.logger.log('[CONVS-LIST-PAGE] isMarkdownLink 2')
|
|
761
|
+
// matchRegex = true
|
|
762
|
+
// return matchRegex
|
|
763
|
+
// }
|
|
764
|
+
// }
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
navigateByUrl(converationType: string, uidConvSelected: string) {
|
|
768
|
+
this.logger.log('[CONVS-LIST-PAGE] calling navigateByUrl: ');
|
|
769
|
+
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl uidConvSelected: ', uidConvSelected);
|
|
770
|
+
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl run this.setUidConvSelected');
|
|
771
|
+
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ', this.uidConvSelected);
|
|
772
|
+
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected ', this.conversationSelected)
|
|
773
|
+
|
|
774
|
+
this.setUidConvSelected(uidConvSelected, converationType);
|
|
775
|
+
if (checkPlatformIsMobile()) {
|
|
776
|
+
this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile());
|
|
777
|
+
this.logger.log('[CONVS-LIST-PAGE] DESKTOP (window >= 768)', this.navService);
|
|
778
|
+
let pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType;
|
|
779
|
+
this.logger.log('[CONVS-LIST-PAGE] pageURL', pageUrl)
|
|
780
|
+
this.router.navigateByUrl(pageUrl);
|
|
781
|
+
} else {
|
|
782
|
+
this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile());
|
|
783
|
+
this.logger.log('[CONVS-LIST-PAGE] MOBILE (window < 768) ', this.navService);
|
|
784
|
+
let pageUrl = 'conversation-detail/' + this.uidConvSelected;
|
|
785
|
+
if (this.conversationSelected && this.conversationSelected.conversation_with_fullname) {
|
|
786
|
+
pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType;
|
|
787
|
+
}
|
|
788
|
+
this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ', pageUrl);
|
|
789
|
+
this.router.navigateByUrl(pageUrl);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
// ---------------------------------------------------------
|
|
795
|
+
// Opens the list of contacts for direct convs
|
|
796
|
+
// ---------------------------------------------------------
|
|
797
|
+
openContactsDirectory(event: any) {
|
|
798
|
+
const TOKEN = this.tiledeskAuthService.getTiledeskToken();
|
|
799
|
+
this.logger.log('[CONVS-LIST-PAGE] openContactsDirectory', TOKEN);
|
|
800
|
+
if (checkPlatformIsMobile()) {
|
|
801
|
+
presentModal(this.modalController, ContactsDirectoryPage, { token: TOKEN });
|
|
802
|
+
} else {
|
|
803
|
+
this.navService.push(ContactsDirectoryPage, { token: TOKEN });
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
closeContactsDirectory() {
|
|
808
|
+
try {
|
|
809
|
+
closeModal(this.modalController);
|
|
810
|
+
} catch (err) {
|
|
811
|
+
this.logger.error('[CONVS-LIST-PAGE] closeContactsDirectory -> error:', err);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// ---------------------------------------------------------
|
|
816
|
+
// Opens logged user profile modal
|
|
817
|
+
// ---------------------------------------------------------
|
|
818
|
+
openProfileInfo(event: any) {
|
|
819
|
+
const TOKEN = this.messagingAuthService.getToken();
|
|
820
|
+
this.logger.log('[CONVS-LIST-PAGE] open ProfileInfoPage TOKEN ', TOKEN);
|
|
821
|
+
if (checkPlatformIsMobile()) {
|
|
822
|
+
presentModal(this.modalController, ProfileInfoPage, { token: TOKEN })
|
|
823
|
+
} else {
|
|
824
|
+
this.navService.push(ProfileInfoPage, { token: TOKEN })
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
// ----------------------------------------------------------------------------------------------
|
|
831
|
+
// onCloseConversation
|
|
832
|
+
// https://github.com/chat21/chat21-cloud-functions/blob/master/docs/api.md#delete-a-conversation
|
|
833
|
+
// ----------------------------------------------------------------------------------------------
|
|
834
|
+
onCloseConversation(conversation: ConversationModel) {
|
|
835
|
+
// -------------------------------------------------------------------------------------
|
|
836
|
+
// Fix the display of the message "No conversation yet" when a conversation is archived
|
|
837
|
+
// but there are others in the list (happens when loadingIsActive is set to false because
|
|
838
|
+
// when is called the initConversationsHandler method there is not conversations)
|
|
839
|
+
// -------------------------------------------------------------------------------------
|
|
840
|
+
this.loadingIsActive = false;
|
|
841
|
+
// console.log('CONVS - CONV-LIST-PAGE onCloseConversation CONVS: ', conversation)
|
|
842
|
+
this.logger.log('[CONVS-LIST-PAGE] onCloseConversation loadingIsActive: ', this.loadingIsActive)
|
|
843
|
+
|
|
844
|
+
const conversationId = conversation.uid;
|
|
845
|
+
|
|
846
|
+
this.logger.log('[CONVS-LIST-PAGE] onCloseConversation conversationId: ', conversationId)
|
|
847
|
+
|
|
848
|
+
const conversationWith_segments = conversationId.split('-');
|
|
849
|
+
this.logger.log('[CONVS-LIST-PAGE] - conversationId_segments: ', conversationWith_segments);
|
|
850
|
+
|
|
851
|
+
// Removes the last element of the array if is = to the separator
|
|
852
|
+
if (conversationWith_segments[conversationWith_segments.length - 1] === '') {
|
|
853
|
+
conversationWith_segments.pop();
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
if (conversationWith_segments.length === 4) {
|
|
857
|
+
const lastArrayElement = conversationWith_segments[conversationWith_segments.length - 1]
|
|
858
|
+
this.logger.log('[CONVS-LIST-PAGE] - lastArrayElement ', lastArrayElement);
|
|
859
|
+
this.logger.log('[CONVS-LIST-PAGE] - lastArrayElement length', lastArrayElement.length);
|
|
860
|
+
if (lastArrayElement.length !== 32) {
|
|
861
|
+
conversationWith_segments.pop();
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
if (conversationId.startsWith("support-group")) {
|
|
866
|
+
let project_id = ''
|
|
867
|
+
if (conversationWith_segments.length === 4) {
|
|
868
|
+
project_id = conversationWith_segments[2];
|
|
869
|
+
|
|
870
|
+
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
|
|
871
|
+
this.archiveSupportGroupConv(tiledeskToken, project_id, conversationId);
|
|
872
|
+
|
|
873
|
+
} else {
|
|
874
|
+
this.getProjectIdByConversationWith(conversationId)
|
|
875
|
+
}
|
|
876
|
+
} else {
|
|
877
|
+
this.conversationsHandlerService.archiveConversation(conversationId)
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
getProjectIdByConversationWith(conversationId: string) {
|
|
882
|
+
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
|
|
883
|
+
|
|
884
|
+
this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationId).subscribe(res => {
|
|
885
|
+
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT RES', res);
|
|
886
|
+
|
|
887
|
+
if (res) {
|
|
888
|
+
const project_id = res.id_project
|
|
889
|
+
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT project_id', project_id);
|
|
890
|
+
this.archiveSupportGroupConv(tiledeskToken, project_id, conversationId);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
}, (error) => {
|
|
894
|
+
this.logger.error('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error);
|
|
895
|
+
|
|
896
|
+
}, () => {
|
|
897
|
+
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *');
|
|
898
|
+
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
archiveSupportGroupConv(tiledeskToken, project_id, conversationId) {
|
|
903
|
+
this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation projectId: ', project_id)
|
|
904
|
+
this.tiledeskService.closeSupportGroup(tiledeskToken, project_id, conversationId).subscribe(res => {
|
|
905
|
+
|
|
906
|
+
this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation closeSupportGroup RES', res);
|
|
907
|
+
}, (error) => {
|
|
908
|
+
this.logger.error('[CONVS-LIST-PAGE] - onCloseConversation closeSupportGroup - ERROR ', error);
|
|
909
|
+
}, () => {
|
|
910
|
+
this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation closeSupportGroup * COMPLETE *');
|
|
911
|
+
this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation (closeSupportGroup) CONVS ', this.conversations)
|
|
912
|
+
this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation (closeSupportGroup) CONVS LENGHT ', this.conversations.length)
|
|
913
|
+
});
|
|
914
|
+
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
public generateFake(count: number): Array<number> {
|
|
919
|
+
const indexes = [];
|
|
920
|
+
for (let i = 0; i < count; i++) {
|
|
921
|
+
indexes.push(i);
|
|
922
|
+
}
|
|
923
|
+
return indexes;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
// ------------------------------------------------------------------
|
|
927
|
+
// !!! Not used methods !!!
|
|
928
|
+
// ------------------------------------------------------------------
|
|
929
|
+
|
|
930
|
+
// /**
|
|
931
|
+
// * ::: openArchivedConversationsPage :::
|
|
932
|
+
// * Open the archived conversations page
|
|
933
|
+
// * (metodo richiamato da html)
|
|
934
|
+
// */
|
|
935
|
+
// openArchivedConversationsPage() {
|
|
936
|
+
// this.logger.log('[CONVS-LIST-PAGE] openArchivedConversationsPage');
|
|
937
|
+
// }
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
// // info page
|
|
941
|
+
// returnCloseInfoPage() {
|
|
942
|
+
// this.logger.log('[CONVS-LIST-PAGE] returnCloseInfoPage');
|
|
943
|
+
// // this.isShowMenuPage = false;
|
|
944
|
+
// this.initialize();
|
|
945
|
+
|
|
946
|
+
// }
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
// private navigatePage() {
|
|
950
|
+
// this.logger.log('[CONVS-LIST-PAGE] navigatePage:: >>>> conversationSelected ', this.conversationSelected);
|
|
951
|
+
// let urlPage = 'detail/';
|
|
952
|
+
// if (this.conversationSelected) {
|
|
953
|
+
// // urlPage = 'conversation-detail/' + this.uidConvSelected;
|
|
954
|
+
// urlPage = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname;
|
|
955
|
+
// // this.openDetailsWithState(this.conversationSelected);
|
|
956
|
+
// }
|
|
957
|
+
// // else {
|
|
958
|
+
// // this.router.navigateByUrl('detail');
|
|
959
|
+
// // }
|
|
960
|
+
|
|
961
|
+
// const navigationExtras: NavigationExtras = {
|
|
962
|
+
// state: {
|
|
963
|
+
// conversationSelected: this.conversationSelected
|
|
964
|
+
// }
|
|
965
|
+
// };
|
|
966
|
+
// this.navService.openPage(urlPage, ConversationDetailPage, navigationExtras);
|
|
967
|
+
// }
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
// openDetailsWithState(conversationSelected) {
|
|
971
|
+
// console.log('openDetailsWithState:: >>>> conversationSelected ', conversationSelected);
|
|
972
|
+
// let navigationExtras: NavigationExtras = {
|
|
973
|
+
// state: {
|
|
974
|
+
// conversationSelected: conversationSelected
|
|
975
|
+
// }
|
|
976
|
+
// };
|
|
977
|
+
// this.router.navigate(['conversation-detail/' + this.uidConvSelected], navigationExtras);
|
|
978
|
+
// }
|
|
979
|
+
|
|
980
|
+
// /**
|
|
981
|
+
// * ::: subscribeLoggedUserLogin :::
|
|
982
|
+
// * effettuato il login:
|
|
983
|
+
// * 1 - imposto loggedUser
|
|
984
|
+
// * 2 - dismetto modale
|
|
985
|
+
// * 3 - inizializzo elenco conversazioni
|
|
986
|
+
// */
|
|
987
|
+
// subscribeLoggedUserLogin = (user: any) => {
|
|
988
|
+
// console.log('3 ************** subscribeLoggedUserLogin', user);
|
|
989
|
+
// this.loggedUser = user;
|
|
990
|
+
// try {
|
|
991
|
+
// closeModal(this.modalController);
|
|
992
|
+
// } catch (err) {
|
|
993
|
+
// console.error('-> error:', err);
|
|
994
|
+
// }
|
|
995
|
+
// this.initialize();
|
|
996
|
+
// }
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* ::: conversationsChanged :::
|
|
1002
|
+
* evento richiamato su add, change, remove dell'elenco delle conversazioni
|
|
1003
|
+
* 1 - aggiorno elenco conversazioni
|
|
1004
|
+
* 2 - aggiorno il conto delle nuove conversazioni
|
|
1005
|
+
* 4 - se esiste un uidReciverFromUrl (passato nell'url)
|
|
1006
|
+
* e se esiste una conversazione con lo stesso id di uidReciverFromUrl
|
|
1007
|
+
* imposto questa come conversazione attiva (operazione da fare una sola volta al caricamento delle conversazioni)
|
|
1008
|
+
* e la carico nella pagina di dettaglio e azzero la variabile uidReciverFromUrl!!!
|
|
1009
|
+
* 5 - altrimenti se esiste una conversazione con lo stesso id della conversazione attiva
|
|
1010
|
+
* e la pagina di dettaglio è vuota (placeholder), carico la conversazione attiva (uidConvSelected) nella pagina di dettaglio
|
|
1011
|
+
* (operazione da fare una sola volta al caricamento delle conversazioni)
|
|
1012
|
+
*/
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
// ------------------------------------------------------------------------------------
|
|
1017
|
+
// ::: readAllMessages ::: ??????????? SEEMS NOT USED ?????????????????
|
|
1018
|
+
// when all chat messages are displayed,
|
|
1019
|
+
// that is when in the conversation detail I go to the bottom of the page,
|
|
1020
|
+
// the readAllMessages event is triggered and is intercepted in the conversation list
|
|
1021
|
+
// and modify the current conversation by bringing is_new to false
|
|
1022
|
+
// ------------------------------------------------------------------------------------
|
|
1023
|
+
// readAllMessages = (uid: string) => {
|
|
1024
|
+
// this.logger.log('[CONVS-LIST-PAGE] readAllMessages', uid);
|
|
1025
|
+
// const conversationSelected = this.conversations.find(item => item.uid === this.uidConvSelected);
|
|
1026
|
+
// if (conversationSelected) {
|
|
1027
|
+
// conversationSelected.is_new = false;
|
|
1028
|
+
// conversationSelected.status = '0';
|
|
1029
|
+
// conversationSelected.selected = true;
|
|
1030
|
+
// }
|
|
1031
|
+
// }
|
|
1032
|
+
}
|