Merge remote-tracking branch 'td/master'
This commit is contained in:
commit
c01c7a53e9
@ -17552,11 +17552,6 @@ void MessagesManager::get_messages_from_server(vector<FullMessageId> &&message_i
|
||||
lock.set_value(Unit());
|
||||
}
|
||||
|
||||
bool MessagesManager::is_dialog_opened(DialogId dialog_id) const {
|
||||
const Dialog *d = get_dialog(dialog_id);
|
||||
return d != nullptr && d->is_opened;
|
||||
}
|
||||
|
||||
bool MessagesManager::is_message_edited_recently(FullMessageId full_message_id, int32 seconds) {
|
||||
if (seconds < 0) {
|
||||
return false;
|
||||
|
@ -583,8 +583,6 @@ class MessagesManager final : public Actor {
|
||||
|
||||
void get_message_viewers(FullMessageId full_message_id, Promise<td_api::object_ptr<td_api::users>> &&promise);
|
||||
|
||||
bool is_dialog_opened(DialogId dialog_id) const;
|
||||
|
||||
bool is_message_edited_recently(FullMessageId full_message_id, int32 seconds);
|
||||
|
||||
bool is_deleted_secret_chat(DialogId dialog_id) const;
|
||||
|
@ -4319,9 +4319,6 @@ void StickersManager::schedule_update_animated_emoji_clicked(const StickerSet *s
|
||||
if (!td_->messages_manager_->have_input_peer(dialog_id, AccessRights::Write)) {
|
||||
return;
|
||||
}
|
||||
if (!td_->messages_manager_->is_dialog_opened(dialog_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto all_sticker_ids = get_animated_emoji_stickers(sticker_set, emoji);
|
||||
std::unordered_map<int, FileId> sticker_ids;
|
||||
@ -4368,9 +4365,6 @@ void StickersManager::send_update_animated_emoji_clicked(FullMessageId full_mess
|
||||
if (!td_->messages_manager_->have_input_peer(dialog_id, AccessRights::Write)) {
|
||||
return;
|
||||
}
|
||||
if (!td_->messages_manager_->is_dialog_opened(dialog_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
td_api::make_object<td_api::updateAnimatedEmojiMessageClicked>(
|
||||
|
@ -124,14 +124,22 @@ class RichText {
|
||||
context->has_anchor_urls_ = true;
|
||||
} else {
|
||||
auto anchor = Slice(content).substr(context->base_url_.size() + 1);
|
||||
auto it = context->anchors_.find(anchor);
|
||||
if (it != context->anchors_.end()) {
|
||||
if (it->second == nullptr) {
|
||||
return make_tl_object<td_api::richTextAnchorLink>(texts[0].get_rich_text_object(context), anchor.str(),
|
||||
content);
|
||||
} else {
|
||||
return make_tl_object<td_api::richTextReference>(texts[0].get_rich_text_object(context), anchor.str(),
|
||||
content);
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#the-indicated-part-of-the-document
|
||||
for (int i = 0; i < 2; i++) {
|
||||
string url_decoded_anchor;
|
||||
if (i == 1) { // try to url_decode anchor
|
||||
url_decoded_anchor = url_decode(anchor, false);
|
||||
anchor = url_decoded_anchor;
|
||||
}
|
||||
auto it = context->anchors_.find(anchor);
|
||||
if (it != context->anchors_.end()) {
|
||||
if (it->second == nullptr) {
|
||||
return make_tl_object<td_api::richTextAnchorLink>(texts[0].get_rich_text_object(context),
|
||||
anchor.str(), content);
|
||||
} else {
|
||||
return make_tl_object<td_api::richTextReference>(texts[0].get_rich_text_object(context), anchor.str(),
|
||||
content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user