public static bool GroupFilter(EntryModel model) { if (model is ChatEntryModel chatEntryModel) { var chat = chatEntryModel.Chat; if (chat.ChatData.Type is TdApi.ChatType.ChatTypeSupergroup supergroupType) { return(!supergroupType.IsChannel); } return(chat.ChatData.Type is TdApi.ChatType.ChatTypeBasicGroup); } return(false); }
private IObservable <Avatar> LoadAvatar(IAvatarLoader avatarLoader, EntryModel entry) { if (entry.Avatar != null) { return(Observable.Return(entry.Avatar)); } switch (entry.Target) { case Chat chat: return(avatarLoader.LoadAvatar(chat.ChatData)); case Aggregate aggregate: return(avatarLoader.LoadAvatar(new TdApi.Chat { Id = aggregate.Id })); } return(Observable.Return <Avatar>(null)); }
private IObservable <Avatar> LoadAvatar(IAvatarLoader avatarLoader, EntryModel entry) { if (entry.Avatar != null) { return(Observable.Return(entry.Avatar)); } switch (entry) { case ChatEntryModel chatEntry: return(avatarLoader.LoadAvatar(chatEntry.Chat.ChatData, AvatarSize.Small)); case AggregateEntryModel aggregateEntry: return(avatarLoader.LoadAvatar(new TdApi.Chat { Id = aggregateEntry.Aggregate.Id }, AvatarSize.Small)); } return(Observable.Return <Avatar>(null)); }
public static bool All(EntryModel model) { return(true); }