From 49cda3fa902cf92ffcdc3761edb2c44ec7c392e8 Mon Sep 17 00:00:00 2001 From: viegener <> Date: Sun, 29 May 2016 15:34:26 +0000 Subject: [PATCH] 50_TelegramBot.pm: Fixes for image captions and special chars in contacts git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@11548 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- CHANGED | 1 + FHEM/50_TelegramBot.pm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGED b/CHANGED index 4a6aa36a4..0a2c4debb 100644 --- a/CHANGED +++ b/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 50_TelegramBot: captions for Images / special chars in Contacts - feature: YAMAHA_AVR: new set command presetUp and presetDown for preset selection in the current input - added: 52_I2C_GY30_BH1750FVI: modul i2c light intensity sensor diff --git a/FHEM/50_TelegramBot.pm b/FHEM/50_TelegramBot.pm index 0e4892eb2..f77200c45 100644 --- a/FHEM/50_TelegramBot.pm +++ b/FHEM/50_TelegramBot.pm @@ -133,6 +133,9 @@ # added allowedCommands and doc (with modification of allowed_... device) # allowedCommands only modified on the allowed_... device # 1.7 2016-05-05 reply set command / allowedCommands as restriction + +# fix for addPar (Caption) on photos in SendIt +# fix for contact list UTF8 encoding on restart # # ############################################################################## @@ -353,6 +356,7 @@ sub TelegramBot_State($$$$) { # Log3 $hash->{NAME}, 4, "TelegramBot_State called with :$name: value :$value:"; if ($name eq 'Contacts') { + $value = TelegramBot_PutToUTF8( $value ); TelegramBot_CalcContactsHash( $hash, $value ); Log3 $hash->{NAME}, 4, "TelegramBot_State Contacts hash has now :".scalar(keys %{$hash->{Contacts}}).":"; } @@ -1258,6 +1262,7 @@ sub TelegramBot_SendIt($$$$$;$$) # add caption if ( defined( $addPar ) ) { $ret = TelegramBot_AddMultipart($hash, \%TelegramBot_hu_do_params, "caption", undef, $addPar, 0 ) if ( ! defined( $ret ) ); + $addPar = undef; } # add msg or file or stream