Skip to content

Commit

Permalink
fix(rn): infos when write message
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Apr 2, 2019
1 parent 8c04b89 commit 7a2fb1d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions core/entity/conversation.go
Expand Up @@ -539,13 +539,20 @@ func (m *ConversationMember) Write(message *Message) error {
for _, member := range m.Conversation.Members {
if member.Contact.ID == m.Contact.ID {
member.ReadAt = now

// say that conversation has not been read by others members
m.Conversation.ReadAt = time.Time{}

if m.Conversation.IsOneToOne() {
m.Conversation.Infos = message.Text
} else {
m.Conversation.Infos = m.Contact.DisplayName + ": " + message.Text
}

return nil
}
}

// say that conversation has not been read by others members
m.Conversation.ReadAt = time.Time{}

return errorcodes.ErrConversationMemberWrite.Wrap(
errorcodes.ErrConversationMembers.Wrap(
errorcodes.ErrConversationMemberContactID.New(),
Expand Down

0 comments on commit 7a2fb1d

Please sign in to comment.