Compare commits

..

3 commits

Author SHA1 Message Date
Sebastian Wolf
40ec4b0968 Fix chat permissions handling 2023-11-19 16:16:46 +03:00
Slava Monich
c4c9dc83c0 Tweaked notification feedback settings UI (#526) 2023-11-19 16:16:36 +03:00
9a37db94ae Update tdlib headers 2023-11-19 16:11:29 +03:00
22 changed files with 17495 additions and 2053 deletions

View file

@ -81,7 +81,6 @@ AccordionItem {
}
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.useOpenWith
@ -93,6 +92,17 @@ AccordionItem {
}
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.notificationAlwaysShowPreview
text: qsTr("Always append message preview to notifications")
description: qsTr("In addition to showing the number of unread messages, the latest message will also be appended to notifications.")
automaticCheck: false
onClicked: {
appSettings.notificationAlwaysShowPreview = !checked
}
}
ComboBox {
id: feedbackComboBox
width: parent.columnWidth
@ -147,59 +157,52 @@ AccordionItem {
}
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.notificationSuppressContent && enabled
text: qsTr("Hide content in Notifications")
enabled: appSettings.notificationFeedback !== AppSettings.NotificationFeedbackNone
clip: height < implicitHeight
visible: height > 0
automaticCheck: false
onClicked: {
appSettings.notificationSuppressContent = !checked
}
Behavior on height { SmoothedAnimation { duration: 200 } }
Item {
// Occupies one grid cell so that the column ends up under the combo box
// in the landscape layout
visible: parent.columns === 2
width: 1
height: 1
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.notificationTurnsDisplayOn && enabled
text: qsTr("Notification turns on the display")
Column {
enabled: appSettings.notificationFeedback !== AppSettings.NotificationFeedbackNone
width: parent.columnWidth
height: enabled ? implicitHeight: 0
clip: height < implicitHeight
visible: height > 0
automaticCheck: false
onClicked: {
appSettings.notificationTurnsDisplayOn = !checked
}
Behavior on height { SmoothedAnimation { duration: 200 } }
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.notificationSoundsEnabled && enabled
text: qsTr("Enable notification sounds")
description: qsTr("When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings.")
enabled: appSettings.notificationFeedback !== AppSettings.NotificationFeedbackNone
height: enabled ? implicitHeight: 0
clip: height < implicitHeight
visible: height > 0
automaticCheck: false
onClicked: {
appSettings.notificationSoundsEnabled = !checked
}
Behavior on height { SmoothedAnimation { duration: 200 } }
}
TextSwitch {
width: parent.columnWidth
checked: appSettings.notificationAlwaysShowPreview
text: qsTr("Always append message preview to notifications")
description: qsTr("In addition to showing the number of unread messages, the latest message will also be appended to notifications.")
automaticCheck: false
onClicked: {
appSettings.notificationAlwaysShowPreview = !checked
TextSwitch {
checked: appSettings.notificationSuppressContent && enabled
text: qsTr("Hide content in notifications")
enabled: parent.enabled
automaticCheck: false
onClicked: {
appSettings.notificationSuppressContent = !checked
}
}
TextSwitch {
checked: appSettings.notificationTurnsDisplayOn && enabled
text: qsTr("Notification turns on the display")
enabled: parent.enabled
automaticCheck: false
onClicked: {
appSettings.notificationTurnsDisplayOn = !checked
}
}
TextSwitch {
checked: appSettings.notificationSoundsEnabled && enabled
text: qsTr("Enable notification sounds")
description: qsTr("When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings.")
enabled: parent.enabled
automaticCheck: false
onClicked: {
appSettings.notificationSoundsEnabled = !checked
}
}
}
}

View file

@ -63,7 +63,7 @@ Page {
)
property var selectedMessages: []
readonly property bool isSelecting: selectedMessages.length > 0
readonly property bool canSendMessages: hasSendPrivilege("can_send_messages")
readonly property bool canSendMessages: hasSendPrivilege("can_send_basic_messages")
property bool doSendBotStartMessage
property string sendBotStartMessageParameter
property var availableReactions
@ -1599,7 +1599,7 @@ Page {
IconButton {
id: attachImageIconButton
visible: chatPage.hasSendPrivilege("can_send_media_messages")
visible: chatPage.hasSendPrivilege("can_send_photos")
icon.source: "image://theme/icon-m-image"
onClicked: {
var picker = pageStack.push("Sailfish.Pickers.ImagePickerPage", {
@ -1615,7 +1615,7 @@ Page {
}
}
IconButton {
visible: chatPage.hasSendPrivilege("can_send_media_messages")
visible: chatPage.hasSendPrivilege("can_send_videos")
icon.source: "image://theme/icon-m-video"
onClicked: {
var picker = pageStack.push("Sailfish.Pickers.VideoPickerPage", {
@ -1631,7 +1631,7 @@ Page {
}
}
IconButton {
visible: chatPage.hasSendPrivilege("can_send_media_messages")
visible: chatPage.hasSendPrivilege("can_send_voice_notes")
icon.source: "image://theme/icon-m-mic"
icon.sourceSize {
width: Theme.iconSizeMedium
@ -1644,7 +1644,7 @@ Page {
}
}
IconButton {
visible: chatPage.hasSendPrivilege("can_send_media_messages")
visible: chatPage.hasSendPrivilege("can_send_documents")
icon.source: "image://theme/icon-m-document"
onClicked: {
var picker = pageStack.push("Sailfish.Pickers.FilePickerPage", {

View file

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -23,7 +23,7 @@ namespace td {
* Requests can be sent using the method ClientManager::send from any thread.
* New updates and responses to requests can be received using the method ClientManager::receive from any thread after
* the first request has been sent to the client instance. ClientManager::receive must not be called simultaneously from
* two different threads. Also note that all updates and responses to requests should be applied in the same order as
* two different threads. Also, note that all updates and responses to requests should be applied in the same order as
* they were received, to ensure consistency.
* Some TDLib requests can be executed synchronously from any thread using the method ClientManager::execute.
*
@ -96,7 +96,7 @@ class ClientManager final {
ClientId client_id;
/**
* Request identifier, to which the response corresponds, or 0 for incoming updates from TDLib.
* Request identifier to which the response corresponds, or 0 for incoming updates from TDLib.
*/
RequestId request_id;
@ -126,10 +126,10 @@ class ClientManager final {
/**
* A type of callback function that will be called when a message is added to the internal TDLib log.
*
* \param verbosity_level Log verbosity level with which the message was added (-1 - 1024).
* \param verbosity_level Log verbosity level with which the message was added from -1 up to 1024.
* If 0, then TDLib will crash as soon as the callback returns.
* None of the TDLib methods can be called from the callback.
* \param message Null-terminated string with the message added to the log.
* \param message Null-terminated UTF-8-encoded string with the message added to the log.
*/
using LogMessageCallbackPtr = void (*)(int verbosity_level, const char *message);
@ -177,7 +177,7 @@ class ClientManager final {
* The TDLib instance is created for the lifetime of the Client object.
* Requests to TDLib can be sent using the Client::send method from any thread.
* New updates and responses to requests can be received using the Client::receive method from any thread,
* this function must not be called simultaneously from two different threads. Also note that all updates and
* this function must not be called simultaneously from two different threads. Also, note that all updates and
* responses to requests should be applied in the same order as they were received, to ensure consistency.
* Given this information, it's advisable to call this function from a dedicated thread.
* Some service TDLib requests can be executed synchronously from any thread using the Client::execute method.
@ -199,7 +199,7 @@ class ClientManager final {
* if (response.id == 0) {
* // process response.object as an incoming update of type td_api::Update
* } else {
* // process response.object as an answer to a sent request with id response.id
* // process response.object as an answer to a sent request with identifier response.id
* }
* }
* \endcode

View file

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -28,7 +28,7 @@
* Requests can be sent using td_send and the received client identifier.
* New updates and responses to requests can be received through td_receive from any thread after the first request
* has been sent to the client instance. This function must not be called simultaneously from two different threads.
* Also note that all updates and responses to requests must be applied in the order they were received for consistency.
* Also, note that all updates and responses to requests must be applied in the order they were received for consistency.
* Some TDLib requests can be executed synchronously from any thread using td_execute.
* TDLib client instances are destroyed automatically after they are closed.
* All TDLib client instances must be closed before application termination to ensure data consistency.
@ -88,10 +88,10 @@ TDJSON_EXPORT const char *td_execute(const char *request);
/**
* A type of callback function that will be called when a message is added to the internal TDLib log.
*
* \param verbosity_level Log verbosity level with which the message was added (-1 - 1024).
* \param verbosity_level Log verbosity level with which the message was added from -1 up to 1024.
* If 0, then TDLib will crash as soon as the callback returns.
* None of the TDLib methods can be called from the callback.
* \param message Null-terminated string with the logged message.
* \param message Null-terminated UTF-8-encoded string with the message added to the log.
*/
typedef void (*td_log_message_callback_ptr)(int verbosity_level, const char *message);
@ -118,7 +118,7 @@ TDJSON_EXPORT void td_set_log_message_callback(int max_verbosity_level, td_log_m
* A TDLib client instance can be created through td_json_client_create.
* Requests then can be sent using td_json_client_send from any thread.
* New updates and request responses can be received through td_json_client_receive from any thread. This function
* must not be called simultaneously from two different threads. Also note that all updates and request responses
* must not be called simultaneously from two different threads. Also, note that all updates and request responses
* must be applied in the order they were received to ensure consistency.
* Given this information, it's advisable to call this function from a dedicated thread.
* Some service TDLib requests can be executed synchronously from any thread by using td_json_client_execute.

View file

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View file

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -97,8 +97,8 @@ class unique_ptr {
using element_type = T;
unique_ptr() noexcept = default;
unique_ptr(const unique_ptr &other) = delete;
unique_ptr &operator=(const unique_ptr &other) = delete;
unique_ptr(const unique_ptr &) = delete;
unique_ptr &operator=(const unique_ptr &) = delete;
unique_ptr(unique_ptr &&other) noexcept : ptr_(other.release()) {
}
unique_ptr &operator=(unique_ptr &&other) noexcept {
@ -187,11 +187,11 @@ using tl_object_ptr = tl::unique_ptr<Type>;
* A function to create a dynamically allocated TL-object. Can be treated as an analogue of std::make_unique.
* Usage example:
* \code
* auto get_authorization_state_request = td::make_tl_object<td::td_api::getAuthorizationState>();
* auto get_me_request = td::make_tl_object<td::td_api::getMe>();
* auto message_text = td::make_tl_object<td::td_api::formattedText>("Hello, world!!!",
* td::td_api::array<td::tl_object_ptr<td::td_api::textEntity>>());
* auto send_message_request = td::make_tl_object<td::td_api::sendMessage>(chat_id, 0, 0, nullptr, nullptr,
* td::make_tl_object<td::td_api::inputMessageText>(std::move(message_text), false, true));
* auto send_message_request = td::make_tl_object<td::td_api::sendMessage>(chat_id, 0, nullptr, nullptr, nullptr,
* td::make_tl_object<td::td_api::inputMessageText>(std::move(message_text), nullptr, true));
* \endcode
*
* \tparam Type Type of the TL-object to construct.

View file

@ -1592,7 +1592,7 @@
<translation>Unterhaltungen mit ungelesenen Nachrichten hervorheben</translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation>Inhalte in Hinweisen verbergen</translation>
</message>
</context>

View file

@ -1594,7 +1594,7 @@ messages</numerusform>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1592,7 +1592,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1593,7 +1593,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1592,7 +1592,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1565,7 +1565,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1592,7 +1592,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1619,7 +1619,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1622,7 +1622,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1619,7 +1619,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1592,7 +1592,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1566,7 +1566,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -1592,7 +1592,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide content in Notifications</source>
<source>Hide content in notifications</source>
<translation type="unfinished"></translation>
</message>
</context>