More tweaks for reactions
This commit is contained in:
parent
24edb17347
commit
61faf0f407
6 changed files with 39 additions and 13 deletions
|
@ -115,6 +115,19 @@ ListItem {
|
||||||
return interactionText;
|
return interactionText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openReactions() {
|
||||||
|
if (messageListItem.chatReactions) {
|
||||||
|
Debug.log("Using chat reactions")
|
||||||
|
messageListItem.messageReactions = chatReactions
|
||||||
|
showItemCompletelyTimer.requestedIndex = index;
|
||||||
|
showItemCompletelyTimer.start();
|
||||||
|
} else {
|
||||||
|
Debug.log("Obtaining message reactions")
|
||||||
|
tdLibWrapper.getMessageAvailableReactions(messageListItem.chatId, messageListItem.messageId);
|
||||||
|
}
|
||||||
|
selectReactionBubble.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (messageListItem.precalculatedValues.pageIsSelecting) {
|
if (messageListItem.precalculatedValues.pageIsSelecting) {
|
||||||
page.toggleMessageSelection(myMessage);
|
page.toggleMessageSelection(myMessage);
|
||||||
|
@ -134,10 +147,16 @@ ListItem {
|
||||||
messageListItem.messageReactions = null;
|
messageListItem.messageReactions = null;
|
||||||
selectReactionBubble.visible = false;
|
selectReactionBubble.visible = false;
|
||||||
} else {
|
} else {
|
||||||
|
if (messageListItem.chatReactions) {
|
||||||
selectReactionBubble.visible = !selectReactionBubble.visible;
|
selectReactionBubble.visible = !selectReactionBubble.visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onDoubleClicked: {
|
||||||
|
openReactions();
|
||||||
|
}
|
||||||
|
|
||||||
onPressAndHold: {
|
onPressAndHold: {
|
||||||
if (openMenuOnPressAndHold) {
|
if (openMenuOnPressAndHold) {
|
||||||
|
@ -643,6 +662,17 @@ ListItem {
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
maximumLineCount: 1
|
maximumLineCount: 1
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
if (messageListItem.messageReactions) {
|
||||||
|
messageListItem.messageReactions = null;
|
||||||
|
selectReactionBubble.visible = false;
|
||||||
|
} else {
|
||||||
|
openReactions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -672,16 +702,7 @@ ListItem {
|
||||||
icon.source: "image://theme/icon-s-favorite"
|
icon.source: "image://theme/icon-s-favorite"
|
||||||
anchors.centerIn: selectReactionBubble
|
anchors.centerIn: selectReactionBubble
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (messageListItem.chatReactions) {
|
openReactions();
|
||||||
Debug.log("Using chat reactions")
|
|
||||||
messageListItem.messageReactions = chatReactions
|
|
||||||
showItemCompletelyTimer.requestedIndex = index;
|
|
||||||
showItemCompletelyTimer.start();
|
|
||||||
} else {
|
|
||||||
Debug.log("Obtaining message reactions")
|
|
||||||
tdLibWrapper.getMessageAvailableReactions(messageListItem.chatId, messageListItem.messageId);
|
|
||||||
}
|
|
||||||
selectReactionBubble.visible = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -576,6 +576,9 @@ Page {
|
||||||
onSponsoredMessageReceived: {
|
onSponsoredMessageReceived: {
|
||||||
chatPage.containsSponsoredMessages = true;
|
chatPage.containsSponsoredMessages = true;
|
||||||
}
|
}
|
||||||
|
onReactionsUpdated: {
|
||||||
|
availableReactions = tdLibWrapper.getChatReactions(chatInformation.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
|
|
@ -12,7 +12,7 @@ Name: harbour-fernschreiber
|
||||||
|
|
||||||
Summary: Fernschreiber is a Telegram client for Sailfish OS
|
Summary: Fernschreiber is a Telegram client for Sailfish OS
|
||||||
Version: 0.17
|
Version: 0.17
|
||||||
Release: 7
|
Release: 8
|
||||||
Group: Qt/Qt
|
Group: Qt/Qt
|
||||||
License: LICENSE
|
License: LICENSE
|
||||||
URL: http://werkwolf.eu/
|
URL: http://werkwolf.eu/
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
Name: harbour-fernschreiber
|
Name: harbour-fernschreiber
|
||||||
Summary: Fernschreiber is a Telegram client for Sailfish OS
|
Summary: Fernschreiber is a Telegram client for Sailfish OS
|
||||||
Version: 0.17
|
Version: 0.17
|
||||||
Release: 7
|
Release: 8
|
||||||
# The contents of the Group field should be one of the groups listed here:
|
# The contents of the Group field should be one of the groups listed here:
|
||||||
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
|
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
|
||||||
Group: Qt/Qt
|
Group: Qt/Qt
|
||||||
|
|
|
@ -2093,6 +2093,7 @@ void TDLibWrapper::handleActiveEmojiReactionsUpdated(const QStringList& emojis)
|
||||||
if (activeEmojiReactions != emojis) {
|
if (activeEmojiReactions != emojis) {
|
||||||
activeEmojiReactions = emojis;
|
activeEmojiReactions = emojis;
|
||||||
LOG(emojis.count() << "reaction(s) available");
|
LOG(emojis.count() << "reaction(s) available");
|
||||||
|
emit reactionsUpdated();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -339,6 +339,7 @@ signals:
|
||||||
void chatUnreadMentionCountUpdated(qlonglong chatId, int unreadMentionCount);
|
void chatUnreadMentionCountUpdated(qlonglong chatId, int unreadMentionCount);
|
||||||
void chatUnreadReactionCountUpdated(qlonglong chatId, int unreadReactionCount);
|
void chatUnreadReactionCountUpdated(qlonglong chatId, int unreadReactionCount);
|
||||||
void tgUrlFound(const QString &tgUrl);
|
void tgUrlFound(const QString &tgUrl);
|
||||||
|
void reactionsUpdated();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void handleVersionDetected(const QString &version);
|
void handleVersionDetected(const QString &version);
|
||||||
|
|
Loading…
Reference in a new issue