Use transaction in get_message_notification_group_force.

GitOrigin-RevId: 7573d95313559ce10acce1e701a83fcb26d558df
This commit is contained in:
levlam 2019-08-08 18:31:46 +03:00
parent 87e6f6cc59
commit f7bbcab502
2 changed files with 3 additions and 1 deletions

View File

@ -3100,7 +3100,7 @@ sendInlineQueryResultMessage chat_id:int53 reply_to_message_id:int53 disable_not
//@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message
//@chat_id Identifier of the chat to which to forward messages @from_chat_id Identifier of the chat from which to forward messages @message_ids Identifiers of the messages to forward //@chat_id Identifier of the chat to which to forward messages @from_chat_id Identifier of the chat from which to forward messages @message_ids Identifiers of the messages to forward
//@disable_notification Pass true to disable notification for the message, doesn't work if messages are forwarded to a secret chat @from_background Pass true if the message is sent from the background //@disable_notification Pass true to disable notification for the message, doesn't work if messages are forwarded to a secret chat @from_background Pass true if the messages are sent from the background
//@as_album True, if the messages should be grouped into an album after forwarding. For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages //@as_album True, if the messages should be grouped into an album after forwarding. For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages
forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector<int53> disable_notification:Bool from_background:Bool as_album:Bool = Messages; forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector<int53> disable_notification:Bool from_background:Bool as_album:Bool = Messages;

View File

@ -19007,6 +19007,7 @@ MessagesManager::MessageNotificationGroup MessagesManager::get_message_notificat
d = get_dialog(it->second); d = get_dialog(it->second);
CHECK(d != nullptr); CHECK(d != nullptr);
} else if (G()->parameters().use_message_db) { } else if (G()->parameters().use_message_db) {
G()->td_db()->get_dialog_db_sync()->begin_transaction().ensure();
auto r_value = G()->td_db()->get_dialog_db_sync()->get_notification_group(group_id); auto r_value = G()->td_db()->get_dialog_db_sync()->get_notification_group(group_id);
if (r_value.is_ok()) { if (r_value.is_ok()) {
VLOG(notifications) << "Loaded " << r_value.ok() << " from database by " << group_id; VLOG(notifications) << "Loaded " << r_value.ok() << " from database by " << group_id;
@ -19014,6 +19015,7 @@ MessagesManager::MessageNotificationGroup MessagesManager::get_message_notificat
} else { } else {
VLOG(notifications) << "Failed to load " << group_id << " from database"; VLOG(notifications) << "Failed to load " << group_id << " from database";
} }
G()->td_db()->get_dialog_db_sync()->commit_transaction().ensure();
} }
if (d == nullptr) { if (d == nullptr) {