Revert "+ overload for method InviteToChannel"

This reverts commit 45be5f51d3.
This commit is contained in:
solarin 2020-04-06 10:45:40 +04:00
parent 45be5f51d3
commit 9623f9d5ac
3 changed files with 52 additions and 62 deletions

View file

@ -73,7 +73,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Network\Requests\AckRequest.cs" />
<Compile Include="Network\Requests\PingRequest.cs" />
<Compile Include="Types\ParticipantFilterTypes.cs" />
<Compile Include="Types\ParticipantTypes.cs" />
<Compile Include="Utils\UploadHelper.cs" />
<Compile Include="Session.cs" />
<Compile Include="TelegramClient.cs" />

View file

@ -524,7 +524,7 @@ namespace TLSharp.Core
/// <param name="partType">The type of the participants to get. Choose Recents not to filter</param>
/// <param name="token"></param>
/// <returns></returns>
public async Task<TLChannelParticipants> GetParticipants(TLChannel channel, int stIdx = -1, int pageSize = -1, ParticipantFilterTypes partType = ParticipantFilterTypes.Recents, CancellationToken token = default(CancellationToken))
public async Task<TLChannelParticipants> GetParticipants(TLChannel channel, int stIdx = -1, int pageSize = -1, ParticipantTypes partType = ParticipantTypes.Recents, CancellationToken token = default(CancellationToken))
{
if (channel == null) return null;
return await GetParticipants(channel.Id, (long)channel.AccessHash, stIdx, pageSize, partType, token).ConfigureAwait(false);
@ -541,31 +541,31 @@ namespace TLSharp.Core
/// <param name="partType">The type of the participants to get. Choose Recents not to filter</param>
/// <param name="token"></param>
/// <returns></returns>
public async Task<TLChannelParticipants> GetParticipants(int channelId, long accessHash, int stIdx = -1, int pageSize = -1, ParticipantFilterTypes partType = ParticipantFilterTypes.Recents, CancellationToken token = default(CancellationToken))
public async Task<TLChannelParticipants> GetParticipants(int channelId, long accessHash, int stIdx = -1, int pageSize = -1, ParticipantTypes partType = ParticipantTypes.Recents, CancellationToken token = default(CancellationToken))
{
TLAbsChannelParticipantsFilter filter;
switch (partType)
{
case ParticipantFilterTypes.Admins:
case ParticipantTypes.Admins:
filter = new TLChannelParticipantsAdmins();
break;
case ParticipantFilterTypes.Kicked:
case ParticipantTypes.Kicked:
filter = new TLChannelParticipantsKicked();
break;
case ParticipantFilterTypes.Bots:
case ParticipantTypes.Bots:
filter = new TLChannelParticipantsBots();
break;
case ParticipantFilterTypes.Recents:
case ParticipantTypes.Recents:
filter = new TLChannelParticipantsRecent();
break;
case ParticipantFilterTypes.Banned:
case ParticipantFilterTypes.Restricted:
case ParticipantFilterTypes.Contacts:
case ParticipantFilterTypes.Search:
case ParticipantTypes.Banned:
case ParticipantTypes.Restricted:
case ParticipantTypes.Contacts:
case ParticipantTypes.Search:
default:
throw new NotImplementedException($"{partType} not implemented yet");
}
@ -588,7 +588,7 @@ namespace TLSharp.Core
ChannelId = channelId,
AccessHash = accessHash
},
Filter = filter,
Filter = new TLChannelParticipantsRecent(),
Offset = found,
Limit = pageSize
};
@ -607,16 +607,6 @@ namespace TLSharp.Core
/// <summary>
/// Invites the passed users to the specified channel
/// </summary>
/// <param name="channel">The descriptor of the channel to invite the users to</param>
/// <param name="users"></param>
/// <returns></returns>
public async Task<TLUpdates> InviteToChannel(TLChannel channel, int[] users, CancellationToken token = default(CancellationToken))
{
return await InviteToChannel(channel.Id, (long)channel.AccessHash, users, token);
}
/// <summary>
/// Invites the passed users to the specified channel
/// </summary>
/// <param name="channelId">The id of the channel to invite the users to</param>
/// <param name="accessHash">The access hash of the channel to invite the users to</param>
/// <param name="users"></param>

View file

@ -1,6 +1,6 @@
namespace TLSharp.Core.Types
{
public enum ParticipantFilterTypes
public enum ParticipantTypes
{
Recents,
Restricted,