From fccd0c39eb36fe36ef1263c26dd9081da75e5eea Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 24 Oct 2018 20:23:47 +0300 Subject: [PATCH] Make Client.Execute static in C# binding. GitOrigin-RevId: d31bf0d0e6fcf2a762d209f6d62127bd6eaa09e7 --- example/csharp/TdExample.cs | 2 +- td/telegram/ClientDotNet.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/csharp/TdExample.cs b/example/csharp/TdExample.cs index c28932ec5..49f862bc9 100644 --- a/example/csharp/TdExample.cs +++ b/example/csharp/TdExample.cs @@ -216,7 +216,7 @@ namespace TdExample _client = CreateTdClient(); // test Client.Execute - _defaultHandler.OnResult(_client.Execute(new TdApi.GetTextEntities("@telegram /test_command https://telegram.org telegram.me @gif @test"))); + _defaultHandler.OnResult(Td.Client.Execute(new TdApi.GetTextEntities("@telegram /test_command https://telegram.org telegram.me @gif @test"))); // main loop while (!_quiting) diff --git a/td/telegram/ClientDotNet.cpp b/td/telegram/ClientDotNet.cpp index 62ab095b0..fb0b95edd 100644 --- a/td/telegram/ClientDotNet.cpp +++ b/td/telegram/ClientDotNet.cpp @@ -61,7 +61,7 @@ public: /// Object representing a query to the TDLib. /// Returns request result. /// Thrown when query is null. - Api::BaseObject^ Execute(Api::Function^ function) { + static Api::BaseObject^ Execute(Api::Function^ function) { if (function == nullptr) { throw REF_NEW NullReferenceException("Function can't be null"); } @@ -69,7 +69,7 @@ public: td::Client::Request request; request.id = 0; request.function = td::td_api::move_object_as(ToUnmanaged(function)->get_object_ptr()); - return Api::FromUnmanaged(*client->execute(std::move(request)).object); + return Api::FromUnmanaged(*td::Client::execute(std::move(request)).object); } ///