mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-17 18:11:54 +00:00
e5a414a927
- `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`
36 lines
834 B
QML
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
|
|
}
|
|
}
|