1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Add send_mode param to tonlib_api msg.message (send_mode=-1 - use default)

This commit is contained in:
tolya-yanot 2021-08-02 23:59:42 +03:00 committed by main
parent 72cf905fd1
commit c1a733c0f0
6 changed files with 10 additions and 3 deletions

View file

@ -2559,6 +2559,7 @@ class GenericCreateSendGrams : public TonlibQueryActor {
struct Action {
block::StdAddress destination;
td::int64 amount;
td::int32 send_mode{-1};
bool is_encrypted{false};
bool should_encrypt;
@ -2610,6 +2611,7 @@ class GenericCreateSendGrams : public TonlibQueryActor {
auto key = td::Ed25519::PublicKey(td::SecureString(public_key.key));
res.o_public_key = std::move(key);
}
res.send_mode = message.send_mode_;
auto status = downcast_call2<td::Status>(
*message.data_, td::overloaded(
[&](tonlib_api::msg_dataRaw& text) {
@ -3045,6 +3047,7 @@ class GenericCreateSendGrams : public TonlibQueryActor {
auto& destination = destinations_[i];
gift.destination = destinations_[i]->get_address();
gift.gramms = action.amount;
gift.send_mode = action.send_mode;
// Temporary turn off this dangerous transfer
if (false && action.amount == source_->get_balance()) {

View file

@ -1096,7 +1096,7 @@ class TonlibCli : public td::actor::Actor {
std::vector<tonlib_api::object_ptr<tonlib_api::msg_message>> messages;
messages.push_back(
make_object<tonlib_api::msg_message>(channels_[pchan_id].to_address(), "", value,
make_object<tonlib_api::msg_dataRaw>(query->body_, query->init_state_)));
make_object<tonlib_api::msg_dataRaw>(query->body_, query->init_state_), -1));
auto action = make_object<tonlib_api::actionMsg>(std::move(messages), true);
send_query(
make_object<tonlib_api::createQuery>(addr.input_key(), std::move(addr.address), 60, std::move(action), nullptr),
@ -2217,7 +2217,7 @@ class TonlibCli : public td::actor::Actor {
data = make_object<tonlib_api::msg_dataText>(message.str());
}
messages.push_back(
make_object<tonlib_api::msg_message>(std::move(address.address), "", amount.nano, std::move(data)));
make_object<tonlib_api::msg_message>(std::move(address.address), "", amount.nano, std::move(data), -1));
return td::Status::OK();
};