Skip to content

Commit 388a5c8

Browse files
authored
Merge branch 'develop' into chore.expo-notifications
2 parents e05e3bf + 59e873a commit 388a5c8

File tree

15 files changed

+97
-33
lines changed

15 files changed

+97
-33
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
33
ruby '2.7.7'
44

55
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
6-
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
6+
gem 'cocoapods', '>= 1.13', '!= 1.15.1', '!= 1.15.0'
77
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
88
gem 'xcodeproj', '< 1.26.0'
99
gem 'concurrent-ruby', '< 1.3.4'

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ DEPENDENCIES
308308
activesupport (>= 6.1.7.5, != 7.1.0)
309309
benchmark
310310
bigdecimal
311-
cocoapods (>= 1.13, != 1.15.0, != 1.15.1)
311+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
312312
concurrent-ruby (< 1.3.4)
313313
fastlane
314314
fastlane-plugin-bugsnag

app/containers/ImageViewer/ImageViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const styles = StyleSheet.create({
3030
});
3131

3232
export const ImageViewer = ({ uri = '', width, height, ...props }: ImageViewerProps): React.ReactElement => {
33-
const [autoplayGifs] = useUserPreferences<boolean>(AUTOPLAY_GIFS_PREFERENCES_KEY);
33+
const [autoplayGifs] = useUserPreferences<boolean>(AUTOPLAY_GIFS_PREFERENCES_KEY, true);
3434
const [isPlaying, setIsPlaying] = useState<boolean>(!!autoplayGifs);
3535
const expoImageRef = useRef<Image>(null);
3636

app/containers/markdown/components/mentions/AtMention.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface IAtMention {
2020

2121
const AtMention = React.memo(({ mention, mentions, username, navToRoomInfo, style = [], useRealName }: IAtMention) => {
2222
const { theme } = useTheme();
23-
const [mentionsWithAtSymbol] = useUserPreferences<boolean>(USER_MENTIONS_PREFERENCES_KEY);
23+
const [mentionsWithAtSymbol] = useUserPreferences<boolean>(USER_MENTIONS_PREFERENCES_KEY, false);
2424
const preffix = mentionsWithAtSymbol ? '@' : '';
2525
if (mention === 'all' || mention === 'here') {
2626
return (

app/containers/markdown/components/mentions/Hashtag.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface IHashtag {
2424

2525
const Hashtag = React.memo(({ hashtag, channels, navToRoomInfo, style = [] }: IHashtag) => {
2626
const { theme } = useTheme();
27-
const [roomsWithHashTagSymbol] = useUserPreferences<boolean>(ROOM_MENTIONS_PREFERENCES_KEY);
27+
const [roomsWithHashTagSymbol] = useUserPreferences<boolean>(ROOM_MENTIONS_PREFERENCES_KEY, false);
2828
const isMasterDetail = useAppSelector(state => state.app.isMasterDetail);
2929
const preffix = roomsWithHashTagSymbol ? '#' : '';
3030
const handlePress = async () => {

app/definitions/rest/v1/omnichannel.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ export type OmnichannelEndpoints = {
1919
appearance: ISetting[];
2020
};
2121
};
22+
'livechat/config/routing': {
23+
GET: () => {
24+
config: {
25+
previewRoom: boolean;
26+
showConnecting: boolean;
27+
showQueue: boolean;
28+
showQueueLink: boolean;
29+
returnQueue: boolean;
30+
enableTriggerAction: boolean;
31+
autoAssignAgent: boolean;
32+
};
33+
};
34+
};
2235
'livechat/visitors.info': {
2336
GET: (params: { visitorId: string }) => {
2437
visitor: ILivechatVisitor;
@@ -122,6 +135,14 @@ export type OmnichannelEndpoints = {
122135
}>;
123136
};
124137

138+
'livechat/inquiries.take': {
139+
POST: (params: { inquiryId: string }) => void;
140+
};
141+
142+
'livechat/inquiries.returnAsInquiry': {
143+
POST: (params: { roomId: string; departmentId?: string }) => boolean;
144+
};
145+
125146
'livechat/rooms': {
126147
GET: (params: {
127148
guest: string;

app/definitions/rest/v1/rooms.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ export type RoomsEndpoints = {
4444
'rooms.saveNotification': {
4545
POST: (params: { roomId: string; notifications: IRoomNotifications }) => {};
4646
};
47+
'rooms.muteUser': {
48+
POST: (params: { roomId: string; userId: string }) => {
49+
success: boolean;
50+
};
51+
};
52+
'rooms.unmuteUser': {
53+
POST: (params: { rid: string; userId: string }) => {
54+
success: boolean;
55+
};
56+
};
4757
};
4858

4959
export type TRoomsMediaResponse = {

app/ee/omnichannel/lib/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ export const getInquiriesQueued = (serverVersion: string) => {
2020
// this inquiry is added to the db by the subscriptions stream
2121
// and will be removed by the queue stream
2222
// RC 2.4.0
23-
export const takeInquiry = (inquiryId: string) => sdk.methodCallWrapper('livechat:takeInquiry', inquiryId);
23+
export const takeInquiry = (inquiryId: string, serverVersion: string) => {
24+
if (compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '7.11.0')) {
25+
return sdk.post('livechat/inquiries.take', { inquiryId });
26+
}
27+
// Method removed in 8.0.0
28+
return sdk.methodCallWrapper('livechat:takeInquiry', inquiryId);
29+
};
2430

2531
// RC 4.26
2632
export const takeResume = (roomId: string) => sdk.methodCallWrapper('livechat:resumeOnHold', roomId);

app/lib/services/restApi.ts

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,16 @@ export const editLivechat = (userData: TParams, roomData: TParams): Promise<{ er
430430
return sdk.post('livechat/room.saveInfo', { guestData: userData, roomData }) as any;
431431
};
432432

433-
export const returnLivechat = (rid: string): Promise<boolean> =>
433+
export const returnLivechat = (rid: string, departmentId?: string): Promise<any> => {
434+
const serverVersion = reduxStore.getState().server.version;
435+
436+
if (compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '7.12.0')) {
437+
return sdk.post('livechat/inquiries.returnAsInquiry', { roomId: rid, departmentId });
438+
}
439+
434440
// RC 0.72.0
435-
sdk.methodCallWrapper('livechat:returnAsInquiry', rid);
441+
return sdk.methodCallWrapper('livechat:returnAsInquiry', rid);
442+
};
436443

437444
export const onHoldLivechat = (roomId: string) => sdk.post('livechat/room.onHold', { roomId });
438445

@@ -461,17 +468,26 @@ export const usersAutoComplete = (selector: any) =>
461468
// RC 2.4.0
462469
sdk.get('users.autocomplete', { selector });
463470

464-
export const getRoutingConfig = (): Promise<{
471+
export const getRoutingConfig = async (): Promise<{
465472
previewRoom: boolean;
466473
showConnecting: boolean;
467474
showQueue: boolean;
468475
showQueueLink: boolean;
469476
returnQueue: boolean;
470477
enableTriggerAction: boolean;
471478
autoAssignAgent: boolean;
472-
}> =>
479+
}> => {
480+
const serverVersion = reduxStore.getState().server.version;
481+
if (compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '7.11.0')) {
482+
const result = await sdk.get('livechat/config/routing');
483+
if (result.success) {
484+
return result.config;
485+
}
486+
}
487+
473488
// RC 2.0.0
474-
sdk.methodCallWrapper('livechat:getRoutingConfig');
489+
return sdk.methodCallWrapper('livechat:getRoutingConfig');
490+
};
475491

476492
export const getTagsList = (): Promise<ILivechatTag[]> =>
477493
// RC 2.0.0
@@ -515,17 +531,13 @@ export const deleteRoom = (roomId: string, t: RoomTypes) =>
515531
// RC 0.49.0
516532
sdk.post(`${roomTypeToApiType(t)}.delete`, { roomId });
517533

518-
export const toggleMuteUserInRoom = (
519-
rid: string,
520-
username: string,
521-
mute: boolean
522-
): Promise<{ message: { msg: string; result: boolean }; success: boolean }> => {
523-
if (mute) {
524-
// RC 0.51.0
525-
return sdk.methodCallWrapper('muteUserInRoom', { rid, username });
534+
export const toggleMuteUserInRoom = (rid: string, username: string, userId: string, mute: boolean) => {
535+
const serverVersion = reduxStore.getState().server.version;
536+
if (compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '6.8.0')) {
537+
return sdk.post(mute ? 'rooms.muteUser' : 'rooms.unmuteUser', { roomId: rid, userId });
526538
}
527539
// RC 0.51.0
528-
return sdk.methodCallWrapper('unmuteUserInRoom', { rid, username });
540+
return sdk.methodCallWrapper(mute ? 'muteUserInRoom' : 'unmuteUserInRoom', { rid, username });
529541
};
530542

531543
export const toggleRoomOwner = ({

app/views/AccessibilityAndAppearanceView/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export type TAlertDisplayType = 'TOAST' | 'DIALOG';
2323
const AccessibilityAndAppearanceView = () => {
2424
const navigation = useNavigation<NativeStackNavigationProp<AccessibilityStackParamList>>();
2525
const isMasterDetail = useAppSelector(state => state.app.isMasterDetail as boolean);
26-
const [mentionsWithAtSymbol, setMentionsWithAtSymbol] = useUserPreferences<boolean>(USER_MENTIONS_PREFERENCES_KEY);
27-
const [roomsWithHashTagSymbol, setRoomsWithHashTagSymbol] = useUserPreferences<boolean>(ROOM_MENTIONS_PREFERENCES_KEY);
26+
const [mentionsWithAtSymbol, setMentionsWithAtSymbol] = useUserPreferences<boolean>(USER_MENTIONS_PREFERENCES_KEY, false);
27+
const [roomsWithHashTagSymbol, setRoomsWithHashTagSymbol] = useUserPreferences<boolean>(ROOM_MENTIONS_PREFERENCES_KEY, false);
2828
const [autoplayGifs, setAutoplayGifs] = useUserPreferences<boolean>(AUTOPLAY_GIFS_PREFERENCES_KEY, true);
2929
const [alertDisplayType, setAlertDisplayType] = useUserPreferences<TAlertDisplayType>(
3030
ALERT_DISPLAY_TYPE_PREFERENCES_KEY,

0 commit comments

Comments
 (0)