Adding messageId to messages
This commit is contained in:
parent
9ef575dc30
commit
d7f9120840
|
@ -15,6 +15,7 @@ type
|
|||
Clock = UserRole + 9
|
||||
ChatId = UserRole + 10
|
||||
SectionIdentifier = UserRole + 11
|
||||
Id = UserRole + 12
|
||||
|
||||
QtObject:
|
||||
type
|
||||
|
@ -68,7 +69,7 @@ QtObject:
|
|||
of ChatMessageRoles.FromAuthor: result = newQVariant(message.fromAuthor)
|
||||
of ChatMessageRoles.ChatId: result = newQVariant(message.chatId)
|
||||
of ChatMessageRoles.SectionIdentifier: result = newQVariant(sectionIdentifier(message))
|
||||
|
||||
of ChatMessageRoles.Id: result = newQVariant(message.id)
|
||||
|
||||
method roleNames(self: ChatMessageList): Table[int, string] =
|
||||
{
|
||||
|
@ -82,7 +83,9 @@ QtObject:
|
|||
ChatMessageRoles.Sticker.int:"sticker",
|
||||
ChatMessageRoles.FromAuthor.int:"fromAuthor",
|
||||
ChatMessageRoles.ChatId.int:"chatId",
|
||||
ChatMessageRoles.SectionIdentifier.int: "sectionIdentifier"
|
||||
ChatMessageRoles.SectionIdentifier.int: "sectionIdentifier",
|
||||
ChatMessageRoles.Id.int: "messageId"
|
||||
|
||||
}.toTable
|
||||
|
||||
proc add*(self: ChatMessageList, message: Message) =
|
||||
|
|
|
@ -67,7 +67,7 @@ ScrollView {
|
|||
DelegateModel {
|
||||
id: messageListDelegate
|
||||
property var lessThan: [
|
||||
function(left, right) { return left.clock < right.clock }
|
||||
function(left, right) { return left.clock < right.clock } // TODO: should be sorted by messageId
|
||||
]
|
||||
|
||||
property int sortOrder: 0
|
||||
|
|
Loading…
Reference in New Issue