From 9a5db3e83feccd9d3b7b1b2a3d8b6d8ce12396b3 Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Sun, 24 Jan 2021 23:46:30 +0100 Subject: [PATCH] Next steps towards supporting user preferences --- qml/components/InformationEditArea.qml | 4 +- qml/components/InformationTextItem.qml | 2 +- qml/pages/OverviewPage.qml | 6 + qml/pages/SettingsPage.qml | 224 ++++++++++++++++++++ src/tdlibreceiver.cpp | 15 +- src/tdlibreceiver.h | 4 + src/tdlibwrapper.cpp | 102 ++++++++- src/tdlibwrapper.h | 12 +- translations/harbour-fernschreiber-de.ts | 60 ++++++ translations/harbour-fernschreiber-en.ts | 60 ++++++ translations/harbour-fernschreiber-es.ts | 60 ++++++ translations/harbour-fernschreiber-fi.ts | 60 ++++++ translations/harbour-fernschreiber-hu.ts | 60 ++++++ translations/harbour-fernschreiber-it.ts | 60 ++++++ translations/harbour-fernschreiber-pl.ts | 60 ++++++ translations/harbour-fernschreiber-ru.ts | 60 ++++++ translations/harbour-fernschreiber-sv.ts | 60 ++++++ translations/harbour-fernschreiber-zh_CN.ts | 60 ++++++ translations/harbour-fernschreiber.ts | 60 ++++++ 19 files changed, 1017 insertions(+), 12 deletions(-) diff --git a/qml/components/InformationEditArea.qml b/qml/components/InformationEditArea.qml index 347882d..7659ff2 100644 --- a/qml/components/InformationEditArea.qml +++ b/qml/components/InformationEditArea.qml @@ -55,7 +55,7 @@ Column { width: parent.width - editAreaButton.width textLeftMargin: 0 anchors.verticalCenter: parent.verticalCenter - font.pixelSize: Theme.fontSizeSmall + font.pixelSize: Theme.fontSizeMedium } TextField { id: editAreaTextField @@ -68,7 +68,7 @@ Column { editAreaColumn.saveButtonClicked(editAreaColumn.editItem.text); } EnterKey.iconSource: editAreaButton.icon.source - font.pixelSize: Theme.fontSizeSmall + font.pixelSize: Theme.fontSizeMedium } InformationTextItem { id: editAreaTextItem diff --git a/qml/components/InformationTextItem.qml b/qml/components/InformationTextItem.qml index 6bf0ad0..1dee1bb 100644 --- a/qml/components/InformationTextItem.qml +++ b/qml/components/InformationTextItem.qml @@ -48,7 +48,7 @@ Column { id: labelComponent Label { wrapMode: Text.WrapAtWordBoundaryOrAnywhere - font.pixelSize: Theme.fontSizeSmall + font.pixelSize: Theme.fontSizeMedium textFormat: Text.StyledText color: Theme.primaryColor text: Emoji.emojify( Functions.replaceUrlsWithLinks(textItem.text).replace(/\n/g, "
"), Theme.fontSizeExtraSmall) diff --git a/qml/pages/OverviewPage.qml b/qml/pages/OverviewPage.qml index 40a9bc1..7a55c39 100644 --- a/qml/pages/OverviewPage.qml +++ b/qml/pages/OverviewPage.qml @@ -92,6 +92,12 @@ Page { tdLibWrapper.getRecentStickers(); tdLibWrapper.getInstalledStickerSets(); tdLibWrapper.getContacts(); + tdLibWrapper.getUserPrivacySettingRules(TelegramAPI.SettingAllowChatInvites); + tdLibWrapper.getUserPrivacySettingRules(TelegramAPI.SettingAllowFindingByPhoneNumber); + tdLibWrapper.getUserPrivacySettingRules(TelegramAPI.SettingShowLinkInForwardedMessages); + tdLibWrapper.getUserPrivacySettingRules(TelegramAPI.SettingShowPhoneNumber); + tdLibWrapper.getUserPrivacySettingRules(TelegramAPI.SettingShowProfilePhoto); + tdLibWrapper.getUserPrivacySettingRules(TelegramAPI.SettingShowStatus); } } diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index 94fc6dd..af215e2 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -21,6 +21,7 @@ import Sailfish.Silica 1.0 import WerkWolf.Fernschreiber 1.0 import "../components" import "../js/functions.js" as Functions +import "../js/debug.js" as Debug Page { id: settingsPage @@ -138,6 +139,229 @@ Page { } + Grid { + width: parent.width + columns: landscapeLayout ? 2 : 1 + columnSpacing: Theme.horizontalPageMargin + anchors.horizontalCenter: parent.horizontalCenter + + readonly property real columnWidth: width/columns + + Connections { + target: tdLibWrapper + onUserPrivacySettingUpdated: { + Debug.log("Received updated privacy setting: " + setting + ":" + rule); + switch (setting) { + case TelegramAPI.SettingAllowChatInvites: + allowChatInvitesComboBox.currentIndex = rule; + break; + case TelegramAPI.SettingAllowFindingByPhoneNumber: + allowFindingByPhoneNumberComboBox.currentIndex = rule; + break; + case TelegramAPI.SettingShowLinkInForwardedMessages: + showLinkInForwardedMessagesComboBox.currentIndex = rule; + break; + case TelegramAPI.SettingShowPhoneNumber: + showPhoneNumberComboBox.currentIndex = rule; + break; + case TelegramAPI.SettingShowProfilePhoto: + showProfilePhotoComboBox.currentIndex = rule; + break; + case TelegramAPI.SettingShowStatus: + showStatusComboBox.currentIndex = rule; + break; + } + } + } + + ComboBox { + id: allowChatInvitesComboBox + width: parent.columnWidth + label: qsTr("Allow chat invites") + description: qsTr("Privacy setting for managing whether you can be invited to chats.") + menu: ContextMenu { + + MenuItem { + text: qsTr("Yes") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingAllowChatInvites, TelegramAPI.RuleAllowAll); + } + } + MenuItem { + text: qsTr("Your contacts only") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingAllowChatInvites, TelegramAPI.RuleAllowContacts); + } + } + MenuItem { + text: qsTr("No") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingAllowChatInvites, TelegramAPI.RuleRestrictAll); + } + } + } + + Component.onCompleted: { + currentIndex = tdLibWrapper.getUserPrivacySettingRule(TelegramAPI.SettingAllowChatInvites); + } + } + + ComboBox { + id: allowFindingByPhoneNumberComboBox + width: parent.columnWidth + label: qsTr("Allow finding by phone number") + description: qsTr("Privacy setting for managing whether you can be found by your phone number.") + menu: ContextMenu { + + MenuItem { + text: qsTr("Yes") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingAllowFindingByPhoneNumber, TelegramAPI.RuleAllowAll); + } + } + MenuItem { + text: qsTr("Your contacts only") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingAllowFindingByPhoneNumber, TelegramAPI.RuleAllowContacts); + } + } + } + + Component.onCompleted: { + currentIndex = tdLibWrapper.getUserPrivacySettingRule(TelegramAPI.SettingAllowFindingByPhoneNumber); + } + } + + ComboBox { + id: showLinkInForwardedMessagesComboBox + width: parent.columnWidth + label: qsTr("Show link in forwarded messages") + description: qsTr("Privacy setting for managing whether a link to your account is included in forwarded messages.") + menu: ContextMenu { + + MenuItem { + text: qsTr("Yes") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowLinkInForwardedMessages, TelegramAPI.RuleAllowAll); + } + } + MenuItem { + text: qsTr("Your contacts only") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowLinkInForwardedMessages, TelegramAPI.RuleAllowContacts); + } + } + MenuItem { + text: qsTr("No") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowLinkInForwardedMessages, TelegramAPI.RuleRestrictAll); + } + } + } + + Component.onCompleted: { + currentIndex = tdLibWrapper.getUserPrivacySettingRule(TelegramAPI.SettingShowLinkInForwardedMessages); + } + } + + ComboBox { + id: showPhoneNumberComboBox + width: parent.columnWidth + label: qsTr("Show phone number") + description: qsTr("Privacy setting for managing whether your phone number is visible.") + menu: ContextMenu { + + MenuItem { + text: qsTr("Yes") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowPhoneNumber, TelegramAPI.RuleAllowAll); + } + } + MenuItem { + text: qsTr("Your contacts only") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowPhoneNumber, TelegramAPI.RuleAllowContacts); + } + } + MenuItem { + text: qsTr("No") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowPhoneNumber, TelegramAPI.RuleRestrictAll); + } + } + } + + Component.onCompleted: { + currentIndex = tdLibWrapper.getUserPrivacySettingRule(TelegramAPI.SettingShowPhoneNumber); + } + } + + ComboBox { + id: showProfilePhotoComboBox + width: parent.columnWidth + label: qsTr("Show profile photo") + description: qsTr("Privacy setting for managing whether your profile photo is visible.") + menu: ContextMenu { + + MenuItem { + text: qsTr("Yes") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowProfilePhoto, TelegramAPI.RuleAllowAll); + } + } + MenuItem { + text: qsTr("Your contacts only") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowProfilePhoto, TelegramAPI.RuleAllowContacts); + } + } + MenuItem { + text: qsTr("No") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowProfilePhoto, TelegramAPI.RuleRestrictAll); + } + } + } + + Component.onCompleted: { + currentIndex = tdLibWrapper.getUserPrivacySettingRule(TelegramAPI.SettingShowProfilePhoto); + } + } + + ComboBox { + id: showStatusComboBox + width: parent.columnWidth + label: qsTr("Show status") + description: qsTr("Privacy setting for managing whether your online status is visible.") + menu: ContextMenu { + + MenuItem { + text: qsTr("Yes") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowStatus, TelegramAPI.RuleAllowAll); + } + } + MenuItem { + text: qsTr("Your contacts only") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowStatus, TelegramAPI.RuleAllowContacts); + } + } + MenuItem { + text: qsTr("No") + onClicked: { + tdLibWrapper.setUserPrivacySettingRule(TelegramAPI.SettingShowStatus, TelegramAPI.RuleRestrictAll); + } + } + } + + Component.onCompleted: { + currentIndex = tdLibWrapper.getUserPrivacySettingRule(TelegramAPI.SettingShowStatus); + } + } + + } + SectionHeader { text: qsTr("Behavior") } diff --git a/src/tdlibreceiver.cpp b/src/tdlibreceiver.cpp index 6a62d28..d55cfde 100644 --- a/src/tdlibreceiver.cpp +++ b/src/tdlibreceiver.cpp @@ -139,6 +139,8 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren handlers.insert("updateChatDraftMessage", &TDLibReceiver::processUpdateChatDraftMessage); handlers.insert("inlineQueryResults", &TDLibReceiver::processInlineQueryResults); handlers.insert("callbackQueryAnswer", &TDLibReceiver::processCallbackQueryAnswer); + handlers.insert("userPrivacySettingRules", &TDLibReceiver::processUserPrivacySettingRules); + handlers.insert("updateUserPrivacySettingRules", &TDLibReceiver::processUpdateUserPrivacySettingRules); } void TDLibReceiver::setActive(bool active) @@ -607,7 +609,18 @@ void TDLibReceiver::processInlineQueryResults(const QVariantMap &receivedInforma void TDLibReceiver::processCallbackQueryAnswer(const QVariantMap &receivedInformation) { - LOG("Callback Query answer"); emit callbackQueryAnswer(receivedInformation.value(TEXT).toString(), receivedInformation.value("alert").toBool(), receivedInformation.value("url").toString()); } + +void TDLibReceiver::processUserPrivacySettingRules(const QVariantMap &receivedInformation) +{ + LOG("User privacy setting rules"); + emit userPrivacySettingRules(receivedInformation); +} + +void TDLibReceiver::processUpdateUserPrivacySettingRules(const QVariantMap &receivedInformation) +{ + LOG("User privacy setting rules updated"); + emit userPrivacySettingRulesUpdated(receivedInformation); +} diff --git a/src/tdlibreceiver.h b/src/tdlibreceiver.h index 4ffbe58..cb92f04 100644 --- a/src/tdlibreceiver.h +++ b/src/tdlibreceiver.h @@ -95,6 +95,8 @@ signals: void chatDraftMessageUpdated(qlonglong chatId, const QVariantMap &draftMessage, const QString &order); void inlineQueryResults(const QString &inlineQueryId, const QString &nextOffset, const QVariantList &results, const QString &switchPmText, const QString &switchPmParameter, const QString &extra); void callbackQueryAnswer(const QString &text, bool alert, const QString &url); + void userPrivacySettingRules(const QVariantMap &rules); + void userPrivacySettingRulesUpdated(const QVariantMap &updatedRules); private: typedef void (TDLibReceiver::*Handler)(const QVariantMap &); @@ -164,6 +166,8 @@ private: void processUpdateChatDraftMessage(const QVariantMap &receivedInformation); void processInlineQueryResults(const QVariantMap &receivedInformation); void processCallbackQueryAnswer(const QVariantMap &receivedInformation); + void processUserPrivacySettingRules(const QVariantMap &receivedInformation); + void processUpdateUserPrivacySettingRules(const QVariantMap &receivedInformation); }; #endif // TDLIBRECEIVER_H diff --git a/src/tdlibwrapper.cpp b/src/tdlibwrapper.cpp index ec03779..15cf157 100644 --- a/src/tdlibwrapper.cpp +++ b/src/tdlibwrapper.cpp @@ -158,6 +158,8 @@ void TDLibWrapper::initializeTDLibReciever() { connect(this->tdLibReceiver, SIGNAL(chatDraftMessageUpdated(qlonglong, QVariantMap, QString)), this, SIGNAL(chatDraftMessageUpdated(qlonglong, QVariantMap, QString))); connect(this->tdLibReceiver, SIGNAL(inlineQueryResults(QString, QString, QVariantList, QString, QString, QString)), this, SIGNAL(inlineQueryResults(QString, QString, QVariantList, QString, QString, QString))); connect(this->tdLibReceiver, SIGNAL(callbackQueryAnswer(QString, bool, QString)), this, SIGNAL(callbackQueryAnswer(QString, bool, QString))); + connect(this->tdLibReceiver, SIGNAL(userPrivacySettingRules(QVariantMap)), this, SLOT(handleUserPrivacySettingRules(QVariantMap))); + connect(this->tdLibReceiver, SIGNAL(userPrivacySettingRulesUpdated(QVariantMap)), this, SLOT(handleUpdatedUserPrivacySettingRules(QVariantMap))); this->tdLibReceiver->start(); } @@ -1205,7 +1207,7 @@ void TDLibWrapper::setUsername(const QString &userName) void TDLibWrapper::setUserPrivacySettingRule(TDLibWrapper::UserPrivacySetting setting, TDLibWrapper::UserPrivacySettingRule rule) { - LOG("Set user privecy setting rule of current user" << setting << rule); + LOG("Set user privacy setting rule of current user" << setting << rule); QVariantMap requestObject; requestObject.insert(_TYPE, "setUserPrivacySettingRules"); @@ -1229,6 +1231,8 @@ void TDLibWrapper::setUserPrivacySettingRule(TDLibWrapper::UserPrivacySetting se case SettingShowLinkInForwardedMessages: settingMap.insert(_TYPE, "userPrivacySettingShowLinkInForwardedMessages"); break; + case SettingUnknown: + return; } requestObject.insert("setting", settingMap); @@ -1244,13 +1248,48 @@ void TDLibWrapper::setUserPrivacySettingRule(TDLibWrapper::UserPrivacySetting se case RuleRestrictAll: ruleMap.insert(_TYPE, "userPrivacySettingRuleRestrictAll"); break; - case RuleRestrictContacts: - ruleMap.insert(_TYPE, "userPrivacySettingRuleRestrictContacts"); - break; } QVariantList ruleMaps; ruleMaps.append(ruleMap); - requestObject.insert("rules", ruleMaps); + QVariantMap encapsulatedRules; + encapsulatedRules.insert(_TYPE, "userPrivacySettingRules"); + encapsulatedRules.insert("rules", ruleMaps); + requestObject.insert("rules", encapsulatedRules); + + this->sendRequest(requestObject); +} + +void TDLibWrapper::getUserPrivacySettingRules(TDLibWrapper::UserPrivacySetting setting) +{ + LOG("Getting user privacy setting rules of current user" << setting); + QVariantMap requestObject; + requestObject.insert(_TYPE, "getUserPrivacySettingRules"); + requestObject.insert(_EXTRA, setting); + + QVariantMap settingMap; + switch (setting) { + case SettingShowStatus: + settingMap.insert(_TYPE, "userPrivacySettingShowStatus"); + break; + case SettingShowPhoneNumber: + settingMap.insert(_TYPE, "userPrivacySettingShowPhoneNumber"); + break; + case SettingAllowChatInvites: + settingMap.insert(_TYPE, "userPrivacySettingAllowChatInvites"); + break; + case SettingShowProfilePhoto: + settingMap.insert(_TYPE, "userPrivacySettingShowProfilePhoto"); + break; + case SettingAllowFindingByPhoneNumber: + settingMap.insert(_TYPE, "userPrivacySettingAllowFindingByPhoneNumber"); + break; + case SettingShowLinkInForwardedMessages: + settingMap.insert(_TYPE, "userPrivacySettingShowLinkInForwardedMessages"); + break; + case SettingUnknown: + return; + } + requestObject.insert("setting", settingMap); this->sendRequest(requestObject); } @@ -1286,6 +1325,11 @@ QVariantMap TDLibWrapper::getUserInformationByName(const QString &userName) return this->allUserNames.value(userName).toMap(); } +TDLibWrapper::UserPrivacySettingRule TDLibWrapper::getUserPrivacySettingRule(TDLibWrapper::UserPrivacySetting userPrivacySetting) +{ + return this->userPrivacySettingRules.value(userPrivacySetting, UserPrivacySettingRule::RuleAllowAll); +} + QVariantMap TDLibWrapper::getUnreadMessageInformation() { return this->unreadMessageInformation; @@ -1670,6 +1714,54 @@ void TDLibWrapper::handleMessageIsPinnedUpdated(qlonglong chatId, qlonglong mess } } +void TDLibWrapper::handleUserPrivacySettingRules(const QVariantMap &rules) +{ + QVariantList newGivenRules = rules.value("rules").toList(); + UserPrivacySettingRule newAppliedRule = UserPrivacySettingRule::RuleAllowAll; + QListIterator givenRulesIterator(newGivenRules); + while (givenRulesIterator.hasNext()) { + QString givenRule = givenRulesIterator.next().toMap().value(_TYPE).toString(); + if (givenRule == "userPrivacySettingRuleAllowContacts") { + newAppliedRule = UserPrivacySettingRule::RuleAllowContacts; + } + if (givenRule == "userPrivacySettingRuleRestrictAll") { + newAppliedRule = UserPrivacySettingRule::RuleRestrictAll; + } + } + UserPrivacySetting usedSetting = static_cast(rules.value(_EXTRA).toInt()); + this->userPrivacySettingRules.insert(usedSetting, newAppliedRule); + emit userPrivacySettingUpdated(usedSetting, newAppliedRule); +} + +void TDLibWrapper::handleUpdatedUserPrivacySettingRules(const QVariantMap &updatedRules) +{ + QString rawSetting = updatedRules.value("setting").toMap().value(_TYPE).toString(); + UserPrivacySetting usedSetting = UserPrivacySetting::SettingUnknown; + if (rawSetting == "userPrivacySettingAllowChatInvites") { + usedSetting = UserPrivacySetting::SettingAllowChatInvites; + } + if (rawSetting == "userPrivacySettingAllowFindingByPhoneNumber") { + usedSetting = UserPrivacySetting::SettingAllowFindingByPhoneNumber; + } + if (rawSetting == "userPrivacySettingShowLinkInForwardedMessages") { + usedSetting = UserPrivacySetting::SettingShowLinkInForwardedMessages; + } + if (rawSetting == "userPrivacySettingShowPhoneNumber") { + usedSetting = UserPrivacySetting::SettingShowPhoneNumber; + } + if (rawSetting == "userPrivacySettingShowProfilePhoto") { + usedSetting = UserPrivacySetting::SettingShowProfilePhoto; + } + if (rawSetting == "userPrivacySettingShowStatus") { + usedSetting = UserPrivacySetting::SettingShowStatus; + } + if (usedSetting != UserPrivacySetting::SettingUnknown) { + QVariantMap rawRules = updatedRules.value("rules").toMap(); + rawRules.insert(_TYPE, usedSetting); + this->handleUserPrivacySettingRules(rawRules); + } +} + void TDLibWrapper::setInitialParameters() { LOG("Sending initial parameters to TD Lib"); diff --git a/src/tdlibwrapper.h b/src/tdlibwrapper.h index 4ba3f5e..662f1db 100644 --- a/src/tdlibwrapper.h +++ b/src/tdlibwrapper.h @@ -95,15 +95,15 @@ public: SettingShowLinkInForwardedMessages, SettingShowPhoneNumber, SettingShowProfilePhoto, - SettingShowStatus + SettingShowStatus, + SettingUnknown }; Q_ENUM(UserPrivacySetting) enum UserPrivacySettingRule { RuleAllowAll, RuleAllowContacts, - RuleRestrictAll, - RuleRestrictContacts + RuleRestrictAll }; Q_ENUM(UserPrivacySettingRule) @@ -124,6 +124,7 @@ public: Q_INVOKABLE QVariantMap getUserInformation(const QString &userId); Q_INVOKABLE bool hasUserInformation(const QString &userId); Q_INVOKABLE QVariantMap getUserInformationByName(const QString &userName); + Q_INVOKABLE UserPrivacySettingRule getUserPrivacySettingRule(UserPrivacySetting userPrivacySetting); Q_INVOKABLE QVariantMap getUnreadMessageInformation(); Q_INVOKABLE QVariantMap getUnreadChatInformation(); Q_INVOKABLE QVariantMap getBasicGroup(qlonglong groupId) const; @@ -217,6 +218,7 @@ public: Q_INVOKABLE void setName(const QString &firstName, const QString &lastName); Q_INVOKABLE void setUsername(const QString &userName); Q_INVOKABLE void setUserPrivacySettingRule(UserPrivacySetting setting, UserPrivacySettingRule rule); + Q_INVOKABLE void getUserPrivacySettingRules(UserPrivacySetting setting); // Others (candidates for extraction ;)) Q_INVOKABLE void searchEmoji(const QString &queryString); @@ -292,6 +294,7 @@ signals: void chatDraftMessageUpdated(qlonglong chatId, const QVariantMap &draftMessage, const QString &order); void inlineQueryResults(const QString &inlineQueryId, const QString &nextOffset, const QVariantList &results, const QString &switchPmText, const QString &switchPmParameter, const QString &extra); void callbackQueryAnswer(const QString &text, bool alert, const QString &url); + void userPrivacySettingUpdated(UserPrivacySetting setting, UserPrivacySettingRule rule); public slots: void handleVersionDetected(const QString &version); @@ -316,6 +319,8 @@ public slots: void handleErrorReceived(int code, const QString &message, const QString &extra); void handleMessageInformation(qlonglong chatId, qlonglong messageId, const QVariantMap &receivedInformation); void handleMessageIsPinnedUpdated(qlonglong chatId, qlonglong messageId, bool isPinned); + void handleUserPrivacySettingRules(const QVariantMap &rules); + void handleUpdatedUserPrivacySettingRules(const QVariantMap &updatedRules); private: void setOption(const QString &name, const QString &type, const QVariant &value); @@ -337,6 +342,7 @@ private: TDLibWrapper::ConnectionState connectionState; QVariantMap options; QVariantMap userInformation; + QMap userPrivacySettingRules; QVariantMap allUsers; QVariantMap allUserNames; QVariantMap chats; diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index a5abc89..13127ed 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -1556,6 +1556,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber-en.ts b/translations/harbour-fernschreiber-en.ts index d0b27a4..606c5bc 100644 --- a/translations/harbour-fernschreiber-en.ts +++ b/translations/harbour-fernschreiber-en.ts @@ -1556,6 +1556,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index c585c0e..4f8cc22 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -1556,6 +1556,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts index 673ed6d..b036792 100644 --- a/translations/harbour-fernschreiber-fi.ts +++ b/translations/harbour-fernschreiber-fi.ts @@ -1557,6 +1557,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index ac46773..a788edc 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -1531,6 +1531,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts index 6af6462..3e99343 100644 --- a/translations/harbour-fernschreiber-it.ts +++ b/translations/harbour-fernschreiber-it.ts @@ -1556,6 +1556,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index dae786c..598e234 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -1581,6 +1581,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 0a3bb18..96e588f 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -1581,6 +1581,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts index d5ee25e..6b52cd1 100644 --- a/translations/harbour-fernschreiber-sv.ts +++ b/translations/harbour-fernschreiber-sv.ts @@ -1556,6 +1556,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index 994ad8a..16e0204 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -1531,6 +1531,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index cff9e86..14ed7f4 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -1556,6 +1556,66 @@ user name of the logged-in profile - header + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker