refactor(app-search): `You` used in case a message in the search result was sent by logged in user

This commit is contained in:
Sale Djenic 2021-11-29 12:59:04 +01:00
parent 64c0148bbf
commit f44926b7aa
1 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import location_menu_sub_model, location_menu_sub_item
import result_model, result_item
import ../../shared_models/message_item
import ../../../global/global_singleton
import ../../../global/app_sections_config as conf
import ../../../../app_service/service/contacts/service as contact_service
import ../../../../app_service/service/chat/service as chat_service
@ -203,7 +204,10 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
continue
let chatDto = self.controller.getChatDetails("", m.chatId)
let (senderName, senderImage) = self.controller.getContactNameAndImage(m.`from`)
var (senderName, senderImage) = self.controller.getContactNameAndImage(m.`from`)
if(m.`from` == singletonInstance.userProfile.getPubKey()):
senderName = "You"
if(chatDto.communityId.len == 0):
var chatName = chatDto.name
var chatImage = chatDto.identicon