Show changelog stories in story lists.
This commit is contained in:
parent
a52bdbf79c
commit
40d11e7935
@ -1476,14 +1476,13 @@ td_api::object_ptr<td_api::story> StoryManager::get_story_object(StoryFullId sto
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto story_id = story_full_id.get_story_id();
|
auto story_id = story_full_id.get_story_id();
|
||||||
auto changelog_user_id = td_->option_manager_->get_option_integer(
|
auto changelog_dialog_id = get_changelog_story_dialog_id();
|
||||||
"stories_changelog_user_id", ContactsManager::get_service_notifications_user_id().get());
|
bool is_visible_only_for_self =
|
||||||
bool is_visible_only_for_self = !story_id.is_server() || dialog_id == DialogId(changelog_user_id) ||
|
!story_id.is_server() || dialog_id == changelog_dialog_id || (!story->is_pinned_ && !is_active_story(story));
|
||||||
(!story->is_pinned_ && !is_active_story(story));
|
|
||||||
bool can_be_forwarded = !story->noforwards_ && story_id.is_server() && privacy_rules != nullptr &&
|
bool can_be_forwarded = !story->noforwards_ && story_id.is_server() && privacy_rules != nullptr &&
|
||||||
privacy_rules->rules_.size() == 1u &&
|
privacy_rules->rules_.size() == 1u &&
|
||||||
privacy_rules->rules_[0]->get_id() == td_api::userPrivacySettingRuleAllowAll::ID;
|
privacy_rules->rules_[0]->get_id() == td_api::userPrivacySettingRuleAllowAll::ID;
|
||||||
bool can_be_replied = story_id.is_server() && dialog_id != DialogId(changelog_user_id);
|
bool can_be_replied = story_id.is_server() && dialog_id != changelog_dialog_id;
|
||||||
|
|
||||||
story->is_update_sent_ = true;
|
story->is_update_sent_ = true;
|
||||||
|
|
||||||
@ -1995,7 +1994,15 @@ bool StoryManager::on_update_read_stories(DialogId owner_dialog_id, StoryId max_
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DialogId StoryManager::get_changelog_story_dialog_id() const {
|
||||||
|
return DialogId(UserId(td_->option_manager_->get_option_integer(
|
||||||
|
"stories_changelog_user_id", ContactsManager::get_service_notifications_user_id().get())));
|
||||||
|
}
|
||||||
|
|
||||||
bool StoryManager::is_subscribed_to_dialog_stories(DialogId owner_dialog_id) const {
|
bool StoryManager::is_subscribed_to_dialog_stories(DialogId owner_dialog_id) const {
|
||||||
|
if (owner_dialog_id == get_changelog_story_dialog_id()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
switch (owner_dialog_id.get_type()) {
|
switch (owner_dialog_id.get_type()) {
|
||||||
case DialogType::User:
|
case DialogType::User:
|
||||||
return td_->contacts_manager_->is_user_contact(owner_dialog_id.get_user_id());
|
return td_->contacts_manager_->is_user_contact(owner_dialog_id.get_user_id());
|
||||||
|
@ -226,6 +226,8 @@ class StoryManager final : public Actor {
|
|||||||
|
|
||||||
static bool is_active_story(const Story *story);
|
static bool is_active_story(const Story *story);
|
||||||
|
|
||||||
|
DialogId get_changelog_story_dialog_id() const;
|
||||||
|
|
||||||
bool is_subscribed_to_dialog_stories(DialogId owner_dialog_id) const;
|
bool is_subscribed_to_dialog_stories(DialogId owner_dialog_id) const;
|
||||||
|
|
||||||
const Story *get_story(StoryFullId story_full_id) const;
|
const Story *get_story(StoryFullId story_full_id) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user