예제 #1
0
        public static async Task <IReadOnlyCollection <Message> > GetMessagesByIds(IReadOnlyCollection <int> messagesIds)
        {
            try
            {
                Logger.Info($"Updating messages {messagesIds.ToJson()}");

                var response = await GetMessagesJsonByIds(messagesIds);

                var profiles = ProfilesClient.FromDtoArray(response.profiles);
                var groups   = GroupsClient.FromDtoArray(response.groups);
                return(FromDtoArray(response.items, profiles, groups));
            }
            catch (Exception e)
            {
                Logger.Error(e);
                throw;
            }
        }
예제 #2
0
        public static async Task <IReadOnlyCollection <Message> > GetMessages(int dialogId, int?offset)
        {
            try
            {
                Logger.Info($"Updating messages in dialog {dialogId}");

                var response = await GetMessagesJson(dialogId, offset);

                var profiles = ProfilesClient.FromDtoArray(response.profiles);
                var groups   = GroupsClient.FromDtoArray(response.groups);
                return(FromDtoArray(response.items, profiles, groups));
            }
            catch (Exception e)
            {
                Logger.Error(e);
                throw;
            }
        }