Allow fully editing todo lists.

This commit is contained in:
John Preston
2025-06-12 18:41:01 +04:00
parent d83a80ec53
commit 9290c90bdc
17 changed files with 204 additions and 42 deletions
+18 -2
View File
@@ -7,8 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "api/api_todo_lists.h"
//#include "api/api_common.h"
//#include "api/api_updates.h"
#include "api/api_editing.h"
#include "apiwrap.h"
#include "base/random.h"
#include "data/business/data_shortcut_messages.h" // ShortcutIdToMTP
@@ -134,6 +133,23 @@ void TodoLists::create(
});
}
void TodoLists::edit(
not_null<HistoryItem*> item,
const TodoListData &data,
SendOptions options,
Fn<void()> done,
Fn<void(QString)> fail) {
EditTodoList(item, data, options, [=](mtpRequestId) {
if (const auto onstack = done) {
onstack();
}
}, [=](const QString &error, mtpRequestId) {
if (const auto onstack = fail) {
onstack(error);
}
});
}
void TodoLists::add(
not_null<HistoryItem*> item,
const std::vector<TodoListItem> &items,