Skip to content

Commit

Permalink
[NEW] Room swipe actions: mark as read/unread, hide, fav (#976)
Browse files Browse the repository at this point in the history
* added unread and fav feature

* changed the layout

* fix jest

* done requested changes

* added requested changes
  • Loading branch information
pranavpandey1998official authored and diegolmello committed Jul 1, 2019
1 parent 3375411 commit 47676c2
Show file tree
Hide file tree
Showing 6 changed files with 391 additions and 28 deletions.
1 change: 1 addition & 0 deletions __mocks__/react-native-gesture-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export const RectButton = () => 'View';
export const State = () => 'View';
export const LongPressGestureHandler = () => 'View';
export const BorderlessButton = () => 'View';
export const PanGestureHandler = () => 'View';
4 changes: 4 additions & 0 deletions app/i18n/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export default {
Everyone_can_access_this_channel: 'Everyone can access this channel',
erasing_room: 'erasing room',
Error_uploading: 'Error uploading',
Favorite: 'Favorite',
Favorites: 'Favorites',
Files: 'Files',
File_description: 'File description',
Expand All @@ -175,6 +176,7 @@ export default {
Forgot_Password: 'Forgot Password',
Group_by_favorites: 'Group favorites',
Group_by_type: 'Group by type',
Hide: 'Hide',
Has_joined_the_channel: 'Has joined the channel',
Has_joined_the_conversation: 'Has joined the conversation',
Has_left_the_channel: 'Has left the channel',
Expand Down Expand Up @@ -268,6 +270,7 @@ export default {
Reactions_are_disabled: 'Reactions are disabled',
Reactions_are_enabled: 'Reactions are enabled',
Reactions: 'Reactions',
Read: 'Read',
Read_Only_Channel: 'Read Only Channel',
Read_Only: 'Read Only',
Read_Receipt: 'Read Receipt',
Expand Down Expand Up @@ -352,6 +355,7 @@ export default {
unarchive: 'unarchive',
UNARCHIVE: 'UNARCHIVE',
Unblock_user: 'Unblock user',
Unfavorite: 'Unfavorite',
Unfollowed_thread: 'Unfollowed thread',
Unmute: 'Unmute',
unmuted: 'unmuted',
Expand Down
9 changes: 9 additions & 0 deletions app/lib/rocketchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,12 @@ const RocketChat = {
// RC 0.64.0
return this.sdk.post('rooms.favorite', { roomId, favorite });
},
toggleRead(read, roomId) {
if (read) {
return this.sdk.post('subscriptions.unread', { roomId });
}
return this.sdk.post('subscriptions.read', { rid: roomId });
},
getRoomMembers(rid, allUsers, skip = 0, limit = 10) {
// RC 0.42.0
return this.sdk.methodCall('getUsersOfRoom', rid, allUsers, { skip, limit });
Expand Down Expand Up @@ -640,6 +646,9 @@ const RocketChat = {
// RC 0.48.0
return this.sdk.post(`${ this.roomTypeToApiType(t) }.unarchive`, { roomId });
},
hideRoom(roomId, t) {
return this.sdk.post(`${ this.roomTypeToApiType(t) }.close`, { roomId });
},
saveRoomSettings(rid, params) {
// RC 0.55.0
return this.sdk.methodCall('saveRoomSettings', rid, params);
Expand Down
Loading

0 comments on commit 47676c2

Please sign in to comment.