Skip to content

Conversation

@ozkanbolukbas
Copy link
Contributor

Time added for conversation and sorting option added to conversation adapter.

Added timestamp for new sending message with Timestamp.now()
Added Timestamp value
Added sorting option with using conversation time.
Copy link
Contributor

@safaorhan safaorhan left a comment

Choose a reason for hiding this comment

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

Everything seems fine to me except one thing.

Can you change that so I can review it again?

public void onSuccess(DocumentReference documentReference) {
conversationRef
.update("lastMessage", documentReference)
.update("lastMessage", documentReference, "conversationTime", Timestamp.now())
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you don't need to send conversationTime since it's annotated as @ServerTimestamp.

It should get updated everytime you do an update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried it but it didn't update. It creates time stamp when conversation created. Because of that, I added this line. I added it to order last updated conversation. If you prefer I can add a new timestamp and we have created time and last updated time.

@safaorhan
Copy link
Contributor

And also please name your pull requests properly :)

Patch1 is not close to a good PR title 😄

@ozkanbolukbas ozkanbolukbas changed the title Patch 1 feature/conversationTimesatamp Jul 13, 2018
@ozkanbolukbas ozkanbolukbas changed the title feature/conversationTimesatamp feature/conversationTime Jul 13, 2018
@ozkanbolukbas
Copy link
Contributor Author

I changed it.

Copy link
Contributor Author

@ozkanbolukbas ozkanbolukbas left a comment

Choose a reason for hiding this comment

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

I changed the name :)

public void onSuccess(DocumentReference documentReference) {
conversationRef
.update("lastMessage", documentReference)
.update("lastMessage", documentReference, "conversationTime", Timestamp.now())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried it but it didn't update. It creates time stamp when conversation created. Because of that, I added this line. I added it to order last updated conversation. If you prefer I can add a new timestamp and we have created time and last updated time.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants