From 8a53eabf9bc174254641f79a465078b428128626 Mon Sep 17 00:00:00 2001 From: Ohad G Date: Fri, 18 Dec 2020 04:54:32 +0200 Subject: [PATCH 1/2] Added .NET Standard 2.1 project files --- src/TgSharp.Core/TgSharp.CoreCore.csproj | 35 ++++++++++++++++++++++++ src/TgSharp.TL/TgSharp.TLCore.csproj | 32 ++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 src/TgSharp.Core/TgSharp.CoreCore.csproj create mode 100644 src/TgSharp.TL/TgSharp.TLCore.csproj diff --git a/src/TgSharp.Core/TgSharp.CoreCore.csproj b/src/TgSharp.Core/TgSharp.CoreCore.csproj new file mode 100644 index 00000000..a33360ce --- /dev/null +++ b/src/TgSharp.Core/TgSharp.CoreCore.csproj @@ -0,0 +1,35 @@ + + + + netstandard2.1 + 8.0 + Ilya P, RandallFlagg + aarani, knocte + true + Telegram client library implemented in C# (.NET Standard 2.1) + Unofficial Telegram (http://telegram.org) client library implemented in C#. + It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + 0.1.0.0 + 0.1.0.0 + 0.1.0.0 + https://github.com/nblockchain/TgSharp/ + + Telegram + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TgSharp.TL/TgSharp.TLCore.csproj b/src/TgSharp.TL/TgSharp.TLCore.csproj new file mode 100644 index 00000000..8de2d995 --- /dev/null +++ b/src/TgSharp.TL/TgSharp.TLCore.csproj @@ -0,0 +1,32 @@ + + + + netstandard2.1 + 8.0 + Ilya P, RandallFlagg + aarani, knocte + true + Telegram client library implemented in C# (.NET Standard 2.1) + Unofficial Telegram (http://telegram.org) client library implemented in C#. + It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + 0.1.0.0 + 0.1.0.0 + 0.1.0.0 + https://github.com/nblockchain/TgSharp/ + + Telegram + + + + + + + + + + + + + + + \ No newline at end of file From 933d231657a33a3f30aa0a062b20d40bb7302e75 Mon Sep 17 00:00:00 2001 From: Ohad G Date: Fri, 18 Dec 2020 04:55:16 +0200 Subject: [PATCH 2/2] Fixed tabs and spaces --- src/TgSharp.Core/FileSessionStore.cs | 2 +- src/TgSharp.Core/Network/MtProtoSender.cs | 15 +++++++++------ src/TgSharp.Core/TgSharp.Core.nuspec | 11 ++++++----- src/TgSharp.Core/TgSharp.CoreCore.csproj | 5 +++-- src/TgSharp.TL/TgSharp.TLCore.csproj | 5 +++-- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/TgSharp.Core/FileSessionStore.cs b/src/TgSharp.Core/FileSessionStore.cs index 071656df..4e2e847b 100644 --- a/src/TgSharp.Core/FileSessionStore.cs +++ b/src/TgSharp.Core/FileSessionStore.cs @@ -1,9 +1,9 @@ using System; using System.IO; -using TgSharp.TL; using TgSharp.Core.MTProto; using TgSharp.Core.MTProto.Crypto; +using TgSharp.TL; namespace TgSharp.Core { diff --git a/src/TgSharp.Core/Network/MtProtoSender.cs b/src/TgSharp.Core/Network/MtProtoSender.cs index 932bde62..2aa5d729 100644 --- a/src/TgSharp.Core/Network/MtProtoSender.cs +++ b/src/TgSharp.Core/Network/MtProtoSender.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.IO.Compression; using System.Linq; @@ -8,13 +7,13 @@ using System.Threading; using System.Threading.Tasks; -using TgSharp.TL; using TgSharp.Core.Exceptions; using TgSharp.Core.MTProto; using TgSharp.Core.MTProto.Crypto; using TgSharp.Core.Network.Exceptions; using TgSharp.Core.Network.Requests; using TgSharp.Core.Utils; +using TgSharp.TL; namespace TgSharp.Core.Network { @@ -37,10 +36,14 @@ public MtProtoSender(TcpTransport transport, ISessionStore sessionStore, Session private int GenerateSequence(bool confirmed) { - lock (session.Lock) { - try { + lock (session.Lock) + { + try + { return confirmed ? session.Sequence++ * 2 + 1 : session.Sequence * 2; - } finally { + } + finally + { sessionStore.Save(session); } } @@ -71,7 +74,7 @@ private int GenerateSequence(bool confirmed) await Send(memory.ToArray(), request, token).ConfigureAwait(false); } - sessionStore.Save (session); + sessionStore.Save(session); } public async Task Send(byte[] packet, TLMethod request, CancellationToken token = default(CancellationToken)) diff --git a/src/TgSharp.Core/TgSharp.Core.nuspec b/src/TgSharp.Core/TgSharp.Core.nuspec index 61166662..448a6285 100644 --- a/src/TgSharp.Core/TgSharp.Core.nuspec +++ b/src/TgSharp.Core/TgSharp.Core.nuspec @@ -4,13 +4,14 @@ TgSharp 0.1 Telegram client library implemented in C# - Ilya P - aarani, knocte + Ilya P + aarani, knocte https://github.com/nblockchain/TgSharp/ false - Unofficial Telegram (http://telegram.org) client library implemented in C#. - -It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + + Unofficial Telegram (http://telegram.org) client library implemented in C#. + It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + telegram client, telegram API Copyright 2015-2020 diff --git a/src/TgSharp.Core/TgSharp.CoreCore.csproj b/src/TgSharp.Core/TgSharp.CoreCore.csproj index a33360ce..ce429b22 100644 --- a/src/TgSharp.Core/TgSharp.CoreCore.csproj +++ b/src/TgSharp.Core/TgSharp.CoreCore.csproj @@ -8,7 +8,8 @@ true Telegram client library implemented in C# (.NET Standard 2.1) Unofficial Telegram (http://telegram.org) client library implemented in C#. - It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + 0.1.0.0 0.1.0.0 0.1.0.0 @@ -32,4 +33,4 @@ - \ No newline at end of file + diff --git a/src/TgSharp.TL/TgSharp.TLCore.csproj b/src/TgSharp.TL/TgSharp.TLCore.csproj index 8de2d995..655dddf7 100644 --- a/src/TgSharp.TL/TgSharp.TLCore.csproj +++ b/src/TgSharp.TL/TgSharp.TLCore.csproj @@ -8,7 +8,8 @@ true Telegram client library implemented in C# (.NET Standard 2.1) Unofficial Telegram (http://telegram.org) client library implemented in C#. - It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + 0.1.0.0 0.1.0.0 0.1.0.0 @@ -29,4 +30,4 @@ - \ No newline at end of file +