mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
Make line endings consistent (LF)
This commit is contained in:
parent
8026bd79dc
commit
7c8d5e089e
|
|
@ -23,6 +23,8 @@ namespace TLSharp.Core
|
|||
private Session _session;
|
||||
private List<DcOption> dcOptions;
|
||||
|
||||
public enum sms_type { numeric_code_via_sms = 0, numeric_code_via_telegram = 5 }
|
||||
|
||||
public TelegramClient(ISessionStore store, string sessionUserId, int apiId, string apiHash)
|
||||
{
|
||||
_apiHash = apiHash;
|
||||
|
|
@ -92,7 +94,7 @@ namespace TLSharp.Core
|
|||
return authCheckPhoneRequest._phoneRegistered;
|
||||
}
|
||||
|
||||
public async Task<string> SendCodeRequest(string phoneNumber)
|
||||
public async Task<string> SendCodeRequest(string phoneNumber, sms_type tokenDestination = sms_type.numeric_code_via_telegram)
|
||||
{
|
||||
var completed = false;
|
||||
|
||||
|
|
@ -100,7 +102,7 @@ namespace TLSharp.Core
|
|||
|
||||
while (!completed)
|
||||
{
|
||||
request = new AuthSendCodeRequest(phoneNumber, 5, _apiId, _apiHash, "en");
|
||||
request = new AuthSendCodeRequest(phoneNumber, (int)tokenDestination, _apiId, _apiHash, "en");
|
||||
try
|
||||
{
|
||||
|
||||
|
|
@ -239,8 +241,8 @@ namespace TLSharp.Core
|
|||
await _sender.Recieve(request);
|
||||
|
||||
return request.messages;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<Tuple<storage_FileType, byte[]>> GetFile(long volume_id, int local_id, long secret, int offset, int limit)
|
||||
{
|
||||
var request = new GetFileRequest(new InputFileLocationConstructor(volume_id, local_id, secret), offset, limit);
|
||||
|
|
@ -248,20 +250,20 @@ namespace TLSharp.Core
|
|||
await _sender.Recieve(request);
|
||||
|
||||
return Tuple.Create(request.type, request.bytes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<MessageDialogs> GetDialogs(int offset, int limit, int max_id = 0)
|
||||
{
|
||||
var request = new GetDialogsRequest(offset, max_id, limit);
|
||||
await _sender.Send(request);
|
||||
await _sender.Recieve(request);
|
||||
|
||||
return new MessageDialogs
|
||||
{
|
||||
Dialogs = request.dialogs,
|
||||
Messages = request.messages,
|
||||
Chats = request.chats,
|
||||
Users = request.users,
|
||||
return new MessageDialogs
|
||||
{
|
||||
Dialogs = request.dialogs,
|
||||
Messages = request.messages,
|
||||
Chats = request.chats,
|
||||
Users = request.users,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue