Skip to content

[NEW] Mark message as unread#1039

Closed
weijia-yu wants to merge 11 commits intoRocketChat:developfrom
weijia-yu:feature/989_unread_action
Closed

[NEW] Mark message as unread#1039
weijia-yu wants to merge 11 commits intoRocketChat:developfrom
weijia-yu:feature/989_unread_action

Conversation

@weijia-yu
Copy link
Contributor

@RocketChat/ReactNative

Closes #989

unread

@weijia-yu
Copy link
Contributor Author

@diegolmello @IlarionHalushka can someone review please?

@weijia-yu
Copy link
Contributor Author

@djorkaeffalexandre Hi Possible to review it or assign a reviewer?

Copy link
Member

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few adjustments.
Thanks!

@weijia-yu
Copy link
Contributor Author

unread
@diegolmello I updated the branch, also here is the gif showing:

  1. original mark room id as unread is still working

  2. mark msg as unread in room

  3. unable to mark my own msg as unread

Copy link
Member

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your main language?
Don't add translation from Google Translate for languages you're not sure.
You can leave pt-BR and en, but you probably don't speak de, zh-cn, fr and ru.
It's always better to have no translation and fallback to en than having a wrong translation.

@weijia-yu
Copy link
Contributor Author

weijia-yu commented Jul 23, 2019

@diegolmello Gotcha, my main language is Chinese and English, so I will keep en and zh-cn, what do you think? In that case, if they are using a different language, sometimes it would mix the other language and english, that should be fine?

@weijia-yu
Copy link
Contributor Author

@diegolmello I removed other language and only kept english and chinese translation

@weijia-yu
Copy link
Contributor Author

@diegolmello is it good now? Can you review it please 🕺

@diegolmello
Copy link
Member

@weijia-yu Sure. Thanks!

toggleRead(read, roomId, firstUnreadMessageId) {
if (read) {
return this.sdk.post('subscriptions.unread', { roomId });
if (roomId !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just do if (roomId) {

if (roomId !== undefined) {
return this.sdk.post('subscriptions.unread', { roomId });
}
if (firstUnreadMessageId !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just do if (firstUnreadMessageId) {

@diegolmello diegolmello changed the title Add mark as unread function to message long press [NEW] Mark message as unread Aug 19, 2019
Copy link
Member

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also resolve Ilarion's inputs?
Thanks!

return this.sdk.post('rooms.favorite', { roomId, favorite });
},
toggleRead(read, roomId) {
toggleRead(read, roomId, firstUnreadMessageId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you switch this signature to toggleRead({ read = true, rid, messageId })?
This way is much more readable.

Before:

RocketChat.toggleRead(true, undefined, actionMessage._id);

After:

RocketChat.toggleRead({ messageId : actionMessage._id });

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And on https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/app/views/RoomsListView/index.js#L392:

Before:

const result = await RocketChat.toggleRead(isRead, rid);

After:

const result = await RocketChat.toggleRead({ rid, read: isRead });

@djorkaeffalexandre
Copy link
Contributor

Was done by #1785.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NEW] Mark message as unread

4 participants