@chat21/chat21-ionic 3.0.61-rc14 → 3.0.61-rc15
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 +4 -0
- package/package.json +1 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +31 -38
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +24 -7
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +1 -0
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +14 -12
- package/src/app/components/sidebar/sidebar.component.html +20 -20
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
- package/src/chat21-core/utils/utils-message.ts +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.61-rc15
|
|
4
|
+
- Increase the size of the emoji and remove the background color when it is sent or received without text
|
|
5
|
+
- Adds the ability to open sidebar menu items in a new tab by combining left mouse button + CMD keyboard key
|
|
6
|
+
|
|
3
7
|
### 3.0.61-rc14
|
|
4
8
|
- Fixes the bug: the page to which the sidebar Settings menu item redirects is not correct for team members with agent role
|
|
5
9
|
- Fixes the bug: right clicking on the sidebar menu items doesn't show the context menu
|
package/package.json
CHANGED
|
@@ -58,20 +58,19 @@
|
|
|
58
58
|
|
|
59
59
|
<ng-container *ngIf="first || (messages[i - 1].timestamp | date:'d') !== (message.timestamp | date:'d')">
|
|
60
60
|
<div class="long-date-divider-wpr">
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
<div class="long-date-divider-border-b"></div>
|
|
62
|
+
<div class="long-date-divider">
|
|
63
|
+
<!-- {{message.timestamp | date: 'longDate' : 'it'}} -->
|
|
64
|
+
{{message.timestamp | amDateFormat:'LL'}}
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
<div class="long-date-divider-border-b"></div>
|
|
68
68
|
</div>
|
|
69
|
-
|
|
69
|
+
</ng-container>
|
|
70
70
|
|
|
71
71
|
<div class="align-center" class="ion-text-center" *ngIf="messageType(MESSAGE_TYPE_INFO, message)"
|
|
72
72
|
class="msg_info_container">
|
|
73
|
-
<chat-info-message class="messages"
|
|
74
|
-
[message]="message">
|
|
73
|
+
<chat-info-message class="messages" [message]="message">
|
|
75
74
|
</chat-info-message>
|
|
76
75
|
</div>
|
|
77
76
|
|
|
@@ -79,16 +78,15 @@
|
|
|
79
78
|
<div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_MINE, message)" class="msg_container base_sent">
|
|
80
79
|
|
|
81
80
|
<!--backgroundColor non viene ancora usato -->
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
[ngClass]="{'
|
|
85
|
-
[
|
|
86
|
-
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
87
|
-
(onAfterMessageRender)="returnOnAfterMessageRender($event)"
|
|
88
|
-
|
|
89
|
-
[
|
|
90
|
-
[
|
|
91
|
-
[support_mode]="support_mode">
|
|
81
|
+
|
|
82
|
+
<chat-bubble-message style="position: relative;"
|
|
83
|
+
[ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}" class="messages msg_sent"
|
|
84
|
+
id="message_msg_sent" [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}"
|
|
85
|
+
[message]="message" [textColor]="'col-msg-sent'" (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
86
|
+
(onAfterMessageRender)="returnOnAfterMessageRender($event)" (onImageRendered)="onImageRenderedFN($event)"
|
|
87
|
+
[addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText" [areVisibleCAR]="areVisibleCAR"
|
|
88
|
+
[support_mode]="support_mode"
|
|
89
|
+
[class.emoticon]="message?.emoticon">
|
|
92
90
|
</chat-bubble-message>
|
|
93
91
|
|
|
94
92
|
<!-- icon status message -->
|
|
@@ -113,35 +111,30 @@
|
|
|
113
111
|
</chat-avatar-image> -->
|
|
114
112
|
|
|
115
113
|
<!--backgroundColor non viene ancora usato -->
|
|
116
|
-
|
|
117
|
-
<chat-bubble-message style="position: relative;"
|
|
118
|
-
[
|
|
119
|
-
[textColor]="'black'"
|
|
114
|
+
|
|
115
|
+
<chat-bubble-message style="position: relative;"
|
|
116
|
+
[ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}" class="messages msg_receive"
|
|
117
|
+
id="message_msg_receive" [message]="message" [textColor]="'black'"
|
|
120
118
|
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
121
|
-
(onAfterMessageRender)="returnOnAfterMessageRender($event)"
|
|
122
|
-
|
|
123
|
-
[
|
|
124
|
-
[
|
|
125
|
-
[support_mode]="support_mode" >
|
|
119
|
+
(onAfterMessageRender)="returnOnAfterMessageRender($event)" (onImageRendered)="onImageRenderedFN($event)"
|
|
120
|
+
[addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText" [areVisibleCAR]="areVisibleCAR"
|
|
121
|
+
[support_mode]="support_mode"
|
|
122
|
+
[class.emoticon]="message?.emoticon">
|
|
126
123
|
</chat-bubble-message>
|
|
127
124
|
</div>
|
|
128
125
|
|
|
129
126
|
<!-- message type:: button && -->
|
|
130
|
-
<div *ngIf="message?.attributes && message?.attributes?.attachment " class="slide-in-left"
|
|
131
|
-
<chat-message-attachment
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
[isLastMessage] = "isLastMessage(message?.uid)"
|
|
135
|
-
[stylesMap]="stylesMap"
|
|
136
|
-
(onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)">
|
|
127
|
+
<div *ngIf="message?.attributes && message?.attributes?.attachment " class="slide-in-left">
|
|
128
|
+
<chat-message-attachment style="height: 100%; display: block;" [message]="message"
|
|
129
|
+
[isLastMessage]="isLastMessage(message?.uid)" [stylesMap]="stylesMap"
|
|
130
|
+
(onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)">
|
|
137
131
|
</chat-message-attachment>
|
|
138
132
|
</div>
|
|
139
133
|
</div>
|
|
140
134
|
<!-- (fileType === 'file' && uploadProgress !== 100) -->
|
|
141
135
|
|
|
142
136
|
<!-- uploadProgress -> {{ uploadProgress }} -->
|
|
143
|
-
<div *ngIf="uploadProgress !== 100" class="msg_container base_sent"
|
|
144
|
-
style="margin-right: 20px;">
|
|
137
|
+
<div *ngIf="uploadProgress !== 100" class="msg_container base_sent" style="margin-right: 20px;">
|
|
145
138
|
<div class="messages msg_sent">
|
|
146
139
|
<div class="spinner">
|
|
147
140
|
<div class="bounce1"></div>
|
|
@@ -91,10 +91,12 @@ ion-item {
|
|
|
91
91
|
border-top-right-radius: 8px;
|
|
92
92
|
border-bottom-right-radius: 0px;
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
.emoticon {
|
|
95
|
+
background: unset !important;
|
|
96
|
+
font-size: 4em;
|
|
97
|
+
padding-bottom: 21px;
|
|
98
|
+
padding-top: 30px;
|
|
99
|
+
}
|
|
98
100
|
.has-metadata {
|
|
99
101
|
max-width: 100% !important;
|
|
100
102
|
}
|
|
@@ -144,9 +146,10 @@ ion-item {
|
|
|
144
146
|
border-bottom-left-radius: 0px;
|
|
145
147
|
}
|
|
146
148
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
.emoticon {
|
|
150
|
+
background: unset !important;
|
|
151
|
+
font-size: 4em;
|
|
152
|
+
}
|
|
150
153
|
|
|
151
154
|
.has-metadata {
|
|
152
155
|
max-width: 100% !important;
|
|
@@ -290,3 +293,17 @@ ion-item {
|
|
|
290
293
|
font-size: 10px;
|
|
291
294
|
left: 0px;
|
|
292
295
|
}
|
|
296
|
+
// ---------------------------------------------------------
|
|
297
|
+
// emoticon
|
|
298
|
+
// ---------------------------------------------------------
|
|
299
|
+
|
|
300
|
+
:host .base_sent .msg_sent ::ng-deep div > div > div > .chat-text-emoticon > p > p {
|
|
301
|
+
margin-bottom: 6px !important;
|
|
302
|
+
margin-right: -7px !important;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
:host .base_receive .msg_receive ::ng-deep div > div > div > .chat-text-emoticon > p > p {
|
|
306
|
+
margin-bottom: 41px !important;
|
|
307
|
+
margin-left: -8px !important;
|
|
308
|
+
margin-top: 49px !important;
|
|
309
|
+
}
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html
CHANGED
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
</ng-template> -->
|
|
44
44
|
|
|
45
45
|
<chat-text [text]="message?.text" [color]="textColor" [message]="message"
|
|
46
|
+
[class.chat-text-emoticon]="message?.emoticon"
|
|
46
47
|
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
47
48
|
(onAfterMessageRender)="returnOnAfterMessageRender($event)">
|
|
48
49
|
</chat-text>
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
font-variant: normal;
|
|
22
22
|
font-weight: 300;
|
|
23
23
|
overflow: hidden;
|
|
24
|
-
|
|
25
24
|
}
|
|
26
25
|
img {
|
|
27
26
|
border-radius: 8px;
|
|
@@ -32,30 +31,33 @@
|
|
|
32
31
|
height: auto;
|
|
33
32
|
object-fit: cover;
|
|
34
33
|
}
|
|
34
|
+
|
|
35
35
|
.message_innerhtml {
|
|
36
36
|
margin: 0px;
|
|
37
37
|
// padding: 0px 14px;
|
|
38
|
-
&.marked{
|
|
39
|
-
padding:8px;
|
|
40
|
-
margin-block-start: -1em!important;
|
|
41
|
-
margin-block-end: -1em!important;
|
|
38
|
+
&.marked {
|
|
39
|
+
padding: 8px;
|
|
40
|
+
margin-block-start: -1em !important;
|
|
41
|
+
margin-block-end: -1em !important;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
.text-message {
|
|
45
45
|
padding-top: 14px;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
49
48
|
}
|
|
50
49
|
// > .button-native
|
|
51
|
-
.btn-add-msg-as-canned-response
|
|
50
|
+
.btn-add-msg-as-canned-response {
|
|
52
51
|
// padding-left: 5px ;
|
|
53
52
|
// padding-right: 5px ;
|
|
54
53
|
border-radius: 50%;
|
|
55
|
-
--padding-end: 7px
|
|
56
|
-
--padding-start: 7px
|
|
57
|
-
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 6%)
|
|
58
|
-
|
|
54
|
+
--padding-end: 7px;
|
|
55
|
+
--padding-start: 7px;
|
|
56
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 6%);
|
|
59
57
|
}
|
|
60
58
|
|
|
59
|
+
// .emoticon {
|
|
60
|
+
// padding: 35px 0px !important;
|
|
61
|
+
// }
|
|
62
|
+
|
|
61
63
|
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
</li>
|
|
72
72
|
|
|
73
73
|
<!-- ------------------------------------------- -->
|
|
74
|
-
<!-- HOME
|
|
74
|
+
<!-- HOME (click)="goToHome()"" -->
|
|
75
75
|
<!-- ------------------------------------------- -->
|
|
76
|
-
|
|
77
|
-
<li
|
|
76
|
+
|
|
77
|
+
<li matTooltip="Home" #tooltip="matTooltip" matTooltipPosition='right'
|
|
78
78
|
matTooltipHideDelay="100" matTooltipClass="custom-mat-tooltip">
|
|
79
79
|
<a target="_self" href="{{ dashboard_home_url }}" class="customAncor">
|
|
80
80
|
<i class="material-icons sidebar-icons">
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
<!-- ---------------------------------- -->
|
|
88
|
-
<!-- Bot
|
|
88
|
+
<!-- Bot (click)="goToBots()" -->
|
|
89
89
|
<!-- ---------------------------------- -->
|
|
90
90
|
<ng-container *ngIf="USER_ROLE !== 'agent'">
|
|
91
|
-
<li
|
|
91
|
+
<li id="bot-anchor-wpr" matTooltipClass="custom-mat-tooltip" matTooltip="Bots"
|
|
92
92
|
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
93
93
|
<a target="_self" href="{{ dashboard_bots_url }}" id="bot-anchor" #botbtn class="customAncor" style="height: 40px;margin-right: 0px !important;">
|
|
94
94
|
<span class="bot-icon-wpr">
|
|
@@ -115,10 +115,10 @@
|
|
|
115
115
|
</ng-container>
|
|
116
116
|
|
|
117
117
|
<!-- ------------------------------------------- -->
|
|
118
|
-
<!-- Conversations (
|
|
118
|
+
<!-- Conversations (MONITOR) (click)="goToConversations()" -->
|
|
119
119
|
<!-- ------------------------------------------- -->
|
|
120
120
|
<ng-container *ngIf="USER_ROLE !== 'agent'">
|
|
121
|
-
<li
|
|
121
|
+
<li matTooltipClass="custom-mat-tooltip" matTooltip="Monitor"
|
|
122
122
|
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
123
123
|
<a target="_self" href="{{ dashboard_convs_url }}" class="customAncor" style="height: 40px;margin-right: 0px !important;">
|
|
124
124
|
<!-- <i class="material-icons sidebar-icons">forum</i> -->
|
|
@@ -137,9 +137,9 @@
|
|
|
137
137
|
</ng-container>
|
|
138
138
|
|
|
139
139
|
<!-- ------------------------------------------- -->
|
|
140
|
-
<!-- CONTACTS (LEADS) -->
|
|
140
|
+
<!-- CONTACTS (LEADS) (click)="goToContacts()" -->
|
|
141
141
|
<!-- ------------------------------------------- -->
|
|
142
|
-
<li
|
|
142
|
+
<li matTooltipClass="custom-mat-tooltip" matTooltip="{{ contacts_lbl }}"
|
|
143
143
|
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
144
144
|
<a target="_self" href="{{ dashboard_contacts_url }}" class="customAncor">
|
|
145
145
|
<i class="material-icons sidebar-icons">contacts</i>
|
|
@@ -147,10 +147,10 @@
|
|
|
147
147
|
</li>
|
|
148
148
|
|
|
149
149
|
<!-- ------------------------------------------- -->
|
|
150
|
-
<!-- APPS -->
|
|
150
|
+
<!-- APPS (click)="goToAppStore()" -->
|
|
151
151
|
<!-- ------------------------------------------- -->
|
|
152
152
|
<ng-container *ngIf="isVisibleAPP && USER_ROLE !== 'agent'">
|
|
153
|
-
<li
|
|
153
|
+
<li matTooltipClass="custom-mat-tooltip" matTooltip="{{ apps_lbl }}"
|
|
154
154
|
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
155
155
|
<a target="_self" href="{{ dashboard_app_url }}" class="customAncor" style="margin-right: 0px !important;">
|
|
156
156
|
<!-- <i class="material-icons sidebar-icons">apps</i> -->
|
|
@@ -167,11 +167,11 @@
|
|
|
167
167
|
</ng-container>
|
|
168
168
|
|
|
169
169
|
<!-- ------------------------------------------- -->
|
|
170
|
-
<!-- ANALYTICS -->
|
|
170
|
+
<!-- ANALYTICS (click)="goToAnalytics()" -->
|
|
171
171
|
<!-- ------------------------------------------- -->
|
|
172
172
|
<ng-container *ngIf="isVisibleANA && USER_ROLE !== 'agent'">
|
|
173
|
-
<li
|
|
174
|
-
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
173
|
+
<li matTooltipClass="custom-mat-tooltip" matTooltip="{{ analytics_lbl }}"
|
|
174
|
+
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;" >
|
|
175
175
|
<a target="_self" href="{{ dashboard_analytics_url }}" class="customAncor" style="margin-right: 0px !important;">
|
|
176
176
|
<!-- <i class="material-icons sidebar-icons">trending_up</i> -->
|
|
177
177
|
<!-- <i class="material-icons sidebar-icons"> analytics </i> -->
|
|
@@ -188,10 +188,10 @@
|
|
|
188
188
|
</ng-container>
|
|
189
189
|
|
|
190
190
|
<!-- ------------------------------------------- -->
|
|
191
|
-
<!-- ACTIVITIES -->
|
|
191
|
+
<!-- ACTIVITIES (click)="goToActivities()" -->
|
|
192
192
|
<!-- ------------------------------------------- -->
|
|
193
193
|
<ng-container *ngIf="isVisibleACT">
|
|
194
|
-
<li *ngIf="USER_ROLE !== 'agent'"
|
|
194
|
+
<li *ngIf="USER_ROLE !== 'agent'" matTooltipClass="custom-mat-tooltip"
|
|
195
195
|
matTooltip="{{ activities_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
196
196
|
<a target="_self" href="{{ dashboard_activities_url }}" class="customAncor">
|
|
197
197
|
<i class="material-icons sidebar-icons">assignment</i>
|
|
@@ -201,9 +201,9 @@
|
|
|
201
201
|
|
|
202
202
|
|
|
203
203
|
<!-- ------------------------------------------- -->
|
|
204
|
-
<!-- REQUESTS HISTORY -->
|
|
204
|
+
<!-- REQUESTS HISTORY (click)="goToHistory()" -->
|
|
205
205
|
<!-- ------------------------------------------- -->
|
|
206
|
-
<li
|
|
206
|
+
<li matTooltipClass="custom-mat-tooltip" matTooltip="{{ history_lbl }}"
|
|
207
207
|
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
208
208
|
<a target="_self" href="{{ dashboard_history_url }}" class="customAncor">
|
|
209
209
|
<i class="material-icons sidebar-icons">history</i>
|
|
@@ -211,9 +211,9 @@
|
|
|
211
211
|
</li>
|
|
212
212
|
|
|
213
213
|
<!-- ----------------------------------------------------------------------------------- -->
|
|
214
|
-
<!-- SETTINGS // old: goToSettings_CannedResponses() *ngIf="USER_ROLE !== 'agent'" -->
|
|
214
|
+
<!-- SETTINGS // old: goToSettings_CannedResponses() *ngIf="USER_ROLE !== 'agent'" (click)="goToWidgetSetUpOrToCannedResponses()" -->
|
|
215
215
|
<!-- ----------------------------------------------------------------------------------- -->
|
|
216
|
-
<li
|
|
216
|
+
<li matTooltipClass="custom-mat-tooltip"
|
|
217
217
|
matTooltip="{{ settings_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
218
218
|
<a target="_self" href="{{ dashboard_settings_url }}" class="customAncor">
|
|
219
219
|
<i class="material-icons sidebar-icons">settings</i>
|
|
@@ -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, CHAT_REOPENED, CHAT_CLOSED, MEMBER_JOINED_GROUP, TYPE_DIRECT, MESSAGE_TYPE_INFO
|
|
21
|
+
import { MSG_STATUS_RECEIVED, CHAT_REOPENED, CHAT_CLOSED, MEMBER_JOINED_GROUP, TYPE_DIRECT, MESSAGE_TYPE_INFO, TOUCHING_OPERATOR } from '../../utils/constants';
|
|
22
22
|
import { compareValues, searchIndexInArrayForUid, conversationMessagesRef } from '../../utils/utils';
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
import { messageType } from 'src/chat21-core/utils/utils-message';
|
|
25
|
+
import { messageType, isEmojii } from 'src/chat21-core/utils/utils-message';
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -156,7 +156,8 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
156
156
|
typeMsg,
|
|
157
157
|
attributes,
|
|
158
158
|
channelType,
|
|
159
|
-
false
|
|
159
|
+
false,
|
|
160
|
+
isEmojii(msg)
|
|
160
161
|
);
|
|
161
162
|
const messageRef = firebaseMessagesCustomUid.push({
|
|
162
163
|
language: lang,
|
|
@@ -288,6 +289,10 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
288
289
|
|
|
289
290
|
// verifico che il sender è il logged user
|
|
290
291
|
msg.isSender = this.isSender(msg.sender, this.loggedUser.uid);
|
|
292
|
+
|
|
293
|
+
//check if message contains only an emojii
|
|
294
|
+
msg.emoticon = isEmojii(msg.text)
|
|
295
|
+
|
|
291
296
|
// traduco messaggi se sono del server
|
|
292
297
|
if (msg.attributes && msg.attributes.subtype) {
|
|
293
298
|
if (msg.attributes.subtype === 'info' || msg.attributes.subtype === 'info/support') {
|
|
@@ -85,6 +85,25 @@ export function messageType(msgType: string, message: any) {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
export function isEmojii(message: any){
|
|
89
|
+
if (message.length > 2) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
let fistChar = '';
|
|
93
|
+
try {
|
|
94
|
+
fistChar = message.trim(); // .charAt(0);
|
|
95
|
+
} catch (e) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const ranges = ['(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])'];
|
|
100
|
+
if (fistChar.match(ranges.join('|'))) {
|
|
101
|
+
return true;
|
|
102
|
+
} else {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
88
107
|
/** */
|
|
89
108
|
export function getSizeImg(message: any, maxWidthImage?: number): any {
|
|
90
109
|
try {
|