Skip to content

Commit 2c26037

Browse files
Merge branch 'uat' of bitbucket.org:Apptha/p078-mirrorfly-reactnative-uikitsdk into bugfix/MRN-429_user_block
2 parents 48c5423 + 9bb8e84 commit 2c26037

File tree

11 files changed

+40
-25
lines changed

11 files changed

+40
-25
lines changed

android/fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ platform :android do
5454
firebase_app_distribution(
5555
app: "1:235373697524:android:8b3becf8d8ff9be3a0c1a1",
5656
groups: "reactnative",
57-
release_notes: "React-Native android build for MRN-906",
57+
release_notes: "React-Native ios build for MRN-908, MRN-901",
5858
apk_path: "../android/app/build/outputs/apk/release/app-release.apk",
5959
firebase_cli_token: "1//0gfTJ_oWJ0mHNCgYIARAAGBASNwF-L9IrYZM4cUIV5EB8gVnSvtMC6Q7aAtgrgG8R1ybhSY1Np_5r5UuZu28N144_weOQDyONcW4",
6060
)

ios/fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ lane :qa_firebase do
2828
firebase_app_distribution(
2929
app: "1:235373697524:ios:0e9bd66b524978a0a0c1a1",
3030
groups: "reactnative",
31-
release_notes: "React-Native ios build for MRN-906",
31+
release_notes: "React-Native ios build for MRN-908, MRN-901",
3232
firebase_cli_path: "/usr/local/bin/firebase",
3333
firebase_cli_token: "1//0g53oUKW5j5bJCgYIARAAGBASNwF-L9Ir7Ei_6NzWEsyHOMMXytlesfgXShhLeJWRwbcf2MC3e7BaC5dwYlUZB-_osuQFsxy0Du0"
3434
)

ios/mirrorfly_rn.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@
714714
"-lc++",
715715
);
716716
PRODUCT_BUNDLE_IDENTIFIER = com.mirrorfly.reactnativeuikit.qa;
717-
PRODUCT_NAME = mirrorfly_rn;
717+
PRODUCT_NAME = mirrorfly_rn;
718718
PROVISIONING_PROFILE_SPECIFIER = "";
719719
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "ReactNative Adhoc";
720720
SWIFT_OBJC_BRIDGING_HEADER = "mirrorfly_rn-Bridging-Header.h";

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mirrorfly-uikit-react-native",
3-
"version": "1.5.0",
3+
"version": "2.1.0",
44
"description": "React-Native based UI kit for Mirrorfly",
55
"main": "dist/index.js",
66
"module": "dist/index.js",

src/SDK/SDK.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import './index';
1+
import 'mirrorfly-reactnative-sdk';
22

33
const SDK = global.SDK;
44

src/SDK/sdkCallBacks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ export const callBacks = {
709709
store.dispatch(addChatMessageItem(res));
710710
}
711711

