public ItemsCollection(IMTProtoService protoService, TLInputChannelBase inputChannel, TLChannelParticipantsFilterBase filter) { _protoService = protoService; _inputChannel = inputChannel; _filter = filter; _hasMore = true; }
public void GetParticipantsAsync(TLInputChannelBase inputChannel, TLChannelParticipantsFilterBase filter, int offset, int limit, Action <TLChannelsChannelParticipants> callback, Action <TLRPCError> faultCallback = null) { var obj = new TLChannelsGetParticipants { Channel = inputChannel, Filter = filter, Offset = offset, Limit = limit }; const string caption = "channels.getParticipants"; SendInformativeMessage <TLChannelsChannelParticipants>(caption, obj, result => { //for (var i = 0; i < result.Users.Count; i++) //{ // var cachedUser = _cacheService.GetUser(result.Users[i].Id) as TLUser; // if (cachedUser != null) // { // // TODO: cachedUser._status = ((TLUser)result.Users[i]).Status; // cachedUser.Status = ((TLUser)result.Users[i]).Status; // result.Users[i] = cachedUser; // } //} _cacheService.SyncUsers(result.Users, r => { }); callback?.Invoke(result); }, faultCallback); }
public void GetParticipantsAsync(TLInputChannelBase inputChannel, TLChannelParticipantsFilterBase filter, TLInt offset, TLInt limit, TLInt hash, Action <TLChannelParticipantsBase> callback, Action <TLRPCError> faultCallback = null) { var obj = new TLGetParticipants { Channel = inputChannel, Filter = filter, Offset = offset, Limit = limit, Hash = hash }; const string caption = "channels.getParticipants"; SendInformativeMessage <TLChannelParticipantsBase>(caption, obj, result => { var channelParticipants = result as TLChannelParticipants; if (channelParticipants != null) { for (var i = 0; i < channelParticipants.Users.Count; i++) { var cachedUser = _cacheService.GetUser(channelParticipants.Users[i].Id); if (cachedUser != null) { cachedUser._status = channelParticipants.Users[i].Status; channelParticipants.Users[i] = cachedUser; } } } callback.SafeInvoke(result); }, faultCallback); }
public void GetParticipantsAsync(TLInputChannelBase inputChannel, TLChannelParticipantsFilterBase filter, TLInt offset, TLInt limit, Action<TLChannelsChannelParticipants> callback, Action<TLRPCError> faultCallback = null) { var obj = new TLGetParticipants { Channel = inputChannel, Filter = filter, Offset = offset, Limit = limit }; const string caption = "channels.getParticipants"; SendInformativeMessage<TLChannelsChannelParticipants>(caption, obj, callback.SafeInvoke, faultCallback); }
public ChannelParticipantsViewModelBase(IMTProtoService protoService, ICacheService cacheService, ITelegramEventAggregator aggregator, TLChannelParticipantsFilterBase filter) : base(protoService, cacheService, aggregator) { _filter = filter; }
public ChannelParticipantsViewModelBase(IMTProtoService protoService, ICacheService cacheService, ITelegramEventAggregator aggregator, TLChannelParticipantsFilterBase filter, Func <string, TLChannelParticipantsFilterBase> search) : base(protoService, cacheService, aggregator) { _filter = filter; _search = search; }