Compare commits
12 commits
6616660849
...
0236586e44
Author | SHA1 | Date | |
---|---|---|---|
|
0236586e44 | ||
|
e13c7ae68c | ||
|
1d68123ea1 | ||
|
cf7b706582 | ||
|
c42d030d02 | ||
|
edfce9b492 | ||
|
e5d1ecd9f3 | ||
|
42a7813776 | ||
|
627faba0db | ||
|
a4ebaf52f5 | ||
|
660fe527f2 | ||
|
1a0ed7f298 |
33 changed files with 392 additions and 139 deletions
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
|
@ -84,7 +84,7 @@ jobs:
|
|||
assets+=("-a" "$asset")
|
||||
done
|
||||
tag_name="${GITHUB_REF##*/}"
|
||||
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
|
||||
gh release create "$tag_name" "${assets[@]}"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
@ -97,6 +97,6 @@ jobs:
|
|||
assets+=("-a" "$asset")
|
||||
done
|
||||
tag_name="${GITHUB_REF##*/}"
|
||||
hub release create -p "${assets[@]}" -m "$tag_name" -m "This is a pre-release for testing purposes only. It may or may not be unstable." -m "Join the Telegram group to help out: https://github.com/Wunderfitz/harbour-fernschreiber/issues/162" "$tag_name"
|
||||
gh release create "$tag_name" -p -n "This is a pre-release for testing purposes only. It may or may not be unstable." "${assets[@]}"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
@ -14,7 +14,11 @@ Fernschreiber wouldn't be the same without all the people helping in making it b
|
|||
- Chat info page, performance improvements to chat page, location support, app initialization/registration with Telegram, project dependencies, emoji handling, qml/js optimizations, multi-message actions, i18n fixes, chat permission handling, code reviews, logging categories, bot support, github build: [jgibbon](https://github.com/jgibbon)
|
||||
- Copy message to clipboard: [Christian Stemmle](https://github.com/chstem)
|
||||
- Hide send message button if send-by-enter is switched on, focus text input on entering a chat: [santhoshmanikandan](https://github.com/santhoshmanikandan)
|
||||
- Integration of logout and sesison options to settings page: [Peter G.](https://github.com/nephros)
|
||||
- Integration of logout and sesison options to settings page, search results optimization, highlight unread conversations: [Peter G.](https://github.com/nephros)
|
||||
- Option to always append last message in notifications: [Johannes Bachmann](https://github.com/dscheinah)
|
||||
- Option to jump to quoted message, widescreen UI adjustments: [Mikhail Barashkov](https://github.com/mbarashkov)
|
||||
|
||||
This list might not be complete. In case I forgot something/somebody, please let me know or create a PR, thanks! :)
|
||||
|
||||
### Logo/Icon
|
||||
- Designed by [Matteo](https://github.com/iamnomeutente), adjustments by [Slava Monich](https://github.com/monich)
|
||||
|
@ -48,7 +52,7 @@ const char TDLIB_API_HASH[] = "1234567890abcdef1234567890abcdef";
|
|||
|
||||
You get the Telegram API ID and hash as soon as you've registered your own application on [https://my.telegram.org](https://my.telegram.org).
|
||||
|
||||
Moreover, you need to have a compiled version of [TDLib 1.8.3](https://github.com/tdlib/td) or higher in the sub-directory `tdlib`. This sub-directory must contain another sub-directory that fits to the target device architecture (e.g. armv7hl, i486). Within this directory, there needs to be a folder called `lib` that contains at least `libtdjson.so`. For armv7hl the relative path would consequently be `tdlib/armv7hl/lib`.
|
||||
Moreover, you need to have a compiled version of [TDLib 1.8.21](https://github.com/tdlib/td) or higher in the sub-directory `tdlib`. This sub-directory must contain another sub-directory that fits to the target device architecture (e.g. armv7hl, i486). Within this directory, there needs to be a folder called `lib` that contains at least `libtdjson.so`. For armv7hl the relative path would consequently be `tdlib/armv7hl/lib`.
|
||||
|
||||
You may just want to download the [tdlib.zip from our fork](https://github.com/Wunderfitz/td/releases) to just use the exact version of the latest official Fernschreiber release. To use it, you need to extract it into your local `tdlib/` folder as described above. If so, you're done and can compile Fernschreiber using the Sailfish SDK. If you want to build TDLib for yourself, please keep on reading.
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ ListItem {
|
|||
readonly property bool canDeleteMessage: myMessage.can_be_deleted_for_all_users || (myMessage.can_be_deleted_only_for_self && myMessage.chat_id === page.myUserId)
|
||||
property bool hasContentComponent
|
||||
property bool additionalOptionsOpened
|
||||
property bool wasNavigatedTo: false
|
||||
|
||||
readonly property var additionalItemsModel: (extraContentLoader.item && ("extraContextMenuItems" in extraContentLoader.item)) ?
|
||||
extraContentLoader.item.extraContextMenuItems : 0
|
||||
|
@ -67,7 +68,7 @@ ListItem {
|
|||
property var chatReactions
|
||||
property var messageReactions
|
||||
|
||||
highlighted: (down || isSelected || additionalOptionsOpened) && !menuOpen
|
||||
highlighted: (down || isSelected || additionalOptionsOpened || wasNavigatedTo) && !menuOpen
|
||||
openMenuOnPressAndHold: !messageListItem.precalculatedValues.pageIsSelecting
|
||||
|
||||
signal replyToMessage()
|
||||
|
@ -128,6 +129,10 @@ ListItem {
|
|||
selectReactionBubble.visible = false;
|
||||
}
|
||||
|
||||
function getContentWidthMultiplier() {
|
||||
return Functions.isWidescreen(appWindow) ? 0.4 : 1.0
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
if (messageListItem.precalculatedValues.pageIsSelecting) {
|
||||
page.toggleMessageSelection(myMessage);
|
||||
|
@ -147,15 +152,22 @@ ListItem {
|
|||
messageListItem.messageReactions = null;
|
||||
selectReactionBubble.visible = false;
|
||||
} else {
|
||||
if (messageListItem.chatReactions) {
|
||||
selectReactionBubble.visible = !selectReactionBubble.visible;
|
||||
}
|
||||
elementSelected(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onDoubleClicked: {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
onPressAndHold: {
|
||||
|
@ -181,6 +193,25 @@ ListItem {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: chatPage
|
||||
onResetElements: {
|
||||
messageListItem.messageReactions = null;
|
||||
selectReactionBubble.visible = false;
|
||||
}
|
||||
onElementSelected: {
|
||||
if (elementIndex !== index) {
|
||||
selectReactionBubble.visible = false;
|
||||
}
|
||||
}
|
||||
onNavigatedTo: {
|
||||
if (targetIndex === index) {
|
||||
messageListItem.wasNavigatedTo = true;
|
||||
restoreNormalityTimer.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: contextMenuLoader
|
||||
active: false
|
||||
|
@ -285,6 +316,9 @@ ListItem {
|
|||
messageListItem.messageReactions = null;
|
||||
}
|
||||
}
|
||||
onReactionsUpdated: {
|
||||
chatReactions = tdLibWrapper.getChatReactions(page.chatInformation.id);
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
|
@ -299,14 +333,31 @@ ListItem {
|
|||
onTriggered: {
|
||||
Debug.log("Show item completely timer triggered, requested index: " + requestedIndex + ", current index: " + index)
|
||||
if (requestedIndex === index) {
|
||||
chatView.highlightMoveDuration = -1;
|
||||
chatView.highlightResizeDuration = -1;
|
||||
chatView.scrollToIndex(requestedIndex);
|
||||
chatView.highlightMoveDuration = 0;
|
||||
chatView.highlightResizeDuration = 0;
|
||||
var p = chatView.contentItem.mapFromItem(reactionsColumn, 0, 0)
|
||||
if (chatView.contentY > p.y || p.y + reactionsColumn.height > chatView.contentY + chatView.height) {
|
||||
Debug.log("Moving reactions for item at", requestedIndex, "info the view")
|
||||
chatView.highlightMoveDuration = -1
|
||||
chatView.highlightResizeDuration = -1
|
||||
chatView.scrollToIndex(requestedIndex, height <= chatView.height ? ListView.Contain : ListView.End)
|
||||
chatView.highlightMoveDuration = 0
|
||||
chatView.highlightResizeDuration = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: restoreNormalityTimer
|
||||
|
||||
repeat: false
|
||||
running: false
|
||||
interval: 1000
|
||||
triggeredOnStart: false
|
||||
onTriggered: {
|
||||
Debug.log("Restore normality for index " + index);
|
||||
messageListItem.wasNavigatedTo = false;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
delegateComponentLoadingTimer.start();
|
||||
|
@ -350,8 +401,10 @@ ListItem {
|
|||
id: messageTextRow
|
||||
spacing: Theme.paddingSmall
|
||||
width: precalculatedValues.entryWidth
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.horizontalCenter: Functions.isWidescreen(appWindow) ? undefined : parent.horizontalCenter
|
||||
anchors.left: Functions.isWidescreen(appWindow) ? parent.left : undefined
|
||||
y: Theme.paddingSmall
|
||||
anchors.leftMargin: Functions.isWidescreen(appWindow) ? Theme.paddingMedium : undefined
|
||||
|
||||
Loader {
|
||||
id: profileThumbnailLoader
|
||||
|
@ -468,8 +521,12 @@ ListItem {
|
|||
page.toggleMessageSelection(myMessage)
|
||||
} else {
|
||||
messageOptionsDrawer.open = false
|
||||
messageOverlayLoader.overlayMessage = messageInReplyToRow.inReplyToMessage
|
||||
if(appSettings.goToQuotedMessage) {
|
||||
chatPage.showMessage(messageInReplyToRow.inReplyToMessage.id, true)
|
||||
} else {
|
||||
messageOverlayLoader.active = true
|
||||
messageOverlayLoader.overlayMessage = messageInReplyToRow.inReplyToMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
onPressAndHold: {
|
||||
|
@ -581,7 +638,7 @@ ListItem {
|
|||
id: webPagePreviewLoader
|
||||
active: false
|
||||
asynchronous: true
|
||||
width: parent.width
|
||||
width: parent.width * getContentWidthMultiplier()
|
||||
height: (status === Loader.Ready) ? item.implicitHeight : myMessage.content.web_page ? precalculatedValues.webPagePreviewHeight : 0
|
||||
|
||||
sourceComponent: Component {
|
||||
|
@ -595,7 +652,7 @@ ListItem {
|
|||
|
||||
Loader {
|
||||
id: extraContentLoader
|
||||
width: parent.width
|
||||
width: parent.width * getContentWidthMultiplier()
|
||||
asynchronous: true
|
||||
height: item ? item.height : (messageListItem.hasContentComponent ? chatView.getContentComponentHeight(model.content_type, myMessage.content, width) : 0)
|
||||
}
|
||||
|
@ -662,50 +719,12 @@ ListItem {
|
|||
textFormat: Text.StyledText
|
||||
maximumLineCount: 1
|
||||
elide: Text.ElideRight
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (messageListItem.messageReactions) {
|
||||
messageListItem.messageReactions = null;
|
||||
selectReactionBubble.visible = false;
|
||||
} else {
|
||||
openReactions();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: selectReactionBubble
|
||||
visible: false
|
||||
opacity: visible ? 0.5 : 0.0
|
||||
Behavior on opacity { NumberAnimation {} }
|
||||
anchors {
|
||||
horizontalCenter: messageListItem.isOwnMessage ? messageBackground.left : messageBackground.right
|
||||
verticalCenter: messageBackground.verticalCenter
|
||||
}
|
||||
height: Theme.itemSizeExtraSmall
|
||||
width: Theme.itemSizeExtraSmall
|
||||
color: Theme.primaryColor
|
||||
radius: parent.width / 2
|
||||
}
|
||||
|
||||
IconButton {
|
||||
id: selectReactionButton
|
||||
visible: selectReactionBubble.visible
|
||||
opacity: visible ? 1.0 : 0.0
|
||||
Behavior on opacity { NumberAnimation {} }
|
||||
icon.source: "image://theme/icon-s-favorite"
|
||||
anchors.centerIn: selectReactionBubble
|
||||
onClicked: {
|
||||
openReactions();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -714,7 +733,7 @@ ListItem {
|
|||
id: reactionsColumn
|
||||
width: parent.width - ( 2 * Theme.horizontalPageMargin )
|
||||
anchors.top: messageTextRow.bottom
|
||||
anchors.topMargin: Theme.paddingMedium
|
||||
anchors.topMargin: Theme.paddingSmall
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
visible: messageListItem.messageReactions ? ( messageListItem.messageReactions.length > 0 ? true : false ) : false
|
||||
opacity: messageListItem.messageReactions ? ( messageListItem.messageReactions.length > 0 ? 1 : 0 ) : 0
|
||||
|
@ -723,7 +742,7 @@ ListItem {
|
|||
|
||||
Flickable {
|
||||
width: parent.width
|
||||
height: reactionsResultRow.height + 2 * Theme.paddingMedium
|
||||
height: reactionsResultRow.height + Theme.paddingSmall
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
contentWidth: reactionsResultRow.width
|
||||
clip: true
|
||||
|
@ -739,13 +758,13 @@ ListItem {
|
|||
|
||||
Row {
|
||||
id: singleReactionRow
|
||||
spacing: Theme.paddingMedium
|
||||
spacing: Theme.paddingSmall
|
||||
|
||||
Image {
|
||||
id: emojiPicture
|
||||
source: Emoji.getEmojiPath(modelData)
|
||||
width: status === Image.Ready ? Theme.fontSizeExtraLarge : 0
|
||||
height: Theme.fontSizeExtraLarge
|
||||
width: status === Image.Ready ? Theme.fontSizeLarge : 0
|
||||
height: Theme.fontSizeLarge
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -753,26 +772,12 @@ ListItem {
|
|||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
for (var i = 0; i < reactions.length; i++) {
|
||||
var reaction = reactions[i]
|
||||
var reactionText = reaction.reaction ? reaction.reaction : (reaction.type && reaction.type.emoji) ? reaction.type.emoji : ""
|
||||
if (reactionText === modelData) {
|
||||
if (reaction.is_chosen) {
|
||||
// Reaction is already selected
|
||||
tdLibWrapper.removeMessageReaction(chatId, messageId, reactionText)
|
||||
messageReactions = null
|
||||
return
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
// Reaction is not yet selected
|
||||
tdLibWrapper.addMessageReaction(chatId, messageId, modelData)
|
||||
messageReactions = null
|
||||
selectReactionBubble.visible = false
|
||||
tdLibWrapper.setMessageReaction(messageListItem.chatId, messageListItem.messageId, modelData);
|
||||
messageListItem.messageReactions = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
|
||||
import QtQuick 2.6
|
||||
import Sailfish.Silica 1.0
|
||||
import "../../js/functions.js" as Functions
|
||||
|
||||
Grid {
|
||||
width: parent.width - ( 2 * x )
|
||||
columns: (appWindow.deviceOrientation & Orientation.LandscapeMask) || Screen.sizeCategory === Screen.Large || Screen.sizeCategory === Screen.ExtraLarge ? 2 : 1
|
||||
columns: Functions.isWidescreen(appWindow) ? 2 : 1
|
||||
readonly property real columnWidth: width/columns
|
||||
}
|
||||
|
|
|
@ -103,6 +103,17 @@ AccordionItem {
|
|||
}
|
||||
}
|
||||
|
||||
TextSwitch {
|
||||
width: parent.columnWidth
|
||||
checked: appSettings.goToQuotedMessage
|
||||
text: qsTr("Go to quoted message")
|
||||
description: qsTr("When tapping a quoted message, open it in chat instead of showing it in an overlay.")
|
||||
automaticCheck: false
|
||||
onClicked: {
|
||||
appSettings.goToQuotedMessage = !checked
|
||||
}
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: feedbackComboBox
|
||||
width: parent.columnWidth
|
||||
|
|
|
@ -447,15 +447,10 @@ function handleLink(link) {
|
|||
handleTMeLink(link, tMePrefix);
|
||||
} else if (link.indexOf(tMePrefixHttp) === 0) {
|
||||
handleTMeLink(link, tMePrefixHttp);
|
||||
} else {
|
||||
Debug.log("Trying to open URL externally: " + link)
|
||||
if (link.indexOf("://") === -1) {
|
||||
Qt.openUrlExternally("https://" + link)
|
||||
} else {
|
||||
Qt.openUrlExternally(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getVideoHeight(videoWidth, videoData) {
|
||||
|
@ -540,3 +535,7 @@ function getMessagesNeededForwardPermissions(messages) {
|
|||
}
|
||||
return neededPermissions
|
||||
}
|
||||
|
||||
function isWidescreen(appWindow) {
|
||||
return (appWindow.deviceOrientation & Silica.Orientation.LandscapeMask) || Silica.Screen.sizeCategory === Silica.Screen.Large || Silica.Screen.sizeCategory === Silica.Screen.ExtraLarge
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ Page {
|
|||
property bool iterativeInitialization: false;
|
||||
property var messageToShow;
|
||||
property string messageIdToShow;
|
||||
property string messageIdToScrollTo;
|
||||
readonly property bool userIsMember: ((isPrivateChat || isSecretChat) && chatInformation["@type"]) || // should be optimized
|
||||
(isBasicGroup || isSuperGroup) && (
|
||||
(chatGroupInformation.status["@type"] === "chatMemberStatusMember")
|
||||
|
@ -67,6 +68,9 @@ Page {
|
|||
property bool doSendBotStartMessage
|
||||
property string sendBotStartMessageParameter
|
||||
property var availableReactions
|
||||
signal resetElements()
|
||||
signal elementSelected(int elementIndex)
|
||||
signal navigatedTo(int targetIndex)
|
||||
|
||||
states: [
|
||||
State {
|
||||
|
@ -407,6 +411,24 @@ Page {
|
|||
chatPage.focus = true;
|
||||
}
|
||||
|
||||
function showMessage(messageId, initialRun) {
|
||||
// Means we tapped a quoted message and had to load it.
|
||||
if(initialRun) {
|
||||
chatPage.messageIdToScrollTo = messageId
|
||||
}
|
||||
if (chatPage.messageIdToScrollTo && chatPage.messageIdToScrollTo != "") {
|
||||
var index = chatModel.getMessageIndex(chatPage.messageIdToScrollTo);
|
||||
if(index !== -1) {
|
||||
chatPage.messageIdToScrollTo = "";
|
||||
chatView.scrollToIndex(index);
|
||||
navigatedTo(index);
|
||||
} else if(initialRun) {
|
||||
// we only want to do this once.
|
||||
chatModel.triggerLoadHistoryForMessage(chatPage.messageIdToScrollTo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: forwardMessagesTimer
|
||||
interval: 200
|
||||
|
@ -480,7 +502,10 @@ Page {
|
|||
if (pageStack.depth === 1) {
|
||||
// Only clear chat model if navigated back to overview page. In other cases we keep the information...
|
||||
chatModel.clear();
|
||||
} else {
|
||||
resetElements();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -576,9 +601,6 @@ Page {
|
|||
onSponsoredMessageReceived: {
|
||||
chatPage.containsSponsoredMessages = true;
|
||||
}
|
||||
onReactionsUpdated: {
|
||||
availableReactions = tdLibWrapper.getChatReactions(chatInformation.id);
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
@ -613,8 +635,6 @@ Page {
|
|||
chatViewCooldownTimer.restart();
|
||||
chatViewStartupReadTimer.restart();
|
||||
|
||||
/*
|
||||
// Double-tap for reactions is currently disabled, let's see if we'll ever need it again
|
||||
var remainingDoubleTapHints = appSettings.remainingDoubleTapHints;
|
||||
Debug.log("Remaining double tap hints: " + remainingDoubleTapHints);
|
||||
if (remainingDoubleTapHints > 0) {
|
||||
|
@ -623,8 +643,6 @@ Page {
|
|||
tapHintLabel.visible = true;
|
||||
appSettings.remainingDoubleTapHints = remainingDoubleTapHints - 1;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
onNewMessageReceived: {
|
||||
if (( chatView.manuallyScrolledToBottom && Qt.application.state === Qt.ApplicationActive ) || message.sender_id.user_id === chatPage.myUserId) {
|
||||
|
@ -652,6 +670,8 @@ Page {
|
|||
if (chatView.height > chatView.contentHeight) {
|
||||
Debug.log("[ChatPage] Chat content quite small...");
|
||||
viewMessageTimer.queueViewMessage(chatView.count - 1);
|
||||
} else if (chatPage.messageIdToScrollTo && chatPage.messageIdToScrollTo != "") {
|
||||
showMessage(chatPage.messageIdToScrollTo, false)
|
||||
}
|
||||
chatViewCooldownTimer.restart();
|
||||
chatViewStartupReadTimer.restart();
|
||||
|
@ -1188,7 +1208,7 @@ Page {
|
|||
readonly property int profileThumbnailDimensions: showUserInfo ? Theme.itemSizeSmall : 0
|
||||
readonly property int pageMarginDouble: 2 * Theme.horizontalPageMargin
|
||||
readonly property int paddingMediumDouble: 2 * Theme.paddingMedium
|
||||
readonly property int entryWidth: chatView.width - pageMarginDouble //ширина полной строки сообщения вместе с аватаркой
|
||||
readonly property int entryWidth: chatView.width - pageMarginDouble
|
||||
readonly property int textItemWidth: entryWidth - profileThumbnailDimensions - Theme.paddingSmall
|
||||
readonly property int backgroundWidth: page.isPrivateChat ? textItemWidth - pageMarginDouble : textItemWidth //уменьшенная ширина сообщений для приватных чатов
|
||||
readonly property int backgroundRadius: textItemWidth/50
|
||||
|
@ -1214,10 +1234,9 @@ Page {
|
|||
manuallyScrolledToBottom = chatView.atYEnd
|
||||
}
|
||||
|
||||
function scrollToIndex(index) {
|
||||
function scrollToIndex(index, mode) {
|
||||
if(index > 0 && index < chatView.count) {
|
||||
positionViewAtIndex(index, ListView.Contain)
|
||||
// currentIndex = index;
|
||||
positionViewAtIndex(index, (mode === undefined) ? ListView.Contain : mode)
|
||||
if(index === chatView.count - 1) {
|
||||
manuallyScrolledToBottom = true;
|
||||
}
|
||||
|
|
|
@ -143,10 +143,11 @@ Page {
|
|||
|
||||
Connections {
|
||||
target: tdLibWrapper
|
||||
onUsersReceived: {
|
||||
onMessageSendersReceived: {
|
||||
Debug.log("Received poll users...")
|
||||
if(extra === optionDelegate.usersResponseIdentifierString) {
|
||||
for(var i = 0; i < userIds.length; i += 1) {
|
||||
optionDelegate.users.append({id: userIds[i], user:tdLibWrapper.getUserInformation(userIds[i])});
|
||||
for(var i = 0; i < senders.length; i += 1) {
|
||||
optionDelegate.users.append({id: senders[i].user_id, user:tdLibWrapper.getUserInformation(senders[i].user_id)});
|
||||
}
|
||||
loadUsersTimer.start();
|
||||
}
|
||||
|
|
|
@ -12,6 +12,26 @@
|
|||
# * date Author's Name <author's email> version-release
|
||||
# - Summary of changes
|
||||
|
||||
* Sun Dec 03 2023 Sebastian J. Wolf <sebastian@ygriega.de> 0.17
|
||||
- Update to TDLib 1.8.21, expect some hiccups ;)
|
||||
- Added contacts sync (OpenRepos builds only)
|
||||
- Tweaks to reaction handling (opens now on double click or click + star)
|
||||
- Option to jump to quoted message
|
||||
- Option to highlight unread conversations
|
||||
- Option to suppress notification previews
|
||||
- Option to append last message content to notifications
|
||||
- Added "unread mention" indicator to chat list
|
||||
- Improve message when search yields no results
|
||||
- New unread info for chats with high amount of unread messages
|
||||
- Setting for session inactivity timeout
|
||||
- UI improvements in landscape mode
|
||||
- Fix: Restore video functionality on SFOS 4.5
|
||||
- Fix: Chat list timestamp now updated more reliably
|
||||
- Fix: Faster reconnect after network changes
|
||||
- Fix: Some URLs couldn't be opened
|
||||
- Updated translations for several languages
|
||||
- Thanks to monich, nephros, arustg, jgibbon, carlosgonz0, okruhliak, dscheinah, pherjung and mbarashkov for your contributions
|
||||
|
||||
* Sun Jun 12 2022 Sebastian J. Wolf <sebastian@ygriega.de> 0.16
|
||||
- Support message reactions
|
||||
- Support t.me/+... links
|
||||
|
|
|
@ -12,7 +12,7 @@ Name: harbour-fernschreiber
|
|||
|
||||
Summary: Fernschreiber is a Telegram client for Aurora OS
|
||||
Version: 0.17
|
||||
Release: 8
|
||||
Release: 12
|
||||
Group: Qt/Qt
|
||||
License: LICENSE
|
||||
URL: http://werkwolf.eu/
|
||||
|
@ -70,7 +70,7 @@ desktop-file-install --delete-original \
|
|||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/%{name}
|
||||
%{_bindir}
|
||||
%{_datadir}/%{name}
|
||||
%{_datadir}/applications/%{name}.desktop
|
||||
%{_datadir}/icons/hicolor/*/apps/%{name}.png
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace {
|
|||
const QString KEY_NOTIFICATION_SUPPRESS_ENABLED("notificationSuppressContent");
|
||||
const QString KEY_NOTIFICATION_FEEDBACK("notificationFeedback");
|
||||
const QString KEY_NOTIFICATION_ALWAYS_SHOW_PREVIEW("notificationAlwaysShowPreview");
|
||||
const QString KEY_GO_TO_QUOTED_MESSAGE("goToQuotedMessage");
|
||||
const QString KEY_STORAGE_OPTIMIZER("useStorageOptimizer");
|
||||
const QString KEY_INLINEBOT_LOCATION_ACCESS("allowInlineBotLocationAccess");
|
||||
const QString KEY_REMAINING_INTERACTION_HINTS("remainingInteractionHints");
|
||||
|
@ -201,6 +202,20 @@ void AppSettings::setNotificationAlwaysShowPreview(bool enable)
|
|||
}
|
||||
}
|
||||
|
||||
bool AppSettings::goToQuotedMessage() const
|
||||
{
|
||||
return settings.value(KEY_GO_TO_QUOTED_MESSAGE, false).toBool();
|
||||
}
|
||||
|
||||
void AppSettings::setGoToQuotedMessage(bool enable)
|
||||
{
|
||||
if (goToQuotedMessage() != enable) {
|
||||
LOG(KEY_GO_TO_QUOTED_MESSAGE << enable);
|
||||
settings.setValue(KEY_GO_TO_QUOTED_MESSAGE, enable);
|
||||
emit goToQuotedMessageChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool AppSettings::storageOptimizer() const
|
||||
{
|
||||
return settings.value(KEY_STORAGE_OPTIMIZER, true).toBool();
|
||||
|
|
|
@ -35,6 +35,7 @@ class AppSettings : public QObject {
|
|||
Q_PROPERTY(bool notificationSuppressContent READ notificationSuppressContent WRITE setNotificationSuppressContent NOTIFY notificationSuppressContentChanged)
|
||||
Q_PROPERTY(NotificationFeedback notificationFeedback READ notificationFeedback WRITE setNotificationFeedback NOTIFY notificationFeedbackChanged)
|
||||
Q_PROPERTY(bool notificationAlwaysShowPreview READ notificationAlwaysShowPreview WRITE setNotificationAlwaysShowPreview NOTIFY notificationAlwaysShowPreviewChanged)
|
||||
Q_PROPERTY(bool goToQuotedMessage READ goToQuotedMessage WRITE setGoToQuotedMessage NOTIFY goToQuotedMessageChanged)
|
||||
Q_PROPERTY(bool storageOptimizer READ storageOptimizer WRITE setStorageOptimizer NOTIFY storageOptimizerChanged)
|
||||
Q_PROPERTY(bool allowInlineBotLocationAccess READ allowInlineBotLocationAccess WRITE setAllowInlineBotLocationAccess NOTIFY allowInlineBotLocationAccessChanged)
|
||||
Q_PROPERTY(int remainingInteractionHints READ remainingInteractionHints WRITE setRemainingInteractionHints NOTIFY remainingInteractionHintsChanged)
|
||||
|
@ -96,6 +97,9 @@ public:
|
|||
bool notificationAlwaysShowPreview() const;
|
||||
void setNotificationAlwaysShowPreview(bool enable);
|
||||
|
||||
bool goToQuotedMessage() const;
|
||||
void setGoToQuotedMessage(bool enable);
|
||||
|
||||
bool storageOptimizer() const;
|
||||
void setStorageOptimizer(bool enable);
|
||||
|
||||
|
@ -135,6 +139,7 @@ signals:
|
|||
void notificationSuppressContentChanged();
|
||||
void notificationFeedbackChanged();
|
||||
void notificationAlwaysShowPreviewChanged();
|
||||
void goToQuotedMessageChanged();
|
||||
void storageOptimizerChanged();
|
||||
void allowInlineBotLocationAccessChanged();
|
||||
void remainingInteractionHintsChanged();
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace {
|
|||
const QString UNREAD_COUNT("unread_count");
|
||||
const QString UNREAD_MENTION_COUNT("unread_mention_count");
|
||||
const QString UNREAD_REACTION_COUNT("unread_reaction_count");
|
||||
const QString AVAILABLE_REACTIONS("available_reactions");
|
||||
const QString NOTIFICATION_SETTINGS("notification_settings");
|
||||
const QString LAST_READ_INBOX_MESSAGE_ID("last_read_inbox_message_id");
|
||||
const QString LAST_READ_OUTBOX_MESSAGE_ID("last_read_outbox_message_id");
|
||||
|
@ -70,6 +71,7 @@ public:
|
|||
int unreadCount() const;
|
||||
int unreadMentionCount() const;
|
||||
int unreadReactionCount() const;
|
||||
QVariant availableReactions() const;
|
||||
QVariant photoSmall() const;
|
||||
qlonglong lastReadInboxMessageId() const;
|
||||
qlonglong senderUserId() const;
|
||||
|
@ -168,6 +170,11 @@ int ChatListModel::ChatData::unreadMentionCount() const
|
|||
return chatData.value(UNREAD_MENTION_COUNT).toInt();
|
||||
}
|
||||
|
||||
QVariant ChatListModel::ChatData::availableReactions() const
|
||||
{
|
||||
return chatData.value(AVAILABLE_REACTIONS);
|
||||
}
|
||||
|
||||
int ChatListModel::ChatData::unreadReactionCount() const
|
||||
{
|
||||
return chatData.value(UNREAD_REACTION_COUNT).toInt();
|
||||
|
@ -400,6 +407,7 @@ ChatListModel::ChatListModel(TDLibWrapper *tdLibWrapper, AppSettings *appSetting
|
|||
connect(tdLibWrapper, SIGNAL(chatDraftMessageUpdated(qlonglong, QVariantMap, QString)), this, SLOT(handleChatDraftMessageUpdated(qlonglong, QVariantMap, QString)));
|
||||
connect(tdLibWrapper, SIGNAL(chatUnreadMentionCountUpdated(qlonglong, int)), this, SLOT(handleChatUnreadMentionCountUpdated(qlonglong, int)));
|
||||
connect(tdLibWrapper, SIGNAL(chatUnreadReactionCountUpdated(qlonglong, int)), this, SLOT(handleChatUnreadReactionCountUpdated(qlonglong, int)));
|
||||
connect(tdLibWrapper, SIGNAL(chatAvailableReactionsUpdated(qlonglong,QVariantMap)), this, SLOT(handleChatAvailableReactionsUpdated(qlonglong,QVariantMap)));
|
||||
|
||||
// Don't start the timer until we have at least one chat
|
||||
relativeTimeRefreshTimer = new QTimer(this);
|
||||
|
@ -436,6 +444,7 @@ QHash<int,QByteArray> ChatListModel::roleNames() const
|
|||
roles.insert(ChatListModel::RoleUnreadCount, "unread_count");
|
||||
roles.insert(ChatListModel::RoleUnreadMentionCount, "unread_mention_count");
|
||||
roles.insert(ChatListModel::RoleUnreadReactionCount, "unread_reaction_count");
|
||||
roles.insert(ChatListModel::RoleAvailableReactions, "available_reactions");
|
||||
roles.insert(ChatListModel::RoleLastReadInboxMessageId, "last_read_inbox_message_id");
|
||||
roles.insert(ChatListModel::RoleLastMessageSenderId, "last_message_sender_id");
|
||||
roles.insert(ChatListModel::RoleLastMessageDate, "last_message_date");
|
||||
|
@ -472,6 +481,7 @@ QVariant ChatListModel::data(const QModelIndex &index, int role) const
|
|||
case ChatListModel::RolePhotoSmall: return data->photoSmall();
|
||||
case ChatListModel::RoleUnreadCount: return data->unreadCount();
|
||||
case ChatListModel::RoleUnreadMentionCount: return data->unreadMentionCount();
|
||||
case ChatListModel::RoleAvailableReactions: return data->availableReactions();
|
||||
case ChatListModel::RoleUnreadReactionCount: return data->unreadReactionCount();
|
||||
case ChatListModel::RoleLastReadInboxMessageId: return data->lastReadInboxMessageId();
|
||||
case ChatListModel::RoleLastMessageSenderId: return data->senderUserId();
|
||||
|
@ -1036,6 +1046,26 @@ void ChatListModel::handleChatUnreadReactionCountUpdated(qlonglong chatId, int u
|
|||
}
|
||||
}
|
||||
|
||||
void ChatListModel::handleChatAvailableReactionsUpdated(qlonglong chatId, const QVariantMap availableReactions)
|
||||
{
|
||||
if (chatIndexMap.contains(chatId)) {
|
||||
LOG("Updating available reaction type for" << chatId << availableReactions);
|
||||
const int chatIndex = chatIndexMap.value(chatId);
|
||||
ChatData *chat = chatList.at(chatIndex);
|
||||
chat->chatData.insert(AVAILABLE_REACTIONS, availableReactions);
|
||||
QVector<int> changedRoles;
|
||||
changedRoles.append(ChatListModel::RoleAvailableReactions);
|
||||
const QModelIndex modelIndex(index(chatIndex));
|
||||
emit dataChanged(modelIndex, modelIndex, changedRoles);
|
||||
} else {
|
||||
ChatData *chat = hiddenChats.value(chatId);
|
||||
if (chat) {
|
||||
LOG("Updating available reaction type for hidden chat" << chatId << availableReactions);
|
||||
chat->chatData.insert(AVAILABLE_REACTIONS, availableReactions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChatListModel::handleRelativeTimeRefreshTimer()
|
||||
{
|
||||
LOG("Refreshing timestamps");
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
RoleUnreadCount,
|
||||
RoleUnreadMentionCount,
|
||||
RoleUnreadReactionCount,
|
||||
RoleAvailableReactions,
|
||||
RoleLastReadInboxMessageId,
|
||||
RoleLastMessageSenderId,
|
||||
RoleLastMessageDate,
|
||||
|
@ -93,6 +94,7 @@ private slots:
|
|||
void handleChatDraftMessageUpdated(qlonglong chatId, const QVariantMap &draftMessage, const QString &order);
|
||||
void handleChatUnreadMentionCountUpdated(qlonglong chatId, int unreadMentionCount);
|
||||
void handleChatUnreadReactionCountUpdated(qlonglong chatId, int unreadReactionCount);
|
||||
void handleChatAvailableReactionsUpdated(qlonglong chatId, const QVariantMap availableReactions);
|
||||
void handleRelativeTimeRefreshTimer();
|
||||
|
||||
signals:
|
||||
|
|
|
@ -363,6 +363,15 @@ void ChatModel::initialize(const QVariantMap &chatInformation)
|
|||
tdLibWrapper->getChatHistory(chatId, this->chatInformation.value(LAST_READ_INBOX_MESSAGE_ID).toLongLong());
|
||||
}
|
||||
|
||||
void ChatModel::triggerLoadHistoryForMessage(qlonglong messageId)
|
||||
{
|
||||
if (!this->inIncrementalUpdate && !messages.isEmpty()) {
|
||||
LOG("Trigger loading message with id..." << messageId);
|
||||
this->inIncrementalUpdate = true;
|
||||
this->tdLibWrapper->getChatHistory(chatId, messageId);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatModel::triggerLoadMoreHistory()
|
||||
{
|
||||
if (!this->inIncrementalUpdate && !messages.isEmpty()) {
|
||||
|
@ -400,6 +409,17 @@ QVariantMap ChatModel::getMessage(int index)
|
|||
return QVariantMap();
|
||||
}
|
||||
|
||||
int ChatModel::getMessageIndex(qlonglong messageId)
|
||||
{
|
||||
if (messages.size() == 0) {
|
||||
return -1;
|
||||
}
|
||||
if (messageIndexMap.contains(messageId)) {
|
||||
return messageIndexMap.value(messageId);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ChatModel::getLastReadMessageIndex()
|
||||
{
|
||||
LOG("Obtaining last read message index");
|
||||
|
|
|
@ -40,12 +40,14 @@ public:
|
|||
Q_INVOKABLE void clear(bool contentOnly = false);
|
||||
Q_INVOKABLE void initialize(const QVariantMap &chatInformation);
|
||||
Q_INVOKABLE void triggerLoadMoreHistory();
|
||||
Q_INVOKABLE void triggerLoadHistoryForMessage(qlonglong messageId);
|
||||
Q_INVOKABLE void triggerLoadMoreFuture();
|
||||
Q_INVOKABLE QVariantMap getChatInformation();
|
||||
Q_INVOKABLE QVariantMap getMessage(int index);
|
||||
Q_INVOKABLE int getLastReadMessageIndex();
|
||||
Q_INVOKABLE void setSearchQuery(const QString newSearchQuery);
|
||||
|
||||
Q_INVOKABLE int getMessageIndex(qlonglong messageId);
|
||||
QVariantMap smallPhoto() const;
|
||||
qlonglong getChatId() const;
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ namespace {
|
|||
const QString UNREAD_COUNT("unread_count");
|
||||
const QString UNREAD_MENTION_COUNT("unread_mention_count");
|
||||
const QString UNREAD_REACTION_COUNT("unread_reaction_count");
|
||||
const QString AVAILABLE_REACTIONS("available_reactions");
|
||||
const QString TEXT("text");
|
||||
const QString LAST_READ_INBOX_MESSAGE_ID("last_read_inbox_message_id");
|
||||
const QString LAST_READ_OUTBOX_MESSAGE_ID("last_read_outbox_message_id");
|
||||
|
@ -123,6 +124,7 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren
|
|||
handlers.insert("updateChatPosition", &TDLibReceiver::processUpdateChatPosition);
|
||||
handlers.insert("updateChatReadInbox", &TDLibReceiver::processUpdateChatReadInbox);
|
||||
handlers.insert("updateChatReadOutbox", &TDLibReceiver::processUpdateChatReadOutbox);
|
||||
handlers.insert("updateChatAvailableReactions", &TDLibReceiver::processUpdateChatAvailableReactions);
|
||||
handlers.insert("updateBasicGroup", &TDLibReceiver::processUpdateBasicGroup);
|
||||
handlers.insert("updateSupergroup", &TDLibReceiver::processUpdateSuperGroup);
|
||||
handlers.insert("updateChatOnlineMemberCount", &TDLibReceiver::processChatOnlineMemberCountUpdated);
|
||||
|
@ -160,6 +162,7 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren
|
|||
handlers.insert("updateChatPinnedMessage", &TDLibReceiver::processUpdateChatPinnedMessage);
|
||||
handlers.insert("updateMessageIsPinned", &TDLibReceiver::processUpdateMessageIsPinned);
|
||||
handlers.insert("users", &TDLibReceiver::processUsers);
|
||||
handlers.insert("messageSenders", &TDLibReceiver::processMessageSenders);
|
||||
handlers.insert("error", &TDLibReceiver::processError);
|
||||
handlers.insert("ok", &TDLibReceiver::ok);
|
||||
handlers.insert("secretChat", &TDLibReceiver::processSecretChat);
|
||||
|
@ -362,6 +365,14 @@ void TDLibReceiver::processUpdateChatReadOutbox(const QVariantMap &receivedInfor
|
|||
emit chatReadOutboxUpdated(chat_id, last_read_outbox_message_id);
|
||||
}
|
||||
|
||||
void TDLibReceiver::processUpdateChatAvailableReactions(const QVariantMap &receivedInformation)
|
||||
{
|
||||
const qlonglong chat_id(receivedInformation.value(CHAT_ID).toLongLong());
|
||||
const QVariantMap available_reactions(receivedInformation.value(AVAILABLE_REACTIONS).toMap());
|
||||
LOG("Available reactions updated for" << chat_id << "new information:" << available_reactions);
|
||||
emit chatAvailableReactionsUpdated(chat_id, available_reactions);
|
||||
}
|
||||
|
||||
void TDLibReceiver::processUpdateBasicGroup(const QVariantMap &receivedInformation)
|
||||
{
|
||||
const QVariantMap basicGroup(receivedInformation.value(BASIC_GROUP).toMap());
|
||||
|
@ -634,6 +645,12 @@ void TDLibReceiver::processUsers(const QVariantMap &receivedInformation)
|
|||
emit usersReceived(receivedInformation.value(_EXTRA).toString(), receivedInformation.value("user_ids").toList(), receivedInformation.value(TOTAL_COUNT).toInt());
|
||||
}
|
||||
|
||||
void TDLibReceiver::processMessageSenders(const QVariantMap &receivedInformation)
|
||||
{
|
||||
LOG("Received Message Senders");
|
||||
emit messageSendersReceived(receivedInformation.value(_EXTRA).toString(), receivedInformation.value("senders").toList(), receivedInformation.value(TOTAL_COUNT).toInt());
|
||||
}
|
||||
|
||||
void TDLibReceiver::processError(const QVariantMap &receivedInformation)
|
||||
{
|
||||
LOG("Received an error");
|
||||
|
|
|
@ -52,6 +52,7 @@ signals:
|
|||
void chatPinnedUpdated(qlonglong chatId, bool isPinned);
|
||||
void chatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, int unreadCount);
|
||||
void chatReadOutboxUpdated(const QString &chatId, const QString &lastReadOutboxMessageId);
|
||||
void chatAvailableReactionsUpdated(const qlonglong &chatId, const QVariantMap &availableReactions);
|
||||
void basicGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation);
|
||||
void superGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation);
|
||||
void chatOnlineMemberCountUpdated(const QString &chatId, int onlineMemberCount);
|
||||
|
@ -88,7 +89,8 @@ signals:
|
|||
void chatTitleUpdated(const QString &chatId, const QString &title);
|
||||
void chatPinnedMessageUpdated(qlonglong chatId, qlonglong pinnedMessageId);
|
||||
void messageIsPinnedUpdated(qlonglong chatId, qlonglong messageId, bool isPinned);
|
||||
void usersReceived(const QString &extra, const QVariantList &userIds, int totalUsers);
|
||||
void usersReceived(const QString &extra, const QVariantList &senders, int totalUsers);
|
||||
void messageSendersReceived(const QString &extra, const QVariantList &userIds, int totalUsers);
|
||||
void errorReceived(const int code, const QString &message, const QString &extra);
|
||||
void secretChat(qlonglong secretChatId, const QVariantMap &secretChat);
|
||||
void secretChatUpdated(qlonglong secretChatId, const QVariantMap &secretChat);
|
||||
|
@ -135,6 +137,7 @@ private:
|
|||
void processUpdateChatPosition(const QVariantMap &receivedInformation);
|
||||
void processUpdateChatReadInbox(const QVariantMap &receivedInformation);
|
||||
void processUpdateChatReadOutbox(const QVariantMap &receivedInformation);
|
||||
void processUpdateChatAvailableReactions(const QVariantMap &receivedInformation);
|
||||
void processUpdateBasicGroup(const QVariantMap &receivedInformation);
|
||||
void processUpdateSuperGroup(const QVariantMap &receivedInformation);
|
||||
void processChatOnlineMemberCountUpdated(const QVariantMap &receivedInformation);
|
||||
|
@ -173,6 +176,7 @@ private:
|
|||
void processUpdateChatPinnedMessage(const QVariantMap &receivedInformation);
|
||||
void processUpdateMessageIsPinned(const QVariantMap &receivedInformation);
|
||||
void processUsers(const QVariantMap &receivedInformation);
|
||||
void processMessageSenders(const QVariantMap &receivedInformation);
|
||||
void processError(const QVariantMap &receivedInformation);
|
||||
void processSecretChat(const QVariantMap &receivedInformation);
|
||||
void processUpdateSecretChat(const QVariantMap &receivedInformation);
|
||||
|
|
|
@ -137,6 +137,7 @@ void TDLibWrapper::initializeTDLibReceiver() {
|
|||
connect(this->tdLibReceiver, SIGNAL(chatOrderUpdated(QString, QString)), this, SIGNAL(chatOrderUpdated(QString, QString)));
|
||||
connect(this->tdLibReceiver, SIGNAL(chatReadInboxUpdated(QString, QString, int)), this, SIGNAL(chatReadInboxUpdated(QString, QString, int)));
|
||||
connect(this->tdLibReceiver, SIGNAL(chatReadOutboxUpdated(QString, QString)), this, SIGNAL(chatReadOutboxUpdated(QString, QString)));
|
||||
connect(this->tdLibReceiver, SIGNAL(chatAvailableReactionsUpdated(qlonglong, QVariantMap)), this, SLOT(handleAvailableReactionsUpdated(qlonglong, QVariantMap)));
|
||||
connect(this->tdLibReceiver, SIGNAL(basicGroupUpdated(qlonglong, QVariantMap)), this, SLOT(handleBasicGroupUpdated(qlonglong, QVariantMap)));
|
||||
connect(this->tdLibReceiver, SIGNAL(superGroupUpdated(qlonglong, QVariantMap)), this, SLOT(handleSuperGroupUpdated(qlonglong, QVariantMap)));
|
||||
connect(this->tdLibReceiver, SIGNAL(chatOnlineMemberCountUpdated(QString, int)), this, SIGNAL(chatOnlineMemberCountUpdated(QString, int)));
|
||||
|
@ -176,6 +177,7 @@ void TDLibWrapper::initializeTDLibReceiver() {
|
|||
connect(this->tdLibReceiver, SIGNAL(chatPinnedMessageUpdated(qlonglong, qlonglong)), this, SIGNAL(chatPinnedMessageUpdated(qlonglong, qlonglong)));
|
||||
connect(this->tdLibReceiver, SIGNAL(messageIsPinnedUpdated(qlonglong, qlonglong, bool)), this, SLOT(handleMessageIsPinnedUpdated(qlonglong, qlonglong, bool)));
|
||||
connect(this->tdLibReceiver, SIGNAL(usersReceived(QString, QVariantList, int)), this, SIGNAL(usersReceived(QString, QVariantList, int)));
|
||||
connect(this->tdLibReceiver, SIGNAL(messageSendersReceived(QString, QVariantList, int)), this, SIGNAL(messageSendersReceived(QString, QVariantList, int)));
|
||||
connect(this->tdLibReceiver, SIGNAL(errorReceived(int, QString, QString)), this, SLOT(handleErrorReceived(int, QString, QString)));
|
||||
connect(this->tdLibReceiver, SIGNAL(contactsImported(QVariantList, QVariantList)), this, SIGNAL(contactsImported(QVariantList, QVariantList)));
|
||||
connect(this->tdLibReceiver, SIGNAL(messageEditedUpdated(qlonglong, qlonglong, QVariantMap)), this, SIGNAL(messageEditedUpdated(qlonglong, qlonglong, QVariantMap)));
|
||||
|
@ -1462,8 +1464,9 @@ void TDLibWrapper::getPageSource(const QString &address)
|
|||
connect(reply, SIGNAL(finished()), this, SLOT(handleGetPageSourceFinished()));
|
||||
}
|
||||
|
||||
void TDLibWrapper::addMessageReaction(qlonglong chatId, qlonglong messageId, const QString &reaction)
|
||||
void TDLibWrapper::setMessageReaction(qlonglong chatId, qlonglong messageId, const QString &reaction)
|
||||
{
|
||||
LOG("Set message reaction" << chatId << messageId << reaction);
|
||||
QVariantMap requestObject;
|
||||
requestObject.insert(CHAT_ID, chatId);
|
||||
requestObject.insert(MESSAGE_ID, messageId);
|
||||
|
@ -1478,35 +1481,9 @@ void TDLibWrapper::addMessageReaction(qlonglong chatId, qlonglong messageId, con
|
|||
reactionType.insert(EMOJI, reaction);
|
||||
requestObject.insert(REACTION_TYPE, reactionType);
|
||||
requestObject.insert(_TYPE, "addMessageReaction");
|
||||
LOG("Add message reaction" << chatId << messageId << reaction);
|
||||
} else {
|
||||
requestObject.insert("reaction", reaction);
|
||||
requestObject.insert(_TYPE, "setMessageReaction");
|
||||
LOG("Toggle message reaction" << chatId << messageId << reaction);
|
||||
}
|
||||
this->sendRequest(requestObject);
|
||||
}
|
||||
|
||||
void TDLibWrapper::removeMessageReaction(qlonglong chatId, qlonglong messageId, const QString &reaction)
|
||||
{
|
||||
QVariantMap requestObject;
|
||||
requestObject.insert(CHAT_ID, chatId);
|
||||
requestObject.insert(MESSAGE_ID, messageId);
|
||||
if (versionNumber > VERSION_NUMBER(1,8,5)) {
|
||||
// "reaction_type": {
|
||||
// "@type": "reactionTypeEmoji",
|
||||
// "emoji": "..."
|
||||
// }
|
||||
QVariantMap reactionType;
|
||||
reactionType.insert(_TYPE, REACTION_TYPE_EMOJI);
|
||||
reactionType.insert(EMOJI, reaction);
|
||||
requestObject.insert(REACTION_TYPE, reactionType);
|
||||
requestObject.insert(_TYPE, "removeMessageReaction");
|
||||
LOG("Remove message reaction" << chatId << messageId << reaction);
|
||||
} else {
|
||||
requestObject.insert("reaction", reaction);
|
||||
requestObject.insert(_TYPE, "setMessageReaction");
|
||||
LOG("Toggle message reaction" << chatId << messageId << reaction);
|
||||
}
|
||||
this->sendRequest(requestObject);
|
||||
}
|
||||
|
@ -1631,12 +1608,15 @@ QVariantMap TDLibWrapper::getChat(const QString &chatId)
|
|||
|
||||
QStringList TDLibWrapper::getChatReactions(const QString &chatId)
|
||||
{
|
||||
LOG("Obtaining chat reactions for chat" << chatId);
|
||||
const QVariant available_reactions(chats.value(chatId).toMap().value(CHAT_AVAILABLE_REACTIONS));
|
||||
const QVariantMap map(available_reactions.toMap());
|
||||
const QString reactions_type(map.value(_TYPE).toString());
|
||||
if (reactions_type == CHAT_AVAILABLE_REACTIONS_ALL) {
|
||||
LOG("Chat uses all available reactions, currently available number" << activeEmojiReactions.size());
|
||||
return activeEmojiReactions;
|
||||
} else if (reactions_type == CHAT_AVAILABLE_REACTIONS_SOME) {
|
||||
LOG("Chat uses reduced set of reactions");
|
||||
const QVariantList reactions(map.value(REACTIONS).toList());
|
||||
const int n = reactions.count();
|
||||
QStringList emojis;
|
||||
|
@ -1658,10 +1638,13 @@ QStringList TDLibWrapper::getChatReactions(const QString &chatId)
|
|||
}
|
||||
}
|
||||
}
|
||||
LOG("Found emojis for this chat" << emojis.size());
|
||||
return emojis;
|
||||
} else if (reactions_type.isEmpty()) {
|
||||
LOG("No chat reaction type specified, using all reactions");
|
||||
return available_reactions.toStringList();
|
||||
} else {
|
||||
LOG("Unknown chat reaction type" << reactions_type);
|
||||
return QStringList();
|
||||
}
|
||||
}
|
||||
|
@ -1931,6 +1914,17 @@ void TDLibWrapper::handleUnreadChatCountUpdated(const QVariantMap &chatCountInfo
|
|||
}
|
||||
}
|
||||
|
||||
void TDLibWrapper::handleAvailableReactionsUpdated(qlonglong chatId, const QVariantMap &availableReactions)
|
||||
{
|
||||
LOG("Updating available reactions for chat" << chatId << availableReactions);
|
||||
QString chatIdString = QString::number(chatId);
|
||||
QVariantMap chatInformation = this->getChat(chatIdString);
|
||||
chatInformation.insert(CHAT_AVAILABLE_REACTIONS, availableReactions);
|
||||
this->chats.insert(chatIdString, chatInformation);
|
||||
emit chatAvailableReactionsUpdated(chatId, availableReactions);
|
||||
|
||||
}
|
||||
|
||||
void TDLibWrapper::handleBasicGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation)
|
||||
{
|
||||
emit basicGroupUpdated(updateGroup(groupId, groupInformation, &basicGroups)->groupId);
|
||||
|
@ -2093,7 +2087,6 @@ void TDLibWrapper::handleActiveEmojiReactionsUpdated(const QStringList& emojis)
|
|||
if (activeEmojiReactions != emojis) {
|
||||
activeEmojiReactions = emojis;
|
||||
LOG(emojis.count() << "reaction(s) available");
|
||||
emit reactionsUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -249,8 +249,7 @@ public:
|
|||
Q_INVOKABLE void terminateSession(const QString &sessionId);
|
||||
Q_INVOKABLE void getMessageAvailableReactions(qlonglong chatId, qlonglong messageId);
|
||||
Q_INVOKABLE void getPageSource(const QString &address);
|
||||
Q_INVOKABLE void addMessageReaction(qlonglong chatId, qlonglong messageId, const QString &reaction);
|
||||
Q_INVOKABLE void removeMessageReaction(qlonglong chatId, qlonglong messageId, const QString &reaction);
|
||||
Q_INVOKABLE void setMessageReaction(qlonglong chatId, qlonglong messageId, const QString &reaction);
|
||||
Q_INVOKABLE void setNetworkType(NetworkType networkType);
|
||||
Q_INVOKABLE void setInactiveSessionTtl(int days);
|
||||
|
||||
|
@ -280,6 +279,7 @@ signals:
|
|||
void chatPinnedUpdated(qlonglong chatId, bool isPinned);
|
||||
void chatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, int unreadCount);
|
||||
void chatReadOutboxUpdated(const QString &chatId, const QString &lastReadOutboxMessageId);
|
||||
void chatAvailableReactionsUpdated(const qlonglong &chatId, const QVariantMap &availableReactions);
|
||||
void userUpdated(const QString &userId, const QVariantMap &userInformation);
|
||||
void ownUserUpdated(const QVariantMap &userInformation);
|
||||
void basicGroupUpdated(qlonglong groupId);
|
||||
|
@ -323,6 +323,7 @@ signals:
|
|||
void chatTitleUpdated(const QString &chatId, const QString &title);
|
||||
void chatPinnedMessageUpdated(qlonglong chatId, qlonglong pinnedMessageId);
|
||||
void usersReceived(const QString &extra, const QVariantList &userIds, int totalUsers);
|
||||
void messageSendersReceived(const QString &extra, const QVariantList &senders, int totalUsers);
|
||||
void errorReceived(int code, const QString &message, const QString &extra);
|
||||
void contactsImported(const QVariantList &importerCount, const QVariantList &userIds);
|
||||
void messageNotFound(qlonglong chatId, qlonglong messageId);
|
||||
|
@ -339,7 +340,6 @@ signals:
|
|||
void chatUnreadMentionCountUpdated(qlonglong chatId, int unreadMentionCount);
|
||||
void chatUnreadReactionCountUpdated(qlonglong chatId, int unreadReactionCount);
|
||||
void tgUrlFound(const QString &tgUrl);
|
||||
void reactionsUpdated();
|
||||
|
||||
public slots:
|
||||
void handleVersionDetected(const QString &version);
|
||||
|
@ -353,6 +353,7 @@ public slots:
|
|||
void handleChatReceived(const QVariantMap &chatInformation);
|
||||
void handleUnreadMessageCountUpdated(const QVariantMap &messageCountInformation);
|
||||
void handleUnreadChatCountUpdated(const QVariantMap &chatCountInformation);
|
||||
void handleAvailableReactionsUpdated(qlonglong chatId, const QVariantMap &availableReactions);
|
||||
void handleBasicGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation);
|
||||
void handleSuperGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation);
|
||||
void handleStickerSets(const QVariantList &stickerSets);
|
||||
|
|
|
@ -1599,6 +1599,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation>Inhalte in Hinweisen verbergen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation>Zu zitierter Nachricht springen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation>Beim Tippen auf eine zitierte Nachricht zu dieser springen anstatt es in einem Overlay anzuzeigen.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1601,6 +1601,14 @@ messages</numerusform>
|
|||
<source>Hide content in notifications</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1599,6 +1599,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation>Ocultar contenido a notificaciones</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation>Ir a mensaje citado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation>Al Pulsar mensaje citado, abrirá en Charla en lugar de mostrarlo en una superposición.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
@ -1710,9 +1718,9 @@
|
|||
</message>
|
||||
<message numerus="yes">
|
||||
<source>%1 day(s)</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
<translation>
|
||||
<numerusform>%1 dia</numerusform>
|
||||
<numerusform>%1 dias</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
@ -2336,11 +2344,11 @@
|
|||
<message>
|
||||
<source>sent a game</source>
|
||||
<comment>myself</comment>
|
||||
<translation>envió juego</translation>
|
||||
<translation>envió un juego</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>sent a game</source>
|
||||
<translation>envió juego</translation>
|
||||
<translation>envió un juego</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -1600,6 +1600,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1599,6 +1599,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation>Masquer le contenu dans les notifications</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1572,6 +1572,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1599,6 +1599,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1626,6 +1626,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1629,6 +1629,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation>Не показывать содержимое сообщений в уведомлениях</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation>Переходить к цитируемому сообщению</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation>По нажатию на цитируемое сообщение, переходить к нему в чате вместо отображения во всплывающем окне.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1626,6 +1626,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1599,6 +1599,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1573,6 +1573,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
|
@ -1599,6 +1599,14 @@
|
|||
<source>Hide content in notifications</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to quoted message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When tapping a quoted message, open it in chat instead of showing it in an overlay.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsPage</name>
|
||||
|
|
Loading…
Reference in a new issue