ocilo / skype-http

Unofficial Skype API for Node.js via HTTP
https://ocilo.github.io/skype-http
MIT License
51 stars 24 forks source link

Image sending bug #102

Open grigori-gru opened 6 years ago

grigori-gru commented 6 years ago

Hello!

Link to SkPy issue

It's seems to me the best solution should be to add "X-Client-Version": "0/0.0.0.0" to headers in send-image.js. It helps me in my project, I can make pull request with it. But maybe there is some other problems which i can't catch.

jabolina commented 5 years ago

Hi, the release in npm (0.0.15), still works to send image files? And how can I achieve this, I know that the object img is:

{
  file: string,
  name: string
}

The file value can be a base 64 string made from an image?

In my application I'm using like this:

api.sendImage({
    file: base64,
    name: Math.random().toString(36).substr(2, 15)
}, messageObj.sendTo)
    .then(r => console.log(`Send image from server to Skype ${JSON.stringify(r)}`))
    .catch(e => console.error(`Error while sending media to Skype ${JSON.stringify(e)}`));

But aways end in the catch with:

Error while sending media to Skype {"name":"send-image","data":{}}

At the moment, the lib still works or I'm doing something wrong? Thanks!

jabolina commented 5 years ago

Created a pull-request adding the header. If someone want to send image either, the img object is:

{
  file: "/path/to/my/image.png",
  name: "image.png"
}

Without the header the same problem happened: {"name":"send-image","data":{}} With the header, the image was sent.

ajlucero commented 4 years ago

i got image working by adding "X-Client-Version": "0/0.0.0.0" but i coudnt enlarge or even download the image,