Skip to content

Commit 11f676c

Browse files
committed
Fix message ordering for webhook and quotes
1 parent 97045d1 commit 11f676c

File tree

3 files changed

+41
-11
lines changed

3 files changed

+41
-11
lines changed

app/containers/message/Message.tsx

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import translationLanguages from '../../lib/constants/translationLanguages';
3131
const MessageInner = React.memo((props: IMessageInner) => {
3232
const { isLargeFontScale } = useResponsiveLayout();
3333
const showTimeLarge = isLargeFontScale && props.isHeader;
34+
const hasLinkedQuote = props.attachments?.some(file => !!file?.message_link) ?? false;
3435

3536
let content;
3637
if (props.isPreview) {
@@ -39,8 +40,17 @@ const MessageInner = React.memo((props: IMessageInner) => {
3940
<User {...props} />
4041
{showTimeLarge ? <MessageTime {...props} /> : null}
4142
<>
42-
<Content {...props} />
43-
<Quote {...props} />
43+
{hasLinkedQuote ? (
44+
<>
45+
<Quote {...props} />
46+
<Content {...props} />
47+
</>
48+
) : (
49+
<>
50+
<Content {...props} />
51+
<Quote {...props} />
52+
</>
53+
)}
4454
<Attachments {...props} />
4555
</>
4656
<Urls {...props} />
@@ -87,8 +97,17 @@ const MessageInner = React.memo((props: IMessageInner) => {
8797
<User {...props} />
8898
{showTimeLarge ? <MessageTime {...props} /> : null}
8999
<View style={{ gap: 4 }}>
90-
<Content {...props} />
91-
<Quote {...props} />
100+
{hasLinkedQuote ? (
101+
<>
102+
<Quote {...props} />
103+
<Content {...props} />
104+
</>
105+
) : (
106+
<>
107+
<Content {...props} />
108+
<Quote {...props} />
109+
</>
110+
)}
92111
<Attachments {...props} />
93112
<Urls {...props} />
94113
<Thread {...props} />
@@ -158,6 +177,7 @@ const Message = React.memo((props: IMessageTouchable & IMessage) => {
158177
const thread = props.isThreadReply ? <RepliedThread {...props} /> : null;
159178
// Prevent misalignment of info when the font size is increased.
160179
const infoStyle: ViewStyle = props.isInfo ? { alignItems: 'center' } : {};
180+
const hasLinkedQuote = props.attachments?.some(file => !!file?.message_link) ?? false;
161181
return (
162182
<View style={[styles.container, { marginTop: 4 }]}>
163183
{thread}
@@ -169,7 +189,17 @@ const Message = React.memo((props: IMessageTouchable & IMessage) => {
169189
accessibilityLanguage={props.autoTranslateLanguage}
170190
index={2}>
171191
<View style={styles.messageContent}>
172-
<Content {...props} />
192+
{hasLinkedQuote ? (
193+
<>
194+
<Quote {...props} />
195+
<Content {...props} />
196+
</>
197+
) : (
198+
<>
199+
<Content {...props} />
200+
<Quote {...props} />
201+
</>
202+
)}
173203
{props.isInfo && props.type === 'message_pinned' ? (
174204
<View pointerEvents='none'>
175205
<Attachments {...props} />

ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,9 +3197,9 @@ SPEC CHECKSUMS:
31973197
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
31983198
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
31993199
WatermelonDB: 4c846c8cb94eef3cba90fa034d15310163226703
3200-
Yoga: dfabf1234ccd5ac41d1b1d43179f024366ae9831
3200+
Yoga: 2a3a4c38a8441b6359d5e5914d35db7b2b67aebd
32013201
ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5
32023202

32033203
PODFILE CHECKSUM: 4c73563b34520b90c036817cdb9ccf65fea5f5c5
32043204

3205-
COCOAPODS: 1.15.2
3205+
COCOAPODS: 1.16.2

ios/RocketChatRN.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@
17341734
inputFileListPaths = (
17351735
);
17361736
inputPaths = (
1737-
"$TARGET_BUILD_DIR/$INFOPLIST_PATH",
1737+
$TARGET_BUILD_DIR/$INFOPLIST_PATH,
17381738
);
17391739
name = "Upload source maps to Bugsnag";
17401740
outputFileListPaths = (
@@ -1820,7 +1820,7 @@
18201820
inputFileListPaths = (
18211821
);
18221822
inputPaths = (
1823-
"$TARGET_BUILD_DIR/$INFOPLIST_PATH",
1823+
$TARGET_BUILD_DIR/$INFOPLIST_PATH,
18241824
);
18251825
name = "Upload source maps to Bugsnag";
18261826
outputFileListPaths = (
@@ -2602,7 +2602,7 @@
26022602
"$(inherited)",
26032603
"$(SRCROOT)/../node_modules/rn-extensions-share/ios/**",
26042604
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/**",
2605-
"$PODS_CONFIGURATION_BUILD_DIR/Firebase",
2605+
$PODS_CONFIGURATION_BUILD_DIR/Firebase,
26062606
"$(SRCROOT)/../node_modules/react-native-mmkv-storage/ios/**",
26072607
);
26082608
INFOPLIST_FILE = ShareRocketChatRN/Info.plist;
@@ -2679,7 +2679,7 @@
26792679
"$(inherited)",
26802680
"$(SRCROOT)/../node_modules/rn-extensions-share/ios/**",
26812681
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/**",
2682-
"$PODS_CONFIGURATION_BUILD_DIR/Firebase",
2682+
$PODS_CONFIGURATION_BUILD_DIR/Firebase,
26832683
"$(SRCROOT)/../node_modules/react-native-mmkv-storage/ios/**",
26842684
);
26852685
INFOPLIST_FILE = ShareRocketChatRN/Info.plist;

0 commit comments

Comments
 (0)