Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 public static bool All(EntryModel model)
 {
     return(true);
 }