@@ -164,8 +164,10 @@ const MessageContentWithContext = <
164
164
} ,
165
165
containerInner,
166
166
errorContainer,
167
+ receiverMessageBackgroundColor,
167
168
replyBorder,
168
169
replyContainer,
170
+ senderMessageBackgroundColor,
169
171
wrapper,
170
172
} ,
171
173
reactionList : { radius, reactionSize } ,
@@ -225,7 +227,9 @@ const MessageContentWithContext = <
225
227
) ;
226
228
}
227
229
228
- let backgroundColor = grey_gainsboro ;
230
+ const isMessageReceivedOrErrorType = ! isMyMessage || error ;
231
+
232
+ let backgroundColor = senderMessageBackgroundColor || grey_gainsboro ;
229
233
if ( onlyEmojis && ! message . quoted_message ) {
230
234
backgroundColor = transparent ;
231
235
} else if ( otherAttachments . length ) {
@@ -234,13 +238,11 @@ const MessageContentWithContext = <
234
238
} else {
235
239
backgroundColor = blue_alice ;
236
240
}
237
- } else if ( alignment === 'left' || error ) {
238
- backgroundColor = white ;
241
+ } else if ( isMessageReceivedOrErrorType ) {
242
+ backgroundColor = receiverMessageBackgroundColor || white ;
239
243
}
240
244
241
- const repliesCurveColor = isMyMessage && ! error ? backgroundColor : grey_whisper ;
242
-
243
- const isBorderColor = isMyMessage && ! error ;
245
+ const repliesCurveColor = ! isMessageReceivedOrErrorType ? backgroundColor : grey_gainsboro ;
244
246
245
247
const getBorderRadius = ( ) => {
246
248
// enum('top', 'middle', 'bottom', 'single')
@@ -252,10 +254,10 @@ const MessageContentWithContext = <
252
254
253
255
if ( isBottomOrSingle && ( ! hasThreadReplies || threadList ) ) {
254
256
// add relevant sharp corner
255
- if ( alignment === 'left' ) {
256
- borderBottomLeftRadius = borderRadiusS ;
257
- } else {
257
+ if ( isMyMessage ) {
258
258
borderBottomRightRadius = borderRadiusS ;
259
+ } else {
260
+ borderBottomLeftRadius = borderRadiusS ;
259
261
}
260
262
}
261
263
@@ -319,7 +321,7 @@ const MessageContentWithContext = <
319
321
* Otherwise background is transparent, so border radius is not really visible.
320
322
*/
321
323
style = { [
322
- alignment === 'left' ? styles . leftAlignItems : styles . rightAlignItems ,
324
+ isMyMessage ? styles . rightAlignItems : styles . leftAlignItems ,
323
325
{ paddingTop : hasReactions ? reactionSize / 2 + radius : 2 } ,
324
326
error ? errorContainer : { } ,
325
327
container ,
@@ -329,7 +331,7 @@ const MessageContentWithContext = <
329
331
< MessageHeader
330
332
alignment = { alignment }
331
333
formattedDate = { getDateText ( formatDate ) }
332
- isDeleted = { ! ! isMessageTypeDeleted }
334
+ isDeleted = { isMessageTypeDeleted }
333
335
lastGroupMessage = { lastGroupMessage }
334
336
members = { members }
335
337
message = { message }
@@ -358,7 +360,7 @@ const MessageContentWithContext = <
358
360
styles . containerInner ,
359
361
{
360
362
backgroundColor,
361
- borderColor : isBorderColor ? backgroundColor : grey_whisper ,
363
+ borderColor : isMessageReceivedOrErrorType ? grey_whisper : backgroundColor ,
362
364
...getBorderRadius ( ) ,
363
365
...getBorderRadiusFromTheme ( ) ,
364
366
} ,
0 commit comments