712-
if (isShowNotification) {
712+
if (isShowNotification && !res?.editMessageId) {
713713
pushNotify(res.msgId, getNotifyNickName(res), getNotifyMessage(res), res?.fromUserJid);
714714
}
715715
break;

src/SDK/utils.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import config from '../config/config';
44
import {
55
calculateWidthAndHeight,
66
getCurrentChatUser,
7-
getThumbImage,
87
getUserIdFromJid,
9-
getVideoThumbImage,
108
handleConversationScollToBottom,
119
handleUploadNextImage,
1210
isLocalUser,
@@ -110,7 +108,6 @@ export const fetchMessagesFromSDK = async ({ fromUserJId, forceGetFromSDK = fals
110108
hasNextChatPage[userId] = false;
111109
return;
112110
}
113-
const page = chatPage[userId] || 1;
114111

115112
const {
116113
statusCode,
@@ -124,11 +121,9 @@ export const fetchMessagesFromSDK = async ({ fromUserJId, forceGetFromSDK = fals
124121
});
125122
if (statusCode === 200) {
126123
let hasEqualDataFetched = data.length === config.chatMessagesSizePerPage;
127-
if (data.length && hasEqualDataFetched) {
128-
chatPage[userId] = page + 1;
129-
}
124+
130125
hasNextChatPage[userId] = hasEqualDataFetched;
131-
store.dispatch(setChatMessages({ userJid, data, forceUpdate: page === 1 }));
126+
store.dispatch(setChatMessages({ userJid, data }));
132127
}
133128
if (statusCode !== 200) {
134129
showToast(message);
@@ -528,8 +523,10 @@ export const getUserSettings = async (iq = false) => {
528523

529524
export const updateNotificationSettings = async () => {
530525
let {
526+
data,
531527
data: { archive = 0, muteNotification = false, notificationSound = true, notificationVibrate = false },
532528
} = await SDK.getUserSettings();
529+
console.log('data ==>', JSON.stringify(data, null, 2));
533530
store.dispatch(toggleArchiveSetting(Number(archive)));
534531
store.dispatch(updateNotificationSetting({ muteNotification, notificationSound, notificationVibrate }));
535532
};

src/components/ArchivedHeader.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Text from '../common/Text';
99
import { getUserIdFromJid, showToast, toggleArchive } from '../helpers/chatHelpers';
1010
import { MIX_BARE_JID } from '../helpers/constants';
1111
import { getStringSet, replacePlaceholders } from '../localization/stringSet';
12-
import { deleteRecentChats, resetChatSelections } from '../redux/recentChatDataSlice';
12+
import { clearRecentChatData, deleteRecentChats, resetChatSelections } from '../redux/recentChatDataSlice';
1313
import {
1414
getArchiveSelectedChats,
1515
getUserNameFromStore,
@@ -20,6 +20,7 @@ import { ARCHIVED_SCREEN } from '../screens/constants';
2020
import SDK from '../SDK/SDK';
2121
import commonStyles from '../styles/commonStyles';
2222
import MuteChat from './MuteChat';
23+
import { clearChatMessageData } from '../redux/chatMessageDataSlice';
2324

2425
function ArchivedHeader() {
2526
const stringSet = getStringSet();
@@ -60,13 +61,13 @@ function ArchivedHeader() {
6061
};
6162

6263
const handleRemoveClose = () => {
63-
const isUserLeft = filtered.every(res => (MIX_BARE_JID.test(res.userJid) ? res.userType === '' : true));
64-
if (!isUserLeft && filtered.length > 1) {
64+
const _isUserLeft = filtered.every(res => (MIX_BARE_JID.test(res.userJid) ? res.userType === '' : true));
65+
if (!_isUserLeft && filtered.length > 1) {
6566
toggleModalContent();
6667
return showToast(stringSet.COMMON_TEXT.YOU_ARE_A_MEMBER);
6768
}
6869

69-
if (!isUserLeft) {
70+
if (!_isUserLeft) {
7071
toggleModalContent();
7172
return showToast(stringSet.COMMON_TEXT.YOU_ARE_A_PARTICIPANT);
7273
}
@@ -75,6 +76,9 @@ function ArchivedHeader() {
7576

7677
userJids.forEach(item => {
7778
SDK.deleteChat(item);
79+
SDK.clearChat(item);
80+
dispatch(clearChatMessageData(getUserIdFromJid(item)));
81+
dispatch(clearRecentChatData(item));
7882
});
7983

8084
dispatch(deleteRecentChats(ARCHIVED_SCREEN));

src/components/TextCard.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,18 @@ export const ChatConversationHighlightedText = ({ textStyle = {}, text, searchVa
106106

107107
// If no match, render normally
108108
const urlStyle = segment.isUrl ? styles.underline : {};
109-
return (
109+
return segment.isUrl ? (
110110
<Text
111111
key={randomString()}
112112
style={[textStyle, urlStyle]}
113113
onPress={() => segment.isUrl && handlePress(segment.content)}
114114
suppressHighlighting={!segment.isUrl}>
115115
{content}
116116
</Text>
117+
) : (
118+
<Text key={randomString()} style={[textStyle]}>
119+
{content}
120+
</Text>
117121
);
118122
})}
119123
</Text>

src/screens/ForwardMessage.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
getRecentChatMsgObjForward,
2323
getUserIdFromJid,
2424
handleUpdateBlockUser,
25+
setCurrentChatUser,
2526
showCheckYourInternetToast,
2627
showToast,
2728
} from '../helpers/chatHelpers';
@@ -581,18 +582,22 @@ const ForwardMessage = () => {
581582
await SDK.forwardMessagesToMultipleUsers(contactsToForward, msgIds, true, newMsgIds);
582583
// navigating the user after setTimeout to finish all the running things in background to avoid unwanted issues
583584
setTimeout(() => {
585+
const jid = Object.values(selectedUsers)[0]?.userJid;
586+
const userId = getUserIdFromJid(jid);
584587
setShowLoader(false);
585588
onMessageForwaded?.();
586589
if (Object.values(selectedUsers).length === 1) {
590+
dispatch(clearChatMessageData(userId));
587591
navigation.reset({
588592
index: 0,
589593
routes: [
590594
{
591595
name: CONVERSATION_SCREEN,
592-
params: { jid: Object.values(selectedUsers)[0]?.userJid },
596+
params: { jid },
593597
},
594598
],
595599
});
600+
setCurrentChatUser(jid);
596601
} else {
597602
navigation.goBack();
598603
}

0 commit comments

Comments
 (0)