vysheng / tg

telegram-cli
GNU General Public License v2.0
6.49k stars 1.54k forks source link

send_photo on secret chat not working #1200

Open PazChauhan opened 8 years ago

PazChauhan commented 8 years ago

When replying to a Basic or Group message I am able to send an image using send_photo(peer, file).

When replying to a secret chat message, I generate the response using the same code as for the Basic and Group message responses i.e. using send_photo(peer, file).. However, no photo is sent for the Secret Message and telegram-cli cannot be 'safe_quit'. I need to 'quit' to exit telegram-cli, but it cannot be restarted. This is the log I get when trying to relaunch:

Telegram-cli version 1.4.1, Copyright (C) 2013-2015 Vitaly Valtman
Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license' for details.
Telegram-cli uses libtgl version 2.1.0
Telegram-cli includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit. (http://www.openssl.org/)
I: config dir=[/home/celldev/.telegram-cli]
 *** 1474463257.596190 lua: attempt to call a nil value
> telegram-cli: tgl/binlog.c:443: bl_do_edit_message_encr: Assertion `!(M->flags & TGLMF_SERVICE)' failed.
SIGNAL received
hbin/telegram-cli(print_backtrace+0x2f)[0x46ef1f]
bin/telegram-cli(termination_signal_handler+0x64)[0x46efb4]
/lib/x86_64-linux-gnu/libc.so.6(+0x354a0)[0x7f190d9df4a0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f190d9df418]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f190d9e101a]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7f190d9d7bd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f190d9d7c82]
bin/telegram-cli(bl_do_edit_message_encr+0x3f1)[0x4b0ca1]
bin/telegram-cli(tglf_fetch_encrypted_message+0xa04)[0x4af434]
bin/telegram-cli(tglf_fetch_alloc_encrypted_message+0x15)[0x4af5d5]
bin/telegram-cli[0x4a1aad]
bin/telegram-cli(tglq_query_result+0x10f)[0x49881f]
bin/telegram-cli[0x49157f]
bin/telegram-cli[0x4b5d5b]
/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x7fc)[0x7f190eea3a0c]
bin/telegram-cli(net_loop+0xa7)[0x470557]
bin/telegram-cli(loop+0x183)[0x4718c3]
bin/telegram-cli(main+0x2e5)[0x46d745]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f190d9ca830]
bin/telegram-cli(_start+0x29)[0x46d859]
purplesrl commented 8 years ago

it has worked for me to receive a photo, so it must be something random, anyway, the problem is view_photo will not work as message id is always 0

PazChauhan commented 8 years ago

Hi,

are you using send_photo on a secret chat?

send_photo works fine for me on a basic and group chat, just NOT on a secret chat. Do you have any sample code of this working for you that I can refer to please?

Thanks in advance Paz

On 17 Oct 2016, at 10:34, purplesrl notifications@github.com wrote:

it has worked for me to receive a photo, so it must be something random, anyway, the problem is view_photo will not work as message id is always 0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vysheng/tg/issues/1200#issuecomment-254159255, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4gCa2vdgPO92KmCGX6Mv9gT1a-03tJks5q00EdgaJpZM4KC0om.

Kind regards Paz Chauhan

Senior Technical Consultant Cell Software Services Ltd Email: paz.chauhan@cellsoftware.co.uk mailto:pia.fager@cellsoftware.co.uk Skype: paz.chauhan Mobile: +44(0)7778558514

http://www.cellsoftware.co.uk/ http://www.cellsoftware.co.uk/

purplesrl commented 8 years ago

@PazChauhan

i said it has worked for me to receive a photo in secret chat, i was merely pointing out that even if the function would work, there would be a problem using view_photo, which asks for msg-id, which in secret chat is always 0

update: yes, it worked to send a photo in secret chat, I used the following syntax:

send_photo !_Max /home/purple/test.jpg

I did not have debugging enabled but no error was shown and the photo was received by the other party, safe_quit does not work, but quit works and restart works

PazChauhan commented 8 years ago

Hi,

Yes, I too can receive a photo in secret chat. Luckily, I do not need to view photo, but good to know its shortcomings.

Thanks, Paz

On 17 Oct 2016, at 12:31, purplesrl notifications@github.com wrote:

@PazChauhan https://github.com/PazChauhan i said it has worked for me to receive a photo in secret chat, i was merely pointing out that even if the function would work, there would be a problem using view_photo, which asks for msg-id, which in secret chat is always 0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vysheng/tg/issues/1200#issuecomment-254182641, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4gCQtaFFdjjLFSXrsyd-wxuM1K6Zmxks5q01yagaJpZM4KC0om.

Kind regards Paz Chauhan

Senior Technical Consultant Cell Software Services Ltd Email: paz.chauhan@cellsoftware.co.uk mailto:pia.fager@cellsoftware.co.uk Skype: paz.chauhan Mobile: +44(0)7778558514

http://www.cellsoftware.co.uk/ http://www.cellsoftware.co.uk/