Sale Djenic e5a414a927 refactor(@desktop/chat-communities): qml part handles messages from refactored backend
- `chatType` added to `Constants` to group chat type related values
- `messageContentType` added to `Constants` to group message content type related
values
- `MessageStore` maintained per message list now
- added new `ChatContentView` component used to display chat/channel content
- components updated to display messages from the new backend
- `StatusChatToolBar` appropriately updated
- mute/unmute feature added to chat/channel list as well as to `StatusChatToolBar`
2022-02-01 11:41:22 +01:00

36 lines
834 B
QML

import QtQuick 2.13
QtObject {
id: root
property var messageModule
function getMessageByIdAsJson (id) {
if(!messageModule)
return false
let jsonObj = messageModule.getMessageByIdAsJson(id)
let obj = JSON.parse(jsonObj)
if (obj.error) {
console.debug("error parsing message for index: ", id, " error: ", obj.error)
return false
}
return obj
}
function getMessageByIndexAsJson (index) {
if(!messageModule)
return false
let jsonObj = messageModule.getMessageByIndexAsJson(index)
let obj = JSON.parse(jsonObj)
if (obj.error) {
console.debug("error parsing message for index: ", index, " error: ", obj.error)
return false
}
return obj
}
}