aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/StoryDb.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2023-08-10 20:22:12 +0300
committerlevlam <levlam@telegram.org>2023-08-10 20:22:12 +0300
commitb12ade01f67455d1cc1a38973d95db67da397783 (patch)
tree1e2d3c6d782ca1e89daded4d3edaf83bef749158 /td/telegram/StoryDb.cpp
parent7d06883668491d9cf6c0c07522eec3aa6fa5ac5a (diff)
Add more checks for server StoryId.
Diffstat (limited to 'td/telegram/StoryDb.cpp')
-rw-r--r--td/telegram/StoryDb.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/td/telegram/StoryDb.cpp b/td/telegram/StoryDb.cpp
index 4040388b2..5d878f24a 100644
--- a/td/telegram/StoryDb.cpp
+++ b/td/telegram/StoryDb.cpp
@@ -127,10 +127,9 @@ class StoryDbImpl final : public StoryDbSyncInterface {
void add_story(StoryFullId story_full_id, int32 expires_at, NotificationId notification_id, BufferSlice data) final {
LOG(INFO) << "Add " << story_full_id << " to database";
+ CHECK(story_full_id.is_server());
auto dialog_id = story_full_id.get_dialog_id();
auto story_id = story_full_id.get_story_id();
- LOG_CHECK(dialog_id.is_valid()) << dialog_id << ' ' << story_id << ' ' << story_full_id;
- CHECK(story_id.is_valid());
SCOPE_EXIT {
add_story_stmt_.reset();
};
@@ -154,10 +153,9 @@ class StoryDbImpl final : public StoryDbSyncInterface {
void delete_story(StoryFullId story_full_id) final {
LOG(INFO) << "Delete " << story_full_id << " from database";
+ CHECK(story_full_id.is_valid());
auto dialog_id = story_full_id.get_dialog_id();
auto story_id = story_full_id.get_story_id();
- CHECK(dialog_id.is_valid());
- CHECK(story_id.is_valid());
SCOPE_EXIT {
delete_story_stmt_.reset();
};
@@ -167,10 +165,9 @@ class StoryDbImpl final : public StoryDbSyncInterface {
}
Result<BufferSlice> get_story(StoryFullId story_full_id) final {
+ CHECK(story_full_id.is_server());
auto dialog_id = story_full_id.get_dialog_id();
auto story_id = story_full_id.get_story_id();
- CHECK(dialog_id.is_valid());
- CHECK(story_id.is_valid());
SCOPE_EXIT {
get_story_stmt_.reset();
};