majn / telegram-purple

Adds support for Telegram to Pidgin, Adium, Finch and other Libpurple based messengers.
GNU General Public License v2.0
734 stars 81 forks source link

[BUG] Video playback not working #414

Open ghost opened 7 years ago

ghost commented 7 years ago

Apologies if this has already been mentioned. Video playback for files received does not seem to work.

OS: Windows 7 Pidgin: 2.12.0 Telegram: 1.30

For example. Will receive a message such as the below. (12:34:33 PM) Joe Bloggs: [video] The word 'video' is a hyperlink to a local path. Though when clicked only opens up an explorer window to C:\Users\%username%. However the path reads when hovering over the text 'video' file:///C:\Users\Joe\AppData\Roaming.purple\telegram-purple+00000000000\downloads/download_543534 If I browse to that directory manually and then add an extension of .MP4 to the downloaded file then I can view the video.

majn commented 7 years ago

Do the other document types work for you?

davidszp commented 7 years ago

Same issue here. Clicking on video opens an explorer window to C:\Users%username%.

fulalas commented 7 years ago

I can reproduce this on Windows only (Linux is fine), and it happens with all kind of files received. As @makloda said, when you click on the hyper-link, it always opens an Explorer window pointing to c:\Users\currentUser. I tried both 1.3.0 and 1.4.0.

majn commented 6 years ago

Can anyone using windows try to provide the actual HTML that is being printed in the chat?

fulalas commented 6 years ago

What you mean by actual HTML?

majn commented 6 years ago

The file path in the chat history.

Edit: %AppData% \ .purple\logs\telegram+4912341234\nameofyourchat... is where you can look at it.

fulalas commented 6 years ago

<a href="file:///C:\Users\MYUSER\AppData\Roaming\.purple\telegram-purple\+MYNUMBER\downloads/download_4931526095452241930.oga">[audio]</a>

criztovyl commented 6 years ago

I see a / ([...]\downloads/download[...]). IIRC Windows explorer does not like /s in a path. (further down I think an all-/-path meight work, but not mixed)

majn commented 6 years ago

So this is very likely a portability problem with libtgl.

Telegram-Purple uses glib to build OS independent paths, but the last bit of the path is generated by libtgl, which always uses "/":

https://github.com/vysheng/tgl/blob/ffb04caca71de0cddf28cd33a4575922900a59ed/queries.c#L3205-L3210