@chat21/chat21-ionic 3.0.109-rc.2 → 3.1.0-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/config.xml +3 -0
- package/package.json +1 -1
- package/src/app/app.component.ts +2 -1
- package/src/app/components/sidebar/sidebar.component.html +1 -1
- package/src/app/components/sidebar/sidebar.component.ts +2 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +23 -1
- package/src/app/utils/BrandResources.ts +5 -4
- package/src/app/utils/utils-resources.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +9 -12
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +3 -3
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +10 -19
- package/src/chat21-core/utils/constants.ts +9 -7
- package/src/chat21-core/utils/utils-message.ts +23 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.1.0-rc1
|
|
4
|
+
- added: INFO_MESSAGE_TYPE enum added to manage info message keys into message.attributes object
|
|
5
|
+
- changed: route to main page ('/conversation-detail') when a conversation is closed or abandoned
|
|
6
|
+
- bug-fixed: if agent abandoned a chat, detail still remain visible and can send message
|
|
7
|
+
|
|
3
8
|
### 3.0.109 in PROD
|
|
4
9
|
|
|
5
10
|
### 3.0.109-rc.1
|
package/config.xml
CHANGED
|
@@ -103,6 +103,9 @@
|
|
|
103
103
|
<splash height="1792" src="resources/ios/splash/Default-1792h~iphone.png" width="828" />
|
|
104
104
|
<splash height="828" src="resources/ios/splash/Default-Landscape-1792h~iphone.png" width="1792" />
|
|
105
105
|
</platform>
|
|
106
|
+
<platform name="browser">
|
|
107
|
+
<preference name="ShowSplashScreen" value="false" />
|
|
108
|
+
</platform>
|
|
106
109
|
<engine name="browser" spec="^5.0.4" />
|
|
107
110
|
<plugin name="cordova-android-support-gradle-release" spec="^3.0.1">
|
|
108
111
|
<variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
|
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -1119,7 +1119,8 @@ export class AppComponent implements OnInit {
|
|
|
1119
1119
|
this.logger.log('[APP-COMP] ***** conversationRemoved *****', conversation);
|
|
1120
1120
|
if(conversation) {
|
|
1121
1121
|
this.updateConversationsOnStorage();
|
|
1122
|
-
this.segmentResolved(conversation)
|
|
1122
|
+
this.segmentResolved(conversation);
|
|
1123
|
+
this.router.navigateByUrl('conversation-detail/'); //redirect to basePage
|
|
1123
1124
|
}
|
|
1124
1125
|
});
|
|
1125
1126
|
}
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
|
|
223
223
|
</ul>
|
|
224
224
|
|
|
225
|
-
<div matTooltipClass="custom-mat-tooltip" [matTooltip]="
|
|
225
|
+
<div matTooltipClass="custom-mat-tooltip" [matTooltip]="BRAND_BASE_INFO['COMPANY_NAME']" class="logoBrand"
|
|
226
226
|
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
|
|
227
227
|
<!-- ------------------------------------------- -->
|
|
228
228
|
<!-- LOGO BRAND (click)="goToOfficialSite()" -->
|
|
@@ -60,6 +60,7 @@ export class SidebarComponent implements OnInit {
|
|
|
60
60
|
dashboard_settings_url: string;
|
|
61
61
|
tiledesk_url: string;
|
|
62
62
|
LOGOS_ITEMS = LOGOS_ITEMS;
|
|
63
|
+
BRAND_BASE_INFO = BRAND_BASE_INFO;
|
|
63
64
|
constructor(
|
|
64
65
|
public imageRepoService: ImageRepoService,
|
|
65
66
|
public appStorageService: AppStorageService,
|
|
@@ -77,7 +78,7 @@ export class SidebarComponent implements OnInit {
|
|
|
77
78
|
this.tiledesk_url = BRAND_BASE_INFO['COMPANY_SITE_URL']
|
|
78
79
|
|
|
79
80
|
this.DASHBOARD_URL = this.appConfig.getConfig().dashboardUrl + '#/project/';
|
|
80
|
-
|
|
81
|
+
console.log('[SIDEBAR] DASHBOARD_URL ', this.DASHBOARD_URL, LOGOS_ITEMS)
|
|
81
82
|
this.getStoredProjectAndUserRole()
|
|
82
83
|
this.subcribeToAuthStateChanged()
|
|
83
84
|
this.listenTocurrentProjectUserUserAvailability$()
|
|
@@ -61,7 +61,8 @@ import {
|
|
|
61
61
|
TYPE_MSG_EMAIL,
|
|
62
62
|
TYPE_MSG_FORM,
|
|
63
63
|
CHANNEL_TYPE_TELEGRAM,
|
|
64
|
-
CHANNEL_TYPE_WHATSAPP
|
|
64
|
+
CHANNEL_TYPE_WHATSAPP,
|
|
65
|
+
INFO_MESSAGE_TYPE
|
|
65
66
|
} from 'src/chat21-core/utils/constants'
|
|
66
67
|
import {
|
|
67
68
|
checkPlatformIsMobile,
|
|
@@ -71,6 +72,7 @@ import {
|
|
|
71
72
|
} from '../../../chat21-core/utils/utils'
|
|
72
73
|
import {
|
|
73
74
|
getProjectIdSelectedConversation,
|
|
75
|
+
infoMessageType,
|
|
74
76
|
isFirstMessage,
|
|
75
77
|
isInfo,
|
|
76
78
|
isMine,
|
|
@@ -219,6 +221,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
219
221
|
*/
|
|
220
222
|
constructor(
|
|
221
223
|
private route: ActivatedRoute,
|
|
224
|
+
private router: Router,
|
|
222
225
|
public chatManager: ChatManager,
|
|
223
226
|
public actionSheetCtrl: ActionSheetController,
|
|
224
227
|
public platform: Platform,
|
|
@@ -1213,6 +1216,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1213
1216
|
this.logger.log('[CONVS-DETAIL] subscribe to messageInfo - messageId ', msg, this.conversation)
|
|
1214
1217
|
if (msg) {
|
|
1215
1218
|
that.updateLeadInfo(msg)
|
|
1219
|
+
that.manageInfoMessage(msg)
|
|
1216
1220
|
// this.updateLiveInfo(msg)
|
|
1217
1221
|
// this.setHeaderContent()
|
|
1218
1222
|
}
|
|
@@ -1292,6 +1296,24 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1292
1296
|
})
|
|
1293
1297
|
}
|
|
1294
1298
|
|
|
1299
|
+
manageInfoMessage(msg: MessageModel){
|
|
1300
|
+
this.logger.log('[CONVS-DETAIL] manageInfoMessage --> ', msg)
|
|
1301
|
+
switch(infoMessageType(msg)){
|
|
1302
|
+
case INFO_MESSAGE_TYPE.MEMBER_JOINED_GROUP:
|
|
1303
|
+
break;
|
|
1304
|
+
case INFO_MESSAGE_TYPE.CHAT_REOPENED:
|
|
1305
|
+
break;
|
|
1306
|
+
case INFO_MESSAGE_TYPE.CHAT_CLOSED:
|
|
1307
|
+
break;
|
|
1308
|
+
case INFO_MESSAGE_TYPE.LEAD_UPDATED:
|
|
1309
|
+
break;
|
|
1310
|
+
case INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP:
|
|
1311
|
+
break;
|
|
1312
|
+
case INFO_MESSAGE_TYPE.LIVE_PAGE:
|
|
1313
|
+
break;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1295
1317
|
updateLeadInfo(msg) {
|
|
1296
1318
|
if (msg.attributes && msg.attributes.hasOwnProperty("updateUserFullname")) {
|
|
1297
1319
|
const userFullname = msg.attributes['updateUserFullname'];
|
|
@@ -28,11 +28,12 @@ export class BrandResources {
|
|
|
28
28
|
/** CSS */
|
|
29
29
|
document.body.style.setProperty('--base-brand-color', this.brand['BRAND_COLOR']);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
Object.keys(LOGOS_ITEMS).forEach(key => { LOGOS_ITEMS[key].icon = this.brand[key];})
|
|
33
|
-
|
|
31
|
+
|
|
34
32
|
/** BRAND_BASE_INFO */
|
|
35
|
-
Object.keys(BRAND_BASE_INFO).forEach(key => BRAND_BASE_INFO[key] = this.brand[key])
|
|
33
|
+
Object.keys(BRAND_BASE_INFO).forEach(key => BRAND_BASE_INFO[key] = this.brand[key] )
|
|
34
|
+
|
|
35
|
+
/** LOGOS_ITEMS */
|
|
36
|
+
Object.keys(LOGOS_ITEMS).forEach(key => { LOGOS_ITEMS[key].icon = this.brand[key]; })
|
|
36
37
|
|
|
37
38
|
// /** INFO_MENU_ITEMS */
|
|
38
39
|
// let result: Array<{ key: string, label: string, icon: string, type: TYPE_URL, status: "active" | "inactive", src?: string}> = Array.from([...INFO_MENU_ITEMS, ...this.brand['INFO_MENU_ITEMS']].reduce((m, o) => m.set(o.key, o), new Map).values());
|
|
@@ -8,7 +8,7 @@ export const BRAND_BASE_INFO: { [key: string] : string} ={
|
|
|
8
8
|
META_TITLE:"Tiledesk - Open Source Live Chat"
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export var LOGOS_ITEMS: { [key: string] : { label: string, icon: string }} ={
|
|
12
12
|
COMPANY_LOGO: {label: BRAND_BASE_INFO.COMPANY_NAME, icon: 'assets/logos/tiledesk_logo.svg'},
|
|
13
13
|
COMPANY_LOGO_NO_TEXT: {label: BRAND_BASE_INFO.COMPANY_NAME, icon: 'assets/logos/tiledesk_logo_no_text.svg'},
|
|
14
14
|
BASE_LOGO: {label: BRAND_BASE_INFO.BRAND_NAME, icon: 'assets/logos/tiledesk_logo.svg'},
|
|
@@ -18,11 +18,11 @@ import { ConversationHandlerService } from '../abstract/conversation-handler.ser
|
|
|
18
18
|
import { LoggerService } from '../abstract/logger.service';
|
|
19
19
|
import { LoggerInstance } from '../logger/loggerInstance';
|
|
20
20
|
// utils
|
|
21
|
-
import { MSG_STATUS_RECEIVED,
|
|
21
|
+
import { MSG_STATUS_RECEIVED, TYPE_DIRECT, MESSAGE_TYPE_INFO, INFO_MESSAGE_TYPE } from '../../utils/constants';
|
|
22
22
|
import { compareValues, searchIndexInArrayForUid, conversationMessagesRef } from '../../utils/utils';
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
import { messageType, isEmojii, isSender } from 'src/chat21-core/utils/utils-message';
|
|
25
|
+
import { messageType, isEmojii, isSender, infoMessageType } from 'src/chat21-core/utils/utils-message';
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -376,10 +376,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
376
376
|
const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
|
|
377
377
|
const INFO_SUPPORT_LIVE_PAGE = this.translationMap.get('INFO_SUPPORT_LIVE_PAGE');
|
|
378
378
|
|
|
379
|
-
if (message.attributes.messagelabel
|
|
380
|
-
&& message.attributes.messagelabel.parameters
|
|
381
|
-
&& message.attributes.messagelabel.key === MEMBER_JOINED_GROUP
|
|
382
|
-
) {
|
|
379
|
+
if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_JOINED_GROUP && message.attributes.messagelabel.parameters) {
|
|
383
380
|
let subject: string;
|
|
384
381
|
let verb: string;
|
|
385
382
|
let complement: string;
|
|
@@ -402,20 +399,20 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
402
399
|
}
|
|
403
400
|
}
|
|
404
401
|
message.text = subject + ' ' + verb + ' ' + complement;
|
|
405
|
-
} else if ((message
|
|
402
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.CHAT_REOPENED ) {
|
|
406
403
|
message.text = INFO_SUPPORT_CHAT_REOPENED;
|
|
407
|
-
} else if ((message
|
|
404
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.CHAT_CLOSED ) {
|
|
408
405
|
message.text = INFO_SUPPORT_CHAT_CLOSED;
|
|
409
|
-
} else if ((message
|
|
406
|
+
} else if ((infoMessageType(message) === INFO_MESSAGE_TYPE.TOUCHING_OPERATOR) && message.sender === "system") {
|
|
410
407
|
// console.log('FIREBASEConversationHandlerSERVICE message text', message.text)
|
|
411
408
|
const textAfterColon = message.text.split(":")[1]
|
|
412
409
|
// console.log('FIREBASEConversationHandlerSERVICE message text - textAfterColon', textAfterColon)
|
|
413
410
|
if (textAfterColon !== undefined) {
|
|
414
411
|
message.text = INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU + ': ' + textAfterColon;
|
|
415
412
|
}
|
|
416
|
-
} else if ((message
|
|
413
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.LEAD_UPDATED) {
|
|
417
414
|
message.text = INFO_SUPPORT_LEAD_UPDATED;
|
|
418
|
-
} else if ((message
|
|
415
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP) {
|
|
419
416
|
let subject: string;
|
|
420
417
|
if (message.attributes.messagelabel.parameters.fullname) {
|
|
421
418
|
subject = message.attributes.messagelabel.parameters.fullname;
|
|
@@ -423,7 +420,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
423
420
|
subject = message.attributes.messagelabel.parameters.member_id;
|
|
424
421
|
}
|
|
425
422
|
message.text = subject + ' ' + INFO_SUPPORT_MEMBER_LEFT_GROUP ;
|
|
426
|
-
} else if(message
|
|
423
|
+
} else if(infoMessageType(message) === INFO_MESSAGE_TYPE.LIVE_PAGE){
|
|
427
424
|
let sourceUrl: string = '';
|
|
428
425
|
if(message.attributes && message.attributes.sourcePage){
|
|
429
426
|
sourceUrl = message.attributes.sourcePage
|
|
@@ -22,9 +22,9 @@ import { AppConfigProvider } from 'src/app/services/app-config';
|
|
|
22
22
|
// utils
|
|
23
23
|
import { avatarPlaceholder, getColorBck } from '../../utils/utils-user';
|
|
24
24
|
import { compareValues, conversationsPathForUserId, searchIndexInArrayForUid, isGroup } from '../../utils/utils';
|
|
25
|
-
import {
|
|
25
|
+
import { INFO_MESSAGE_TYPE, MESSAGE_TYPE_INFO } from '../../utils/constants';
|
|
26
26
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
27
|
-
import { messageType } from 'src/chat21-core/utils/utils-message';
|
|
27
|
+
import { infoMessageType, messageType } from 'src/chat21-core/utils/utils-message';
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
// @Injectable({ providedIn: 'root' })
|
|
@@ -635,7 +635,7 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
|
|
|
635
635
|
|
|
636
636
|
translateInfoSupportMessages(conv) {
|
|
637
637
|
const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
|
|
638
|
-
if ((conv
|
|
638
|
+
if ((infoMessageType(conv) === INFO_MESSAGE_TYPE.TOUCHING_OPERATOR) && conv.sender === "system") {
|
|
639
639
|
const textAfterColon = conv.last_message_text.split(":")[1]
|
|
640
640
|
if (textAfterColon !== undefined) {
|
|
641
641
|
conv.last_message_text = INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU + ': ' + textAfterColon;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TOUCHING_OPERATOR, LEAD_UPDATED, MEMBER_LEFT_GROUP, LIVE_PAGE } from './../../utils/constants';
|
|
2
1
|
import { Inject, Injectable } from '@angular/core';
|
|
3
2
|
import { BehaviorSubject } from 'rxjs';
|
|
4
3
|
|
|
@@ -16,15 +15,10 @@ import { UserModel } from '../../models/user';
|
|
|
16
15
|
import { ConversationHandlerService } from '../abstract/conversation-handler.service';
|
|
17
16
|
|
|
18
17
|
// utils
|
|
19
|
-
import { MSG_STATUS_RECEIVED,
|
|
20
|
-
import {
|
|
21
|
-
htmlEntities,
|
|
22
|
-
compareValues,
|
|
23
|
-
searchIndexInArrayForUid,
|
|
24
|
-
conversationMessagesRef
|
|
25
|
-
} from '../../utils/utils';
|
|
18
|
+
import { MSG_STATUS_RECEIVED, TYPE_DIRECT, MESSAGE_TYPE_INFO, INFO_MESSAGE_TYPE } from '../../utils/constants';
|
|
19
|
+
import { compareValues, searchIndexInArrayForUid, } from '../../utils/utils';
|
|
26
20
|
import { v4 as uuidv4 } from 'uuid';
|
|
27
|
-
import { isSender, messageType } from '../../utils/utils-message';
|
|
21
|
+
import { infoMessageType, isSender, messageType } from '../../utils/utils-message';
|
|
28
22
|
|
|
29
23
|
|
|
30
24
|
@Injectable({ providedIn: 'root' })
|
|
@@ -361,10 +355,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
361
355
|
const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
|
|
362
356
|
const INFO_SUPPORT_LIVE_PAGE = this.translationMap.get('INFO_SUPPORT_LIVE_PAGE');
|
|
363
357
|
|
|
364
|
-
if (message.attributes.messagelabel
|
|
365
|
-
&& message.attributes.messagelabel.parameters
|
|
366
|
-
&& message.attributes.messagelabel.key === MEMBER_JOINED_GROUP
|
|
367
|
-
) {
|
|
358
|
+
if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_JOINED_GROUP && message.attributes.messagelabel.parameters ) {
|
|
368
359
|
let subject: string;
|
|
369
360
|
let verb: string;
|
|
370
361
|
let complement: string;
|
|
@@ -386,20 +377,20 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
386
377
|
}
|
|
387
378
|
}
|
|
388
379
|
message.text = subject + ' ' + verb + ' ' + complement;
|
|
389
|
-
} else if ((message
|
|
380
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.CHAT_REOPENED) {
|
|
390
381
|
message.text = INFO_SUPPORT_CHAT_REOPENED;
|
|
391
|
-
} else if ((message
|
|
382
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.CHAT_CLOSED) {
|
|
392
383
|
message.text = INFO_SUPPORT_CHAT_CLOSED;
|
|
393
|
-
} else if ((message
|
|
384
|
+
} else if ((infoMessageType(message) ===INFO_MESSAGE_TYPE.TOUCHING_OPERATOR) && message.sender === "system") {
|
|
394
385
|
// console.log('FIREBASEConversationHandlerSERVICE message text', message.text)
|
|
395
386
|
const textAfterColon = message.text.split(":")[1]
|
|
396
387
|
// console.log('FIREBASEConversationHandlerSERVICE message text - textAfterColon', textAfterColon)
|
|
397
388
|
if (textAfterColon !== undefined) {
|
|
398
389
|
message.text = INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU + ': ' + textAfterColon;
|
|
399
390
|
}
|
|
400
|
-
} else if ((message
|
|
391
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.LEAD_UPDATED) {
|
|
401
392
|
message.text = INFO_SUPPORT_LEAD_UPDATED;
|
|
402
|
-
} else if ((message
|
|
393
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP) {
|
|
403
394
|
let subject: string;
|
|
404
395
|
if (message.attributes.messagelabel.parameters.fullname) {
|
|
405
396
|
subject = message.attributes.messagelabel.parameters.fullname;
|
|
@@ -407,7 +398,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
407
398
|
subject = message.attributes.messagelabel.parameters.member_id;
|
|
408
399
|
}
|
|
409
400
|
message.text = subject + ' ' + INFO_SUPPORT_MEMBER_LEFT_GROUP ;
|
|
410
|
-
} else if(message
|
|
401
|
+
} else if(infoMessageType(message) === INFO_MESSAGE_TYPE.LIVE_PAGE){
|
|
411
402
|
let sourceUrl: string = '';
|
|
412
403
|
if(message.attributes && message.attributes.sourcePage){
|
|
413
404
|
sourceUrl = message.attributes.sourcePage
|
|
@@ -72,13 +72,15 @@ export const MESSAGE_TYPE_INFO = 'INFO';
|
|
|
72
72
|
export const MESSAGE_TYPE_MINE = 'MINE';
|
|
73
73
|
export const MESSAGE_TYPE_OTHERS = 'OTHERS';
|
|
74
74
|
|
|
75
|
-
export
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
export enum INFO_MESSAGE_TYPE {
|
|
76
|
+
CHAT_REOPENED = 'CHAT_REOPENED',
|
|
77
|
+
CHAT_CLOSED = 'CHAT_CLOSED',
|
|
78
|
+
MEMBER_JOINED_GROUP = 'MEMBER_JOINED_GROUP',
|
|
79
|
+
MEMBER_LEFT_GROUP = "MEMBER_LEFT_GROUP",
|
|
80
|
+
LEAD_UPDATED = "LEAD_UPDATED",
|
|
81
|
+
TOUCHING_OPERATOR = "TOUCHING_OPERATOR",
|
|
82
|
+
LIVE_PAGE = "LIVE_PAGE"
|
|
83
|
+
}
|
|
82
84
|
|
|
83
85
|
|
|
84
86
|
// URLS
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
MESSAGE_TYPE_OTHERS,
|
|
8
8
|
MAX_WIDTH_IMAGES,
|
|
9
9
|
CHANNEL_TYPE_GROUP,
|
|
10
|
-
TYPE_SUPPORT_GROUP
|
|
10
|
+
TYPE_SUPPORT_GROUP,
|
|
11
|
+
INFO_MESSAGE_TYPE
|
|
11
12
|
} from '../../chat21-core/utils/constants';
|
|
12
13
|
|
|
13
14
|
/** */
|
|
@@ -106,6 +107,27 @@ export function messageType(msgType: string, message: any) {
|
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
export function infoMessageType(msg: MessageModel): string{
|
|
111
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.MEMBER_JOINED_GROUP){
|
|
112
|
+
return INFO_MESSAGE_TYPE.MEMBER_JOINED_GROUP
|
|
113
|
+
}
|
|
114
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.CHAT_REOPENED){
|
|
115
|
+
return INFO_MESSAGE_TYPE.CHAT_REOPENED
|
|
116
|
+
}
|
|
117
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.TOUCHING_OPERATOR){
|
|
118
|
+
return INFO_MESSAGE_TYPE.TOUCHING_OPERATOR
|
|
119
|
+
}
|
|
120
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.LEAD_UPDATED){
|
|
121
|
+
return INFO_MESSAGE_TYPE.LEAD_UPDATED
|
|
122
|
+
}
|
|
123
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP){
|
|
124
|
+
return INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP
|
|
125
|
+
}
|
|
126
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.LIVE_PAGE){
|
|
127
|
+
return INFO_MESSAGE_TYPE.LIVE_PAGE
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
109
131
|
/** */
|
|
110
132
|
export function getSizeImg(message: any, maxWidthImage?: number): any {
|
|
111
133
|
try {
|