Only display reactions on chat list for now
This commit is contained in:
parent
99910a3f3a
commit
0a76ede35a
3 changed files with 8 additions and 35 deletions
|
@ -286,8 +286,6 @@ ListItem {
|
|||
tdLibWrapper.getMessage(myMessage.reply_in_chat_id ? myMessage.reply_in_chat_id : page.chatInformation.id,
|
||||
myMessage.reply_to_message_id)
|
||||
}
|
||||
|
||||
console.log("HUGGA: " + messageViewCount + " | " + JSON.stringify(reactions));
|
||||
}
|
||||
|
||||
onMyMessageChanged: {
|
||||
|
|
|
@ -117,38 +117,15 @@ ListItem {
|
|||
visible: chatListViewItem.unreadReactionCount > 0
|
||||
}
|
||||
|
||||
Text {
|
||||
id: chatUnreadReactionCount
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.bold: true
|
||||
color: Theme.primaryColor
|
||||
Icon {
|
||||
source: "image://theme/icon-s-favorite"
|
||||
height: Theme.iconSizeExtraSmall
|
||||
width: Theme.iconSizeExtraSmall
|
||||
highlighted: chatListViewItem.highlighted
|
||||
anchors.centerIn: chatUnreadReactionCountBackground
|
||||
visible: chatListViewItem.unreadReactionCount > 0
|
||||
opacity: isMuted ? Theme.opacityHigh : 1.0
|
||||
text: "❤️"
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: chatUnreadMentionCountBackground
|
||||
color: isMuted ? ((Theme.colorScheme === Theme.DarkOnLight) ? "lightgray" : "dimgray") : Theme.highlightBackgroundColor
|
||||
width: Theme.fontSizeLarge
|
||||
height: Theme.fontSizeLarge
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
radius: parent.width / 2
|
||||
visible: chatListViewItem.unreadMentionCount > 0
|
||||
}
|
||||
|
||||
Text {
|
||||
id: chatUnreadMentionCount
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.bold: true
|
||||
color: Theme.primaryColor
|
||||
anchors.centerIn: chatUnreadMentionCountBackground
|
||||
visible: chatListViewItem.unreadMentionCount > 0
|
||||
opacity: isMuted ? Theme.opacityHigh : 1.0
|
||||
text: "@"
|
||||
}
|
||||
}
|
||||
}
|
||||
Column {
|
||||
|
|
|
@ -225,15 +225,13 @@ uint ChatModel::MessageData::updateViewCount(const QVariantMap &interactionInfo)
|
|||
|
||||
uint ChatModel::MessageData::updateInteractionInfo(const QVariantMap &interactionInfo)
|
||||
{
|
||||
if (interactionInfo.value(_TYPE) == TYPE_MESSAGE_INTERACTION_INFO) {
|
||||
messageData.insert(INTERACTION_INFO, interactionInfo);
|
||||
return RoleFlagDisplay | updateViewCount(interactionInfo) | updateReactions(interactionInfo);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint ChatModel::MessageData::updateReactions(const QVariantMap &interactionInfo)
|
||||
{
|
||||
LOG("Updating reactions...");
|
||||
const QVariantList oldReactions = reactions;
|
||||
reactions = interactionInfo.value(REACTIONS).toList();
|
||||
return (reactions == oldReactions) ? 0 : RoleFlagMessageReactions;
|
||||
|
|
Loading…
Reference in a new issue