rubenlagus / TelegramApi

Java library to create Telegram Clients
MIT License
300 stars 108 forks source link

Get INPUT_FETCH_ERROR while trying to call TLRequestPhotosGetUserPhotos #2

Closed vahidhashemi closed 8 years ago

vahidhashemi commented 8 years ago

According to telegram API for calling GetUserPhotos I have to pass an InputUser object with an offset. This is how I am doing it but every time I get INPUT_FETCH_ERROR :

//I am extracting users from contact
TLInputUser inputUser = new TLInputUser();
inputUser.setUserId(((TLUser)users.get(0)).getId());
inputUser.setAccessHash(((TLUser)users.get(0)).getAccessHash());

TLRequestPhotosGetUserPhotos getUserPhotos = new TLRequestPhotosGetUserPhotos();
getUserPhotos.setOffset(0);
getUserPhotos.setLimit(100);
getUserPhotos.setMaxId(0);
getUserPhotos.setUserId(inputUser);
TLPhotos photos = (TLPhotos) api.doRpcCall(getUserPhotos);

What is the correct way of calling "photos.getUserPhotos" ?

Thanks

rubenlagus commented 8 years ago

There is a bug in TLRequestPhotosGetUserPhotos method, working on it

rubenlagus commented 8 years ago

Using

<dependency>
        <groupId>org.telegram</groupId>
        <artifactId>telegramapi</artifactId>
        <version>57.2</version>
    </dependency>

should fix it