@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
|
@@ -1,1233 +0,0 @@
|
|
|
1
|
-
import { Component, NgZone, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
-
import { AlertController, Events, LoadingController } from 'ionic-angular';
|
|
3
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
4
|
-
|
|
5
|
-
import { DomSanitizer} from '@angular/platform-browser';
|
|
6
|
-
|
|
7
|
-
// models
|
|
8
|
-
import { UserModel } from '../../models/user';
|
|
9
|
-
import { GroupModel } from '../../models/group';
|
|
10
|
-
|
|
11
|
-
// services
|
|
12
|
-
import { UploadService } from '../../providers/upload-service/upload-service';
|
|
13
|
-
import { UserService } from '../../providers/user/user';
|
|
14
|
-
import { GroupService } from '../../providers/group/group';
|
|
15
|
-
import { ChatManager } from '../../providers/chat-manager/chat-manager';
|
|
16
|
-
import { ChatPresenceHandler } from '../../providers/chat-presence-handler';
|
|
17
|
-
|
|
18
|
-
import { environment } from '../../environments/environment';
|
|
19
|
-
|
|
20
|
-
// FIREBASESTORAGE_BASE_URL_IMAGE
|
|
21
|
-
// URL_PROJECT_ID
|
|
22
|
-
// URL_TICKET_CHAT
|
|
23
|
-
// CHAT_SEND_BY_EMAIL_LINK
|
|
24
|
-
// URL_VIDEO_CHAT,
|
|
25
|
-
|
|
26
|
-
// utils
|
|
27
|
-
import { TYPE_SUPPORT_GROUP, TYPE_GROUP, SYSTEM, URL_NO_IMAGE, LABEL_NOICON } from '../../utils/constants';
|
|
28
|
-
import { jsonToArray, avatarPlaceholder, getColorBck, searchIndexInArrayForUid, getFormatData, createConfirm, urlify, isExistInArray, createLoading } from '../../utils/utils';
|
|
29
|
-
import { PlaceholderPage } from '../placeholder/placeholder';
|
|
30
|
-
|
|
31
|
-
import { ChatConversationsHandler } from '../../providers/chat-conversations-handler';
|
|
32
|
-
import { ChatArchivedConversationsHandler } from '../../providers/chat-archived-conversations-handler';
|
|
33
|
-
|
|
34
|
-
import { ChatConversationHandler } from '../../providers/chat-conversation-handler';
|
|
35
|
-
import { TiledeskConversationProvider } from '../../providers/tiledesk-conversation/tiledesk-conversation';
|
|
36
|
-
import { ConversationModel } from '../../models/conversation';
|
|
37
|
-
|
|
38
|
-
import { NavProxyService } from '../../providers/nav-proxy';
|
|
39
|
-
import { AppConfigProvider } from '../../providers/app-config/app-config';
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
@Component({
|
|
44
|
-
selector: 'page-info-conversation',
|
|
45
|
-
templateUrl: 'info-conversation.html',
|
|
46
|
-
})
|
|
47
|
-
export class InfoConversationPage {
|
|
48
|
-
// ========= begin:: Input/Output values ============//
|
|
49
|
-
@Output() eventClose = new EventEmitter();
|
|
50
|
-
@Output() eventOpenInfoUser = new EventEmitter<UserModel>();
|
|
51
|
-
@Output() eventOpenInfoAdvanced = new EventEmitter<any>();
|
|
52
|
-
@Input() tenant: string;
|
|
53
|
-
@Input() attributes: any = {};
|
|
54
|
-
@Input() conversationWith: string;
|
|
55
|
-
@Input() channelType: string;
|
|
56
|
-
// ========= end:: Input/Output values ============//
|
|
57
|
-
|
|
58
|
-
public group: any;
|
|
59
|
-
public uidUserAuthenticated: string;
|
|
60
|
-
public signInProvider: string;
|
|
61
|
-
// public uidSelected: string;
|
|
62
|
-
public conversationSelected: ConversationModel;
|
|
63
|
-
public userDetail: UserModel;
|
|
64
|
-
public groupDetail: GroupModel;
|
|
65
|
-
public listMembers: UserModel[];
|
|
66
|
-
public currentUserDetail: UserModel;
|
|
67
|
-
public profileYourself: boolean;
|
|
68
|
-
private customAttributes = [];
|
|
69
|
-
public attributesClient: string = '';
|
|
70
|
-
public attributesSourcePage: string = '';
|
|
71
|
-
public attributesDepartments: string = '';
|
|
72
|
-
public online: boolean;
|
|
73
|
-
public lastConnectionDate: string;
|
|
74
|
-
public conversationEnabled: boolean;
|
|
75
|
-
|
|
76
|
-
public TYPE_GROUP = TYPE_GROUP;
|
|
77
|
-
// public CHAT_SEND_BY_EMAIL_LINK = CHAT_SEND_BY_EMAIL_LINK;
|
|
78
|
-
// public URL_VIDEO_CHAT = URL_VIDEO_CHAT;
|
|
79
|
-
|
|
80
|
-
private loadingDialog: any;
|
|
81
|
-
private confirmDialog: any;
|
|
82
|
-
|
|
83
|
-
private isLoggedUserGroupMember: boolean;
|
|
84
|
-
private subscriptions = [];
|
|
85
|
-
// private FIREBASESTORAGE_BASE_URL_IMAGE: string;
|
|
86
|
-
|
|
87
|
-
private supportMode = environment.supportMode;
|
|
88
|
-
private urlConversation;
|
|
89
|
-
private DASHBOARD_URL;
|
|
90
|
-
private projectID;
|
|
91
|
-
public startWithSupportGroup = false;
|
|
92
|
-
|
|
93
|
-
constructor(
|
|
94
|
-
public events: Events,
|
|
95
|
-
public chatManager: ChatManager,
|
|
96
|
-
public userService: UserService,
|
|
97
|
-
public groupService: GroupService,
|
|
98
|
-
public upSvc: UploadService,
|
|
99
|
-
public zone: NgZone,
|
|
100
|
-
private conversationsHandler: ChatConversationsHandler,
|
|
101
|
-
private chatArchivedConversationsHandler: ChatArchivedConversationsHandler,
|
|
102
|
-
private conversationHandler: ChatConversationHandler,
|
|
103
|
-
private tiledeskConversationProvider: TiledeskConversationProvider,
|
|
104
|
-
public alertCtrl: AlertController,
|
|
105
|
-
public translate: TranslateService,
|
|
106
|
-
private loadingCtrl: LoadingController,
|
|
107
|
-
private navProxy: NavProxyService,
|
|
108
|
-
public chatPresenceHandler: ChatPresenceHandler,
|
|
109
|
-
public appConfig: AppConfigProvider,
|
|
110
|
-
private sanitizer: DomSanitizer
|
|
111
|
-
) {
|
|
112
|
-
//this.events.subscribe('closeDetailConversation', this.closeDetailConversation);
|
|
113
|
-
console.log('**** constructor InfoConversationPage *****');
|
|
114
|
-
const that = this;
|
|
115
|
-
// this.FIREBASESTORAGE_BASE_URL_IMAGE = this.appConfig.getConfig().storageBucket;
|
|
116
|
-
setTimeout(function () {
|
|
117
|
-
that.initialize();
|
|
118
|
-
}, 100);
|
|
119
|
-
this.DASHBOARD_URL = this.appConfig.getConfig().DASHBOARD_URL;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
ngOnInit() {
|
|
123
|
-
console.log('ngOnInit:InfoConversationPage');
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
ionViewDidLoad() {
|
|
128
|
-
console.log('ionViewDidLoad:InfoConversationPage');
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
ionViewWillEnter() {
|
|
132
|
-
console.log('ionViewWillEnter');
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
ionViewWillLeave() {
|
|
137
|
-
console.log('------------> ionViewWillLeave:InfoConversationPage');
|
|
138
|
-
this.unsubscribeAll();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* 1 - set subscriptions
|
|
143
|
-
* 2 - load group details (async)
|
|
144
|
-
* 3 - checkVerifiedMembers
|
|
145
|
-
*
|
|
146
|
-
* recupero array uid membri
|
|
147
|
-
*/
|
|
148
|
-
initialize() {
|
|
149
|
-
console.log('InfoConversationPage::initialize', this.conversationWith);
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
this.profileYourself = false;
|
|
153
|
-
this.online = false;
|
|
154
|
-
this.isLoggedUserGroupMember = false;
|
|
155
|
-
this.listMembers = [];
|
|
156
|
-
this.subscriptions = [];
|
|
157
|
-
this.profileYourself = false;
|
|
158
|
-
this.currentUserDetail = this.chatManager.getLoggedUser();
|
|
159
|
-
this.userDetail = new UserModel('', '', '', '', '', '', '', '', false, false, '');
|
|
160
|
-
this.groupDetail = new GroupModel('', 0, '', [], [], '', '');
|
|
161
|
-
this.conversationSelected = this.conversationsHandler.getConversationByUid(this.conversationWith);
|
|
162
|
-
if (!this.conversationSelected) {
|
|
163
|
-
this.conversationSelected = this.chatArchivedConversationsHandler.getConversationByUid(this.conversationWith);
|
|
164
|
-
}
|
|
165
|
-
console.log('conversationSelected::', this.conversationSelected);
|
|
166
|
-
console.log('conversationWith::', this.conversationWith);
|
|
167
|
-
if(this.conversationWith.startsWith("support-group")){
|
|
168
|
-
this.startWithSupportGroup = true;
|
|
169
|
-
}
|
|
170
|
-
if (this.conversationSelected && this.startWithSupportGroup){
|
|
171
|
-
this.openIframe();
|
|
172
|
-
// } else if(this.supportMode == true) {
|
|
173
|
-
// this.urlConversation = this.sanitizer.bypassSecurityTrustResourceUrl(this.DASHBOARD_URL);
|
|
174
|
-
} else {
|
|
175
|
-
this.populateDetail();
|
|
176
|
-
this.setSubscriptions();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
openIframe() {
|
|
182
|
-
if (this.channelType === TYPE_GROUP) {
|
|
183
|
-
console.log('GRUPPO');
|
|
184
|
-
this.profileYourself = false;
|
|
185
|
-
this.loadGroupDetail();
|
|
186
|
-
} else {
|
|
187
|
-
this.setUrlIframe();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
setUrlIframe(){
|
|
192
|
-
if (this.conversationSelected.attributes && this.conversationSelected.attributes.projectId){
|
|
193
|
-
this.projectID = this.conversationSelected.attributes.projectId;
|
|
194
|
-
}
|
|
195
|
-
if(this.projectID && this.conversationWith) {
|
|
196
|
-
console.log('conversationWith::', this.conversationWith);
|
|
197
|
-
console.log('projectId::', this.projectID);
|
|
198
|
-
var urlConversationTEMP = this.sanitizer.bypassSecurityTrustResourceUrl(this.DASHBOARD_URL+"#/project/"+this.projectID+"/request-for-panel/"+this.conversationWith);
|
|
199
|
-
this.urlConversation = urlConversationTEMP;
|
|
200
|
-
} else {
|
|
201
|
-
this.urlConversation = this.sanitizer.bypassSecurityTrustResourceUrl(this.DASHBOARD_URL);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
/** selectUserDetail
|
|
208
|
-
* se uid conversazione esiste popolo:
|
|
209
|
-
* 1 - dettaglio current user
|
|
210
|
-
* 2 - dettaglio gruppo
|
|
211
|
-
* 3 - dettaglio user
|
|
212
|
-
*/
|
|
213
|
-
populateDetail() {
|
|
214
|
-
console.log('InfoConversationPage::populateDetail');
|
|
215
|
-
// if(!this.conversationSelected.image || this.conversationSelected.image === undefined ) {
|
|
216
|
-
// this.conversationSelected.image = '';
|
|
217
|
-
// }
|
|
218
|
-
if (!this.conversationWith) {
|
|
219
|
-
console.log('NO CONVERSATION');
|
|
220
|
-
return;
|
|
221
|
-
} else if (this.conversationWith === this.currentUserDetail.uid) {
|
|
222
|
-
console.log('MYSELF');
|
|
223
|
-
this.profileYourself = true;
|
|
224
|
-
this.userDetail = this.currentUserDetail;
|
|
225
|
-
} else if (this.channelType === TYPE_GROUP) {
|
|
226
|
-
console.log('GRUPPO');
|
|
227
|
-
this.profileYourself = false;
|
|
228
|
-
this.loadGroupDetail();
|
|
229
|
-
this.events.subscribe(this.conversationWith + '-listener', this.subscribeConversationListener);
|
|
230
|
-
this.conversationsHandler.addConversationListener(this.currentUserDetail.uid, this.conversationWith);
|
|
231
|
-
} else {
|
|
232
|
-
console.log('CONVERSATION');
|
|
233
|
-
this.profileYourself = false;
|
|
234
|
-
// status user conversation with
|
|
235
|
-
this.userIsOnline(this.conversationWith);
|
|
236
|
-
this.loadUserDetail();
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
// ========= begin:: set User Detail ============//
|
|
242
|
-
/** */
|
|
243
|
-
loadUserDetail() {
|
|
244
|
-
const that = this;
|
|
245
|
-
this.userService.loadUserDetail(this.conversationWith)
|
|
246
|
-
.then(function (snapshot) {
|
|
247
|
-
if (snapshot.val()) {
|
|
248
|
-
that.setDetailUser(snapshot);
|
|
249
|
-
}
|
|
250
|
-
})
|
|
251
|
-
.catch(function (err) {
|
|
252
|
-
console.error('Unable to get permission to notify.', err);
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/** */
|
|
257
|
-
setDetailUser(snapshot) {
|
|
258
|
-
const user = snapshot.val();
|
|
259
|
-
const fullname = user.firstname + " " + user.lastname;
|
|
260
|
-
this.userDetail = new UserModel(
|
|
261
|
-
snapshot.key,
|
|
262
|
-
user.email,
|
|
263
|
-
user.firstname,
|
|
264
|
-
user.lastname,
|
|
265
|
-
fullname.trim(),
|
|
266
|
-
user.imageurl,
|
|
267
|
-
'',
|
|
268
|
-
'',
|
|
269
|
-
false,
|
|
270
|
-
false,
|
|
271
|
-
''
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
// ========= end:: set User Detail ============//
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
/** SUBSCRIPTIONS */
|
|
278
|
-
setSubscriptions() {
|
|
279
|
-
console.log('InfoConversationPage::setSubscriptions');
|
|
280
|
-
// this.events.subscribe('changeStatusUserSelected', this.subcribeChangeStatusUserSelected);
|
|
281
|
-
this.events.subscribe('PopupConfirmation', this.subcribePopupConfirmation);
|
|
282
|
-
this.addSubscription('PopupConfirmation');
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* init group details subscription
|
|
289
|
-
*/
|
|
290
|
-
loadGroupDetail() {
|
|
291
|
-
const keySubscription = 'groupDetails';
|
|
292
|
-
if (this.addSubscription(keySubscription)) {
|
|
293
|
-
this.events.subscribe(keySubscription, this.returnLoadGroupDetail);
|
|
294
|
-
this.groupService.loadGroupDetail(this.currentUserDetail.uid, this.conversationWith, keySubscription);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* information detail group called of groupService.loadGroupDetail
|
|
300
|
-
*/
|
|
301
|
-
returnLoadGroupDetail = (snapshot) => {
|
|
302
|
-
console.log('InfoConversationPage::subscribeGroupDetails', snapshot.val());
|
|
303
|
-
var that = this;
|
|
304
|
-
//setTimeout(function () {
|
|
305
|
-
if (snapshot.val()) {
|
|
306
|
-
that.group = snapshot.val();
|
|
307
|
-
if (that.group.attributes) {
|
|
308
|
-
that.attributes = that.group.attributes;
|
|
309
|
-
that.updateAttributes(that.group.attributes);
|
|
310
|
-
if (that.attributes.projectId){
|
|
311
|
-
that.projectID = that.attributes.projectId;
|
|
312
|
-
}
|
|
313
|
-
that.setUrlIframe();
|
|
314
|
-
}
|
|
315
|
-
that.groupDetail = new GroupModel(
|
|
316
|
-
snapshot.key,
|
|
317
|
-
getFormatData(that.group.createdOn),
|
|
318
|
-
that.group.iconURL,
|
|
319
|
-
that.groupService.getUidMembers(that.group.members),
|
|
320
|
-
that.group.memberinfo,
|
|
321
|
-
that.group.name,
|
|
322
|
-
that.group.owner
|
|
323
|
-
);
|
|
324
|
-
if (!that.groupDetail.iconURL || that.groupDetail.iconURL === LABEL_NOICON) {
|
|
325
|
-
that.groupDetail.iconURL = URL_NO_IMAGE;
|
|
326
|
-
}
|
|
327
|
-
that.getListMembers(that.groupDetail.members);
|
|
328
|
-
console.log('groupDetail: ', that.groupDetail, that.uidUserAuthenticated);
|
|
329
|
-
if (!isExistInArray(that.groupDetail.members, that.currentUserDetail.uid) || that.groupDetail.members.length <= 1) {
|
|
330
|
-
that.isLoggedUserGroupMember = false;
|
|
331
|
-
} else if (isExistInArray(that.groupDetail.members, that.currentUserDetail.uid)) {
|
|
332
|
-
that.isLoggedUserGroupMember = true;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
//}, 0);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
private updateAttributes(attributes) {
|
|
340
|
-
console.log('InfoConversationPage::updateAttributes', attributes);
|
|
341
|
-
if (attributes) {
|
|
342
|
-
this.attributesClient = (attributes.client) ? attributes.client : '';
|
|
343
|
-
this.attributesSourcePage = (attributes.sourcePage) ? attributes.sourcePage : '';
|
|
344
|
-
//this.attributesSourcePage = (attributes.sourcePage) ? urlify(attributes.sourcePage) : '';
|
|
345
|
-
this.attributesDepartments = (attributes.departments) ? this.arrayDepartments(attributes.departments).join(", ") : '';
|
|
346
|
-
this.createCustomAttributesMap(attributes);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* 1 - passo array id menbri della conversazione
|
|
352
|
-
* 2 - verifico se l'uid è valido e diverso da SYSTEM
|
|
353
|
-
* 3 - mi sottoscrivo al nodo del dettaglio utente per recuperare le informazioni
|
|
354
|
-
* 4 - creo un new userDetail lo aggiungo all'array utenti, mi sottoscrivo allo stato (online/offline)
|
|
355
|
-
*/
|
|
356
|
-
private getListMembers(members) {
|
|
357
|
-
let that = this;
|
|
358
|
-
// autenticazione
|
|
359
|
-
// let uidUserAuthenticated;
|
|
360
|
-
this.uidUserAuthenticated = '';
|
|
361
|
-
let emailUserAuthenticated;
|
|
362
|
-
let fullnameUserAuthenticated;
|
|
363
|
-
this.signInProvider = 'anonymous';
|
|
364
|
-
let decoded;
|
|
365
|
-
let projectId;
|
|
366
|
-
if (this.attributes) {
|
|
367
|
-
if (this.attributes.projectId) {
|
|
368
|
-
projectId = this.attributes.projectId;
|
|
369
|
-
}
|
|
370
|
-
if (this.attributes.userFullname) {
|
|
371
|
-
fullnameUserAuthenticated = this.attributes.userFullname;
|
|
372
|
-
}
|
|
373
|
-
if (this.attributes.userEmail) {
|
|
374
|
-
emailUserAuthenticated = this.attributes.userEmail;
|
|
375
|
-
}
|
|
376
|
-
if (this.attributes.senderAuthInfo) {
|
|
377
|
-
if (this.attributes.senderAuthInfo.authVar) {
|
|
378
|
-
if (this.attributes.senderAuthInfo.authVar.uid) {
|
|
379
|
-
this.uidUserAuthenticated = this.attributes.senderAuthInfo.authVar.uid;
|
|
380
|
-
}
|
|
381
|
-
if (this.attributes.senderAuthInfo.authVar.token) {
|
|
382
|
-
if (this.attributes.senderAuthInfo.authVar.token.decoded) {
|
|
383
|
-
decoded = this.attributes.senderAuthInfo.authVar.token.decoded;
|
|
384
|
-
//decoded = this.completeDecoded(this.attributes.senderAuthInfo.authVar.token.decoded);
|
|
385
|
-
}
|
|
386
|
-
if (this.attributes.senderAuthInfo.authVar.token.firebase) {
|
|
387
|
-
if (this.attributes.senderAuthInfo.authVar.token.firebase.sign_in_provider) {
|
|
388
|
-
this.signInProvider = this.attributes.senderAuthInfo.authVar.token.firebase.sign_in_provider;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
console.log(' this.uidUserAuthenticated: ', this.uidUserAuthenticated, this.attributes);
|
|
396
|
-
this.listMembers = [];
|
|
397
|
-
console.log(' <----- members -----> ', members, this.listMembers);
|
|
398
|
-
members.forEach(member => {
|
|
399
|
-
let userDetail;
|
|
400
|
-
if (member.trim() !== '' && member.trim() !== SYSTEM) {
|
|
401
|
-
this.userService.getUserDetail(member)
|
|
402
|
-
.then(function (snapshot) {
|
|
403
|
-
if (snapshot.val()) {
|
|
404
|
-
const user = snapshot.val();
|
|
405
|
-
const fullname = user.firstname + " " + user.lastname;
|
|
406
|
-
let avatar;
|
|
407
|
-
let color;
|
|
408
|
-
let decodedUid;
|
|
409
|
-
if (snapshot.key === that.uidUserAuthenticated) {
|
|
410
|
-
decodedUid = decoded;
|
|
411
|
-
}
|
|
412
|
-
let imageurl = that.getImageUrlThumb(snapshot.key);
|
|
413
|
-
userDetail = new UserModel(
|
|
414
|
-
snapshot.key,
|
|
415
|
-
user.email,
|
|
416
|
-
user.firstname,
|
|
417
|
-
user.lastname,
|
|
418
|
-
fullname.trim(),
|
|
419
|
-
imageurl,
|
|
420
|
-
avatar,
|
|
421
|
-
color,
|
|
422
|
-
false,
|
|
423
|
-
false,
|
|
424
|
-
decodedUid
|
|
425
|
-
);
|
|
426
|
-
|
|
427
|
-
} else {
|
|
428
|
-
userDetail = new UserModel(
|
|
429
|
-
snapshot.key,
|
|
430
|
-
'',
|
|
431
|
-
'',
|
|
432
|
-
'',
|
|
433
|
-
'',
|
|
434
|
-
'',
|
|
435
|
-
'',
|
|
436
|
-
'',
|
|
437
|
-
false,
|
|
438
|
-
false,
|
|
439
|
-
''
|
|
440
|
-
);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
// set fullname
|
|
444
|
-
if (!userDetail.fullname || userDetail.fullname === '') {
|
|
445
|
-
userDetail.fullname = that.translate.get('LABEL_GUEST')['value'];
|
|
446
|
-
console.log('0 - userDetail.fullname------------->', userDetail.fullname);
|
|
447
|
-
}
|
|
448
|
-
if (that.uidUserAuthenticated === snapshot.key && fullnameUserAuthenticated && fullnameUserAuthenticated !== 'undefined') {
|
|
449
|
-
console.log('1 - fullnameUserAuthenticated------------->', fullnameUserAuthenticated);
|
|
450
|
-
userDetail.fullname = fullnameUserAuthenticated;
|
|
451
|
-
}
|
|
452
|
-
if (userDetail.firstname || userDetail.lastname) {
|
|
453
|
-
userDetail.fullname = userDetail.firstname + ' ' + userDetail.lastname;
|
|
454
|
-
console.log('2 - userDetail.fullname------------->', userDetail.fullname);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
userDetail.checked = false;
|
|
458
|
-
if (that.signInProvider === 'custom' && that.uidUserAuthenticated === snapshot.key) {
|
|
459
|
-
console.log('2.5 - uidUserAuthenticated------------->', that.uidUserAuthenticated, snapshot.key);
|
|
460
|
-
userDetail.checked = true;
|
|
461
|
-
userDetail.email = emailUserAuthenticated;
|
|
462
|
-
userDetail.decoded = decoded;
|
|
463
|
-
if (fullnameUserAuthenticated) {
|
|
464
|
-
userDetail.fullname = fullnameUserAuthenticated;
|
|
465
|
-
console.log('3 - userDetail.fullname------------->', userDetail.fullname);
|
|
466
|
-
}
|
|
467
|
-
if (that.signInProvider === 'custom' && userDetail.decoded && userDetail.decoded.name) {
|
|
468
|
-
userDetail.fullname = userDetail.decoded.name;
|
|
469
|
-
console.log('4 - userDetail.fullname------------->', userDetail.fullname);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
userDetail.avatar = avatarPlaceholder(userDetail.fullname);
|
|
473
|
-
userDetail.color = getColorBck(userDetail.fullname);
|
|
474
|
-
console.log('userDetail------------->', userDetail);
|
|
475
|
-
// ADD MEMBER TO ARRAY
|
|
476
|
-
let position = that.listMembers.findIndex(i => i.uid === userDetail.uid);
|
|
477
|
-
if (position == -1 ) {
|
|
478
|
-
that.listMembers.push(userDetail);
|
|
479
|
-
}
|
|
480
|
-
// ONLINE/OFFLINE
|
|
481
|
-
|
|
482
|
-
if(userDetail.uid.startsWith('bot_') || userDetail.uid == that.currentUserDetail.uid){
|
|
483
|
-
userDetail.online = true;
|
|
484
|
-
} else {
|
|
485
|
-
that.userIsOnline(userDetail.uid);
|
|
486
|
-
}
|
|
487
|
-
// MEMBER CHECKED!!
|
|
488
|
-
// that.checkVerifiedMembers(userDetail.uid);
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
getImageUrlThumb(uid: string) {
|
|
495
|
-
let imageurl = this.appConfig.getConfig().FIREBASESTORAGE_BASE_URL_IMAGE + this.appConfig.getConfig().firebaseConfig.storageBucket + '/o/profiles%2F' + uid + '%2Fthumb_photo.jpg?alt=media';
|
|
496
|
-
return imageurl;
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* carico url immagine profilo passando id utente
|
|
500
|
-
*/
|
|
501
|
-
// setImageUser(userDetail){
|
|
502
|
-
// const that = this;
|
|
503
|
-
// if(userDetail.uid){
|
|
504
|
-
// this.upSvc.display(userDetail.uid, 'thumb')
|
|
505
|
-
// .then(onResolve, onReject);
|
|
506
|
-
// }
|
|
507
|
-
// function onResolve(foundURL) {
|
|
508
|
-
// console.log('foundURL', userDetail, foundURL);
|
|
509
|
-
// userDetail.imageurl = foundURL;
|
|
510
|
-
// // salvo in cache e sul DB!!!
|
|
511
|
-
// }
|
|
512
|
-
// function onReject(error){
|
|
513
|
-
// console.log('error.code', error);
|
|
514
|
-
// userDetail.imageurl = '';
|
|
515
|
-
// }
|
|
516
|
-
// }
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
//// SUBSCRIBTIONS ////
|
|
520
|
-
/**
|
|
521
|
-
* subscriptions list
|
|
522
|
-
*/
|
|
523
|
-
initSubscriptions(uid) {
|
|
524
|
-
console.log('initSubscriptions.', uid);
|
|
525
|
-
//this.arrayUsersStatus['7CzGOPMbDrXq3Im7APVq5K3advl2'] = true;
|
|
526
|
-
// subscribe stato utente con cui si conversa ONLINE
|
|
527
|
-
// this.events.subscribe('statusUser:online-' + uid, this.statusUserOnline);
|
|
528
|
-
// // subscribe stato utente con cui si conversa ONLINE
|
|
529
|
-
// this.events.subscribe('statusUser:offline-' + uid, this.statusUserOffline);
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
//// UNSUBSCRIPTIONS ////
|
|
534
|
-
/**
|
|
535
|
-
* unsubscribe all subscribe events
|
|
536
|
-
*/
|
|
537
|
-
unsubescribeAll() {
|
|
538
|
-
// this.arrayUsersStatus.forEach((value, key) => {
|
|
539
|
-
// console.log("unsubscribe key", key)
|
|
540
|
-
// this.events.unsubscribe('statusUser:online-' + key, null);
|
|
541
|
-
// this.events.unsubscribe('statusUser:offline-' + key, null);
|
|
542
|
-
// });
|
|
543
|
-
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
// subcribeOnOpenInfoConversation: any = (openInfoConversation, uidUserSelected, channel_type, attributes) => {
|
|
550
|
-
// console.log('InfoConversationPage::subcribeOnOpenInfoConversation');
|
|
551
|
-
// // se openInfoConversation === false il pannello è chiuso!
|
|
552
|
-
// if(!openInfoConversation){ return; }
|
|
553
|
-
// this.uidSelected = uidUserSelected;
|
|
554
|
-
// this.channel_type = channel_type;
|
|
555
|
-
// this.attributes = attributes;
|
|
556
|
-
// this.updateAttributes(this.attributes);
|
|
557
|
-
// this.populateDetail();
|
|
558
|
-
// };
|
|
559
|
-
|
|
560
|
-
// private updateAttributes(attributes) {
|
|
561
|
-
// console.log('InfoConversationPage::updateAttributes');
|
|
562
|
-
// if (attributes) {
|
|
563
|
-
|
|
564
|
-
// // console.log("InfoConversationPage::subcribeOnOpenInfoConversation::attributes", attributes)
|
|
565
|
-
|
|
566
|
-
// this.attributesClient = (attributes.client) ? attributes.client : '';
|
|
567
|
-
// this.attributesSourcePage = (attributes.sourcePage) ? urlify(attributes.sourcePage) : '';
|
|
568
|
-
// //this.attributesDepartments = (attributes.departments)?this.arrayDepartments(attributes.departments).join(", "):'';
|
|
569
|
-
|
|
570
|
-
// this.createCustomAttributesMap(attributes);
|
|
571
|
-
// // console.log("InfoConversationPage::subcribeOnOpenInfoConversation::attributes", attributes);
|
|
572
|
-
// // console.log("InfoConversationPage::subcribeOnOpenInfoConversation::customAttributes", this.customAttributes);
|
|
573
|
-
// }
|
|
574
|
-
// }
|
|
575
|
-
|
|
576
|
-
/** */
|
|
577
|
-
subcribePopupConfirmation: any = (resp, action) => {
|
|
578
|
-
var that = this;
|
|
579
|
-
console.log("subcribePopupConfirmation", resp, action);
|
|
580
|
-
var LABEL_ANNULLA = this.translate.get('CLOSE_ALERT_CANCEL_LABEL')['value'];
|
|
581
|
-
if (resp === LABEL_ANNULLA) { return; }
|
|
582
|
-
if (action === 'leave') {
|
|
583
|
-
// create and show loading dialog
|
|
584
|
-
var spinnerMessage;
|
|
585
|
-
this.translate.get('LEAVING_GROUP_SPINNER_MSG').subscribe(
|
|
586
|
-
value => {
|
|
587
|
-
spinnerMessage = value;
|
|
588
|
-
}
|
|
589
|
-
)
|
|
590
|
-
this.createLoadingDialog(spinnerMessage);
|
|
591
|
-
|
|
592
|
-
this.leaveGroup(function callback(result) {
|
|
593
|
-
if (result == 'success') {
|
|
594
|
-
// dismiss the loading dialog
|
|
595
|
-
that.dismissLoadingDialog();
|
|
596
|
-
that.openPopupConfirmation('group-left');
|
|
597
|
-
} else if (result == 'error') {
|
|
598
|
-
// dismiss the loading dialog
|
|
599
|
-
that.dismissLoadingDialog();
|
|
600
|
-
that.openPopupConfirmation('cannot-leave-group');
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
} else if (action === 'close') {
|
|
604
|
-
this.closeConversation(this.conversationWith);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
/** */
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
// create a new attributes map without 'client', 'departmentId', 'departmentName', 'sourcePage', 'userEmail', 'userFullname'
|
|
614
|
-
private createCustomAttributesMap(attributes) {
|
|
615
|
-
var tempMap = [];
|
|
616
|
-
// perform a deep copy of the attributes item.
|
|
617
|
-
// it prevents the privacy leak issue
|
|
618
|
-
var temp = JSON.parse(JSON.stringify(attributes));
|
|
619
|
-
// remove 'client'
|
|
620
|
-
if (temp && temp['client']) delete temp['client'];
|
|
621
|
-
// remove 'departmentId'
|
|
622
|
-
if (temp && temp['departmentId']) delete temp['departmentId'];
|
|
623
|
-
// remove 'departmentName'
|
|
624
|
-
if (temp && temp['departmentName']) delete temp['departmentName'];
|
|
625
|
-
// remove 'sourcePage'
|
|
626
|
-
if (temp && temp['sourcePage']) delete temp['sourcePage'];
|
|
627
|
-
// remove 'userEmail'
|
|
628
|
-
if (temp && temp['userEmail']) delete temp['userEmail'];
|
|
629
|
-
// remove 'userFullname'
|
|
630
|
-
if (temp && temp['userFullname']) delete temp['userFullname'];
|
|
631
|
-
|
|
632
|
-
if (temp && temp['senderAuthInfo']) delete temp['senderAuthInfo'];
|
|
633
|
-
|
|
634
|
-
// add the remaining keys to the customAttributes array
|
|
635
|
-
for (var key in temp) {
|
|
636
|
-
if (temp.hasOwnProperty(key)) {
|
|
637
|
-
var val = temp[key];
|
|
638
|
-
// create the array item
|
|
639
|
-
var item = {
|
|
640
|
-
"key": key,
|
|
641
|
-
"value": val
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
// add the item to the custom attributes array
|
|
645
|
-
tempMap.push(item);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
this.customAttributes = tempMap;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
// subscription on conversation changes
|
|
659
|
-
subscribeConversationListener: any = (snapshot) => {
|
|
660
|
-
console.log('InfoConversationPage::subscribeConversationListener');
|
|
661
|
-
var that = this;
|
|
662
|
-
console.log("InfoConversationPage::subscribeConversationListener::snapshot:", snapshot.ref.toString());
|
|
663
|
-
if (snapshot.val()) {
|
|
664
|
-
console.log("InfoConversationPage::subscribeConversationListener::snapshotVal:", snapshot.val())
|
|
665
|
-
// conversation exists within conversation list
|
|
666
|
-
that.conversationEnabled = true;
|
|
667
|
-
} else {
|
|
668
|
-
// conversation not exists within conversation list
|
|
669
|
-
that.conversationEnabled = false;
|
|
670
|
-
}
|
|
671
|
-
console.log("InfoConversationPage::subscribeConversationListener::conversationEnabled:", this.conversationEnabled);
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
*
|
|
686
|
-
*/
|
|
687
|
-
userIsOnline(uid) {
|
|
688
|
-
const keySubscription = 'statusUser:online-' + uid;
|
|
689
|
-
this.events.subscribe(keySubscription, this.callbackUserIsOnline);
|
|
690
|
-
let isNewSubscription = this.addSubscription(keySubscription);
|
|
691
|
-
if (isNewSubscription) {
|
|
692
|
-
this.chatPresenceHandler.userIsOnline(uid);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
/**
|
|
696
|
-
* on subscribe stato utente con cui si conversa ONLINE
|
|
697
|
-
*/
|
|
698
|
-
callbackUserIsOnline: any = (uid, status) => {
|
|
699
|
-
// Update status member
|
|
700
|
-
|
|
701
|
-
if (this.channelType === TYPE_GROUP) {
|
|
702
|
-
for (var i = 0; i < this.listMembers.length; i++) {
|
|
703
|
-
const member = this.listMembers[i];
|
|
704
|
-
if(uid == this.currentUserDetail.uid) {
|
|
705
|
-
member.online = true;
|
|
706
|
-
break;
|
|
707
|
-
} else if (member.uid === uid) {
|
|
708
|
-
member.online = status;
|
|
709
|
-
console.log("----->ONLINE: ", member.uid, uid, member.online);
|
|
710
|
-
break;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
} else {
|
|
714
|
-
if(uid !== this.currentUserDetail.uid) {
|
|
715
|
-
this.online = status;
|
|
716
|
-
if (status == false) {
|
|
717
|
-
this.lastOnlineForUser(this.conversationWith);
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
lastOnlineForUser(uid) {
|
|
724
|
-
const keySubscription = 'lastConnectionDate-' + uid;
|
|
725
|
-
this.events.subscribe(keySubscription, this.callbackLastOnlineForUser);
|
|
726
|
-
let isNewSubscription = this.addSubscription(keySubscription);
|
|
727
|
-
if (isNewSubscription) {
|
|
728
|
-
console.log("subscribe::lastConnectionDate");
|
|
729
|
-
this.chatPresenceHandler.lastOnlineForUser(uid);
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
callbackLastOnlineForUser: any = (uid, lastConnectionDate) => {
|
|
734
|
-
console.log("callbackLastOnlineForUser::", lastConnectionDate);
|
|
735
|
-
this.lastConnectionDate = lastConnectionDate;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
/**
|
|
742
|
-
* subscribe to node membersInfo (list Verified Member)
|
|
743
|
-
* quando mi restituisce un memberinfo lo aggiorno o aggiungo in members[]
|
|
744
|
-
*
|
|
745
|
-
*/
|
|
746
|
-
checkVerifiedMembers(uid) {
|
|
747
|
-
// DISTRUGGILA ALL'USCITA!!!!!
|
|
748
|
-
console.log("checkVerifiedMembers");
|
|
749
|
-
const keySubscription = 'callbackCheckVerifiedMembers-' + uid;
|
|
750
|
-
if (this.addSubscription(keySubscription)) {
|
|
751
|
-
this.events.subscribe(keySubscription, this.callbackCheckVerifiedMembers);
|
|
752
|
-
this.groupService.loadMembersInfo(this.conversationWith, this.tenant, uid);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
/**
|
|
758
|
-
* verifico se il membro è presente e aggiorno
|
|
759
|
-
* altrimenti aggiungo
|
|
760
|
-
*/
|
|
761
|
-
callbackCheckVerifiedMembers: any = (snapshot) => {
|
|
762
|
-
console.log("callbackCheckVerifiedMembers", snapshot);
|
|
763
|
-
this.listMembers.forEach(member => {
|
|
764
|
-
if (snapshot.hasChild(member.uid)) {
|
|
765
|
-
console.log("CHECKED", member.uid);
|
|
766
|
-
member.checked = true;
|
|
767
|
-
} else {
|
|
768
|
-
console.log("UNCHECKED", member.uid);
|
|
769
|
-
member.checked = false;
|
|
770
|
-
}
|
|
771
|
-
});
|
|
772
|
-
|
|
773
|
-
// for (var i = 0; i < this.listMembers.length; i++) {
|
|
774
|
-
// const member = this.listMembers[i];
|
|
775
|
-
// if (member.uid === uid) {
|
|
776
|
-
// member.checked = true;
|
|
777
|
-
// console.log("----->VERIFIATO: ", member.uid, uid, member.checked);
|
|
778
|
-
// }
|
|
779
|
-
// }
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
/** */
|
|
786
|
-
arrayDepartments(departments): any[] {
|
|
787
|
-
// console.log('departments:::: ', departments);
|
|
788
|
-
let arrayDepartments = [];
|
|
789
|
-
const departmentsStr = JSON.stringify(departments);
|
|
790
|
-
JSON.parse(departmentsStr, (key, value) => {
|
|
791
|
-
arrayDepartments.push(value);
|
|
792
|
-
});
|
|
793
|
-
return arrayDepartments.slice(0, -1);
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
//// ACTIONS ////
|
|
800
|
-
/** */
|
|
801
|
-
leaveGroup(callback) {
|
|
802
|
-
// var spinnerMessage;
|
|
803
|
-
// this.translate.get('LEAVING_GROUP_SPINNER_MSG').subscribe(
|
|
804
|
-
// value => {
|
|
805
|
-
// spinnerMessage = value;
|
|
806
|
-
// }
|
|
807
|
-
// );
|
|
808
|
-
|
|
809
|
-
// this.loadingDialog = createLoading(this.loadingCtrl, spinnerMessage);
|
|
810
|
-
// this.loadingDialog.present();
|
|
811
|
-
|
|
812
|
-
const uidUser = this.chatManager.getLoggedUser().uid; //'U4HL3GWjBsd8zLX4Vva0s7W2FN92';
|
|
813
|
-
const uidGroup = this.conversationWith;//'support-group-L5Kb42X1MaM71fGgL66';
|
|
814
|
-
this.groupService.leaveAGroup(uidGroup, uidUser, function (response, error) {
|
|
815
|
-
if (error) {
|
|
816
|
-
console.error('closeGroup ERROR MESSAGE', error);
|
|
817
|
-
callback('error', error);
|
|
818
|
-
}
|
|
819
|
-
else {
|
|
820
|
-
callback('success', response);
|
|
821
|
-
}
|
|
822
|
-
});
|
|
823
|
-
// this.groupService.leaveAGroup(uidGroup, uidUser)
|
|
824
|
-
// .subscribe(
|
|
825
|
-
// response => {
|
|
826
|
-
// console.log('leaveGroup OK sender ::::', response);
|
|
827
|
-
// //this.dismissLoadingDialog();
|
|
828
|
-
// callback('success');
|
|
829
|
-
// },
|
|
830
|
-
// errMsg => {
|
|
831
|
-
// //this.dismissLoadingDialog();
|
|
832
|
-
// console.log('leaveGroup ERROR MESSAGE', errMsg);
|
|
833
|
-
// callback('error');
|
|
834
|
-
// },
|
|
835
|
-
// () => {
|
|
836
|
-
// console.log('leaveGroup API ERROR NESSUNO');
|
|
837
|
-
// }
|
|
838
|
-
// );
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
/** */
|
|
842
|
-
closeGroup(callback) {
|
|
843
|
-
const uidGroup = this.conversationWith;//'support-group-L5Kb42X1MaM71fGgL66';
|
|
844
|
-
var that = this;
|
|
845
|
-
this.groupService.closeGroup(uidGroup, function (response, error) {
|
|
846
|
-
if (error) {
|
|
847
|
-
console.error('closeGroup ERROR MESSAGE', error);
|
|
848
|
-
callback('error', error);
|
|
849
|
-
}
|
|
850
|
-
else {
|
|
851
|
-
callback('success', response);
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
// this.groupService.closeGroup(uidGroup)
|
|
855
|
-
// .subscribe(
|
|
856
|
-
// response => {
|
|
857
|
-
// // console.log('OK closeGroup ::::', response);
|
|
858
|
-
// // this.loading.dismiss();
|
|
859
|
-
// // this.dismissLoading();
|
|
860
|
-
// callback('success');
|
|
861
|
-
// },
|
|
862
|
-
// errMsg => {
|
|
863
|
-
// // this.dismissLoading();
|
|
864
|
-
// console.error('closeGroup ERROR MESSAGE', errMsg);
|
|
865
|
-
// // this.loading.dismiss();
|
|
866
|
-
// callback('error');
|
|
867
|
-
// },
|
|
868
|
-
// () => {
|
|
869
|
-
// // console.log('closeGroup API ERROR NESSUNO');
|
|
870
|
-
// }
|
|
871
|
-
// );
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
/** */
|
|
875
|
-
// setVideoChat() {
|
|
876
|
-
// // setto url
|
|
877
|
-
// const url = environment.URL_VIDEO_CHAT + '?groupId=' + this.groupDetail.uid + '&popup=true';
|
|
878
|
-
// // this.events.publish('openVideoChat', url);
|
|
879
|
-
// this.openPopupConfirmation('video-chat');
|
|
880
|
-
// }
|
|
881
|
-
|
|
882
|
-
// getUrlCreaTicket() {
|
|
883
|
-
// // setto url
|
|
884
|
-
// return environment.URL_TICKET_CHAT;
|
|
885
|
-
// //const url = URL_TICKET_CHAT + '&popup=true';
|
|
886
|
-
// //this.events.publish('openVideoChat', url);
|
|
887
|
-
// }
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
*
|
|
892
|
-
* @param action
|
|
893
|
-
*/
|
|
894
|
-
openPopupConfirmation(action) {
|
|
895
|
-
// console.log("openPopupConfirmation");
|
|
896
|
-
//debugger;
|
|
897
|
-
let alertTitle = '';
|
|
898
|
-
let alertMessage = '';
|
|
899
|
-
this.translate.get('ALERT_TITLE').subscribe(
|
|
900
|
-
value => {
|
|
901
|
-
alertTitle = value;
|
|
902
|
-
}
|
|
903
|
-
)
|
|
904
|
-
var onlyOkButton = false;
|
|
905
|
-
if (action === 'leave') {
|
|
906
|
-
this.translate.get('LEAVE_ALERT_MSG').subscribe(
|
|
907
|
-
value => {
|
|
908
|
-
alertMessage = value;
|
|
909
|
-
}
|
|
910
|
-
)
|
|
911
|
-
onlyOkButton = false;
|
|
912
|
-
} else if (action === 'group-left') {
|
|
913
|
-
this.translate.get('CONVERSATION_LEFT_ALERT_MSG').subscribe(
|
|
914
|
-
value => {
|
|
915
|
-
alertMessage = value;
|
|
916
|
-
}
|
|
917
|
-
)
|
|
918
|
-
onlyOkButton = true;
|
|
919
|
-
} else if (action === 'cannot-leave-group') {
|
|
920
|
-
this.translate.get('CANNOT_LEAVE_GROUP_ALERT_MSG').subscribe(
|
|
921
|
-
value => {
|
|
922
|
-
alertMessage = value;
|
|
923
|
-
}
|
|
924
|
-
)
|
|
925
|
-
onlyOkButton = false;
|
|
926
|
-
} else if (action === 'close') {
|
|
927
|
-
this.translate.get('CLOSE_ALERT_MSG').subscribe(
|
|
928
|
-
value => {
|
|
929
|
-
alertMessage = value;
|
|
930
|
-
}
|
|
931
|
-
)
|
|
932
|
-
onlyOkButton = false;
|
|
933
|
-
} else if (action === 'video-chat') {
|
|
934
|
-
this.translate.get('VIDEOCHAT_ALERT_MSG').subscribe(
|
|
935
|
-
value => {
|
|
936
|
-
alertMessage = value;
|
|
937
|
-
}
|
|
938
|
-
)
|
|
939
|
-
onlyOkButton = false;
|
|
940
|
-
}
|
|
941
|
-
// console.log("onlyOkButton", onlyOkButton);
|
|
942
|
-
this.confirmDialog = createConfirm(this.translate, this.alertCtrl, this.events, alertTitle, alertMessage, action, onlyOkButton);
|
|
943
|
-
this.confirmDialog.present();
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
/** */
|
|
947
|
-
isSupportGroup() {
|
|
948
|
-
//debugger;
|
|
949
|
-
return this.groupService.isSupportGroup(this.groupDetail.uid);
|
|
950
|
-
// let uid = this.groupDetail.uid;
|
|
951
|
-
// if(uid.indexOf(TYPE_SUPPORT_GROUP) === 0 ){
|
|
952
|
-
// return true;
|
|
953
|
-
// }
|
|
954
|
-
// return false;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
private createLoadingDialog(message) {
|
|
958
|
-
this.loadingDialog = createLoading(this.loadingCtrl, message);
|
|
959
|
-
this.loadingDialog.present();
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
private dismissLoadingDialog() {
|
|
963
|
-
if (this.loadingDialog) {
|
|
964
|
-
this.loadingDialog.dismiss();
|
|
965
|
-
this.loadingDialog = null;
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
private dismissConfirmDialog() {
|
|
970
|
-
if (this.confirmDialog) {
|
|
971
|
-
this.confirmDialog.dismiss();
|
|
972
|
-
this.confirmDialog = null;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
private closeConversation(conversationId) {
|
|
977
|
-
console.log("InfoConversationPage::closeConversation::conversationId", conversationId);
|
|
978
|
-
var isSupportConversation = conversationId.startsWith("support-group");
|
|
979
|
-
if (!isSupportConversation) {
|
|
980
|
-
// console.log("InfoConversationPage::closeConversation:: is not a support group");
|
|
981
|
-
this.deleteConversation(conversationId, function (result, data) {
|
|
982
|
-
if (result === 'success') {
|
|
983
|
-
console.log("InfoConversationPage::closeConversation::deleteConversation::OK", data);
|
|
984
|
-
} else if (result === 'error') {
|
|
985
|
-
console.log("InfoConversationPage::closeConversation::deleteConversation::error", data);
|
|
986
|
-
}
|
|
987
|
-
});
|
|
988
|
-
// https://github.com/chat21/chat21-cloud-functions/blob/master/docs/api.md#delete-a-conversation
|
|
989
|
-
} else {
|
|
990
|
-
// console.log("InfoConversationPage::closeConversation::closeConversation:: is a support group");
|
|
991
|
-
|
|
992
|
-
// the conversationId is:
|
|
993
|
-
// - the recipientId if it is a direct conversation;
|
|
994
|
-
// - the groupId if it is a group conversation;
|
|
995
|
-
// the groupId can reference:
|
|
996
|
-
// - a normal group;
|
|
997
|
-
// - a support group if it starts with "support-group"
|
|
998
|
-
this.closeSupportGroup(conversationId, function (result, data) {
|
|
999
|
-
if (result === 'success') {
|
|
1000
|
-
// console.log("InfoConversationPage::closeConversation::closeSupportGroup::response", data);
|
|
1001
|
-
} else if (result === 'error') {
|
|
1002
|
-
console.log("InfoConversationPage::closeConversation::closeSupportGroup::error", data);
|
|
1003
|
-
}
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
// close the support group
|
|
1009
|
-
// more details availables at
|
|
1010
|
-
// https://github.com/chat21/chat21-cloud-functions/blob/master/docs/api.md#close-support-group
|
|
1011
|
-
private closeSupportGroup(groupId, callback) {
|
|
1012
|
-
|
|
1013
|
-
var that = this;
|
|
1014
|
-
|
|
1015
|
-
// BEGIN - REMOVE FROM LOCAL MEMORY
|
|
1016
|
-
// console.log("performClosingConversation::conversations::BEFORE", JSON.stringify(this.conversationsHandler.conversations) )
|
|
1017
|
-
this.conversationsHandler.removeByUid(groupId); // remove the item
|
|
1018
|
-
// this.conversations = this.conversationsHandler.conversations; // update conversations
|
|
1019
|
-
// console.log("performClosingConversation::conversations::AFTER", JSON.stringify(this.conversationsHandler.conversations))
|
|
1020
|
-
// END - REMOVE FROM LOCAL MEMORY
|
|
1021
|
-
|
|
1022
|
-
// BEGIN - REMOVE FROM REMOTE
|
|
1023
|
-
//set the conversation from the isConversationClosingMap that is waiting to be closed
|
|
1024
|
-
this.tiledeskConversationProvider.setClosingConversation(groupId, true);
|
|
1025
|
-
|
|
1026
|
-
this.groupService.closeGroup(groupId, function (response, error) {
|
|
1027
|
-
if (error) {
|
|
1028
|
-
// the conversation closing failed: restore the conversation with
|
|
1029
|
-
// conversationId status to false within the isConversationClosingMap
|
|
1030
|
-
that.tiledeskConversationProvider.setClosingConversation(groupId, false);
|
|
1031
|
-
callback('error', error);
|
|
1032
|
-
}
|
|
1033
|
-
else {
|
|
1034
|
-
callback('success', response);
|
|
1035
|
-
}
|
|
1036
|
-
});
|
|
1037
|
-
|
|
1038
|
-
// this.groupService.closeGroup(groupId)
|
|
1039
|
-
// .subscribe(response => {
|
|
1040
|
-
// callback('success', response);
|
|
1041
|
-
// }, errMsg => {
|
|
1042
|
-
// // the conversation closing failed: restore the conversation with
|
|
1043
|
-
// // conversationId status to false within the isConversationClosingMap
|
|
1044
|
-
// that.tiledeskConversationProvider.setClosingConversation(groupId, false);
|
|
1045
|
-
|
|
1046
|
-
// callback('error', errMsg);
|
|
1047
|
-
// }, () => {
|
|
1048
|
-
// // console.log("InfoConversationPage::closeSupportGroup::completition");
|
|
1049
|
-
// });
|
|
1050
|
-
// // END - REMOVE FROM REMOTE
|
|
1051
|
-
|
|
1052
|
-
// when a conversations is closed shows a placeholder background
|
|
1053
|
-
if (groupId === that.conversationWith) {
|
|
1054
|
-
console.log('PlaceholderPage 5');
|
|
1055
|
-
that.navProxy.pushDetail(PlaceholderPage, {});
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
// delete a conversation form the personal timeline
|
|
1060
|
-
// more details availables at
|
|
1061
|
-
// https://github.com/chat21/chat21-cloud-functions/blob/master/docs/api.md#delete-a-conversation
|
|
1062
|
-
private deleteConversation(conversationId, callback) {
|
|
1063
|
-
// console.log("InfoConversationPage::deleteConversation::conversationId", conversationId);
|
|
1064
|
-
|
|
1065
|
-
var that = this;
|
|
1066
|
-
|
|
1067
|
-
// END - REMOVE FROM LOCAL MEMORY
|
|
1068
|
-
// console.log("deleteConversation::conversations::BEFORE", JSON.stringify(this.conversationsHandler.conversations))
|
|
1069
|
-
this.conversationsHandler.removeByUid(conversationId); // remove the item
|
|
1070
|
-
// this.conversations = this.conversationsHandler.conversations; // update conversations
|
|
1071
|
-
// console.log("deleteConversation::conversations::AFTER", JSON.stringify(this.conversationsHandler.conversations))
|
|
1072
|
-
// END - REMOVE FROM LOCAL MEMORY
|
|
1073
|
-
|
|
1074
|
-
// BEGIN - REMOVE FROM REMOTE
|
|
1075
|
-
//set the conversation from the isConversationClosingMap that is waiting to be closed
|
|
1076
|
-
this.tiledeskConversationProvider.setClosingConversation(conversationId, true);
|
|
1077
|
-
|
|
1078
|
-
this.tiledeskConversationProvider.deleteConversation(conversationId, function (response, error) {
|
|
1079
|
-
if (error) {
|
|
1080
|
-
that.tiledeskConversationProvider.setClosingConversation(conversationId, false);
|
|
1081
|
-
callback('error', error);
|
|
1082
|
-
}
|
|
1083
|
-
else {
|
|
1084
|
-
callback('success', response);
|
|
1085
|
-
}
|
|
1086
|
-
});
|
|
1087
|
-
|
|
1088
|
-
// this.tiledeskConversationProvider.deleteConversation(conversationId)
|
|
1089
|
-
// .subscribe(response => {
|
|
1090
|
-
// callback('success', response);
|
|
1091
|
-
// }, errMsg => {
|
|
1092
|
-
// // the conversation closing failed: restore the conversation with
|
|
1093
|
-
// // conversationId status to false within the isConversationClosingMap
|
|
1094
|
-
// that.tiledeskConversationProvider.setClosingConversation(conversationId, false);
|
|
1095
|
-
// callback('error', errMsg);
|
|
1096
|
-
// }, () => {
|
|
1097
|
-
// // console.log("InfoConversationPage::deleteConversation::completition");
|
|
1098
|
-
// });
|
|
1099
|
-
// // END - REMOVE FROM REMOTE
|
|
1100
|
-
|
|
1101
|
-
// when a conversations is closed shows a placeholder background
|
|
1102
|
-
if (conversationId === that.conversationWith) {
|
|
1103
|
-
console.log('PlaceholderPage 6');
|
|
1104
|
-
that.navProxy.pushDetail(PlaceholderPage, {});
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
private existsInArray(array: ConversationModel[], uid): boolean {
|
|
1109
|
-
var index = array.map(function (o) { return o.uid; }).indexOf(uid);
|
|
1110
|
-
|
|
1111
|
-
// console.log('echouid', uid);
|
|
1112
|
-
// console.log('echoindex', index);
|
|
1113
|
-
|
|
1114
|
-
return index > -1;
|
|
1115
|
-
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
onCloseInfoPage() {
|
|
1120
|
-
this.eventClose.emit();
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
ngOnDestroy() {
|
|
1124
|
-
console.log("ngOnDestroy");
|
|
1125
|
-
this.unsubscribeAll();
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
sendMail() {
|
|
1129
|
-
const url = this.appConfig.getConfig().CHAT_SEND_BY_EMAIL_LINK + this.conversationSelected.uid + '/messages.html';
|
|
1130
|
-
window.open(url, '_blank', 'location=yes');
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
openInfoUser(member) {
|
|
1134
|
-
console.log("openInfoUser", member);
|
|
1135
|
-
this.eventOpenInfoUser.emit(member);
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
openUserRequest() {
|
|
1140
|
-
// this.projectId = '5b55e806c93dde00143163dd';
|
|
1141
|
-
// "https://support.tiledesk.com/dashboard/#/project/5af02d8f705ac600147f0cbb/request/support-group-LEOsofmVWYtljdxTf3c/messages";
|
|
1142
|
-
// var url = "https://support.tiledesk.com/dashboard/#/project/" + this.attributes.projectId + "/request/" + this.conversationWith + "/messages";
|
|
1143
|
-
console.log('openUserDetail this.attributes :', this.attributes);
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
// -------------------------------------------------------------------------------------------
|
|
1147
|
-
// @ PROD v1
|
|
1148
|
-
// -------------------------------------------------------------------------------------------
|
|
1149
|
-
// var url = environment.URL_PROJECT_ID + this.attributes.projectId + "/request/" + this.conversationWith + "/messages";
|
|
1150
|
-
|
|
1151
|
-
// -------------------------------------------------------------------------------------------
|
|
1152
|
-
// @ PRE
|
|
1153
|
-
// -------------------------------------------------------------------------------------------
|
|
1154
|
-
|
|
1155
|
-
var url = this.appConfig.getConfig().DASHBOARD_URL + "#/project/" + this.attributes.projectId + "/wsrequest/" + this.conversationWith + "/messages";
|
|
1156
|
-
|
|
1157
|
-
console.log('openUserDetail:', url);
|
|
1158
|
-
window.open(url, '_blank');
|
|
1159
|
-
//https://support.tiledesk.com/dashboard/#/project/5b55e806c93dde00143163dd/contact/5bf6705275a5a40015327b91
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
openProjectHome() {
|
|
1165
|
-
// this.projectId = '5b55e806c93dde00143163dd';
|
|
1166
|
-
// "https://support.tiledesk.com/dashboard/#/project/5af02d8f705ac600147f0cbb/request/support-group-LEOsofmVWYtljdxTf3c/messages";
|
|
1167
|
-
// var url = "https://support.tiledesk.com/dashboard/#/project/" + this.attributes.projectId + "/home/";
|
|
1168
|
-
var url = this.appConfig.getConfig().DASHBOARD_URL + "#/project/" + this.attributes.projectId + "/home/";
|
|
1169
|
-
|
|
1170
|
-
console.log('openProjectHome:', url);
|
|
1171
|
-
window.open(url, '_blank');
|
|
1172
|
-
//https://support.tiledesk.com/dashboard/#/project/5b55e806c93dde00143163dd/contact/5bf6705275a5a40015327b91
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
openInfoAdvancedPage() {
|
|
1176
|
-
var advancedAttributes = []
|
|
1177
|
-
var item: any = {}
|
|
1178
|
-
if (this.channelType == TYPE_GROUP) {
|
|
1179
|
-
item = { "key": "ID_CONVERSATION", "value": this.groupDetail.uid }
|
|
1180
|
-
advancedAttributes.push(item)
|
|
1181
|
-
item = { "key": "LABEL_CREATED_THE", "value": this.groupDetail.createdOn }
|
|
1182
|
-
advancedAttributes.push(item)
|
|
1183
|
-
} else {
|
|
1184
|
-
item = { "key": "ID_CONVERSATION", "value": this.userDetail.uid }
|
|
1185
|
-
advancedAttributes.push(item)
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
// advancedAttributes['createdOn'] = this.groupDetail.createdOn
|
|
1189
|
-
this.customAttributes.forEach(attr => {
|
|
1190
|
-
//advancedAttributes[attr.key] = attr.value
|
|
1191
|
-
item = { "key": attr.key, "value": attr.value }
|
|
1192
|
-
advancedAttributes.push(item)
|
|
1193
|
-
});
|
|
1194
|
-
console.log("advancedAttributes", advancedAttributes);
|
|
1195
|
-
this.eventOpenInfoAdvanced.emit(advancedAttributes);
|
|
1196
|
-
}
|
|
1197
|
-
/**
|
|
1198
|
-
*
|
|
1199
|
-
*/
|
|
1200
|
-
addSubscription(key) {
|
|
1201
|
-
console.log("addSubscription--->", key, this.subscriptions);
|
|
1202
|
-
if (!isExistInArray(this.subscriptions, key)) {
|
|
1203
|
-
console.log("addSubscription: TRUE");
|
|
1204
|
-
this.subscriptions.push(key);
|
|
1205
|
-
return true;
|
|
1206
|
-
}
|
|
1207
|
-
console.log("addSubscription: FALSE");
|
|
1208
|
-
return false;
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
/**
|
|
1212
|
-
* unsubscribe all subscribe events
|
|
1213
|
-
*/
|
|
1214
|
-
unsubscribeAll() {
|
|
1215
|
-
this.subscriptions.forEach((key) => {
|
|
1216
|
-
console.log("unsubscribe:", key);
|
|
1217
|
-
this.events.unsubscribe(key, null);
|
|
1218
|
-
});
|
|
1219
|
-
this.groupService.onDisconnectMembersInfo();
|
|
1220
|
-
this.groupService.onDisconnectLoadGroupDetail();
|
|
1221
|
-
}
|
|
1222
|
-
// ----------------------------------------- //
|
|
1223
|
-
|
|
1224
|
-
isExistUidUserAuthenticatedInMembers() {
|
|
1225
|
-
if (this.signInProvider === 'custom' && this.uidUserAuthenticated && this.groupDetail) {
|
|
1226
|
-
//console.log('uidUserAuthenticated',this.uidUserAuthenticated);
|
|
1227
|
-
return isExistInArray(this.groupDetail.members, this.uidUserAuthenticated);
|
|
1228
|
-
}
|
|
1229
|
-
return false;
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
}
|