mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-02 09:46:38 +00:00
fix: group chat colors and adding nbsp; only when the message is from the current user
This commit is contained in:
parent
246b90b5ae
commit
9b35a01103
@ -101,6 +101,11 @@ QtObject:
|
|||||||
if chat.id == chatId:
|
if chat.id == chatId:
|
||||||
return chat
|
return chat
|
||||||
|
|
||||||
|
proc getChannelByName*(self: ChannelsList, name: string): Chat =
|
||||||
|
for chat in self.chats:
|
||||||
|
if chat.name == name:
|
||||||
|
return chat
|
||||||
|
|
||||||
proc upsertChannel(self: ChannelsList, channel: Chat): int =
|
proc upsertChannel(self: ChannelsList, channel: Chat): int =
|
||||||
let idx = self.chats.findIndexById(channel.id)
|
let idx = self.chats.findIndexById(channel.id)
|
||||||
if idx == -1:
|
if idx == -1:
|
||||||
@ -114,7 +119,7 @@ QtObject:
|
|||||||
result = idx
|
result = idx
|
||||||
|
|
||||||
proc getChannelColor*(self: ChannelsList, name: string): string =
|
proc getChannelColor*(self: ChannelsList, name: string): string =
|
||||||
let channel = self.getChannelById(name)
|
let channel = self.getChannelByName(name)
|
||||||
if (channel == nil): return
|
if (channel == nil): return
|
||||||
return channel.color
|
return channel.color
|
||||||
|
|
||||||
|
@ -29,7 +29,9 @@ proc renderBlock(self: ChatMessageList, message: Message): string =
|
|||||||
for pMsg in message.parsedText:
|
for pMsg in message.parsedText:
|
||||||
case pMsg.textType:
|
case pMsg.textType:
|
||||||
of "paragraph":
|
of "paragraph":
|
||||||
result = result & "<p> "
|
result = result & "<p>"
|
||||||
|
if message.isCurrentUser:
|
||||||
|
result = result & " "
|
||||||
for children in pMsg.children:
|
for children in pMsg.children:
|
||||||
result = result & self.renderInline(children)
|
result = result & self.renderInline(children)
|
||||||
result = result & "</p>"
|
result = result & "</p>"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